Need help with gui

Ok this isnt really anything to do with blender, but i cant find anywere else to post for help , so here goes. ive created a very simple programme just for some practice , i’m pretty new to coding so dont expect much lol.
here is the script

import random from datetime import datetime

def Date_checker():
print “Type date for current date”
print “Type month for current month”
print “Type year for current year”
while True:

     now = datetime.now()


     response = raw_input()


     if response == "date":
         print now.day
     if response == "month":
         print now.month
     if response == "year":
         print now.year

now this works fine , i also know how to add the gui script , but when ever i start the gui exe , its just a blank window.
my question is , how do i add this script to a gui.

Hello Twitch1139,

I’ve been getting some excellent help on this forum, and so I thought I’d look for a place where I might help someone else as a way to give back. Unfortunately, most of the topics are still way over my head!! :frowning:

But your question looked like I might have a ghost of a chance of helping, so maybe I can give it a try…

The first thing that might help is if you enclosed your code in the “CODE” tags. You can do that by clicking “GO ADVANCED” (big orange button below your text entry box) and then highlighting your code and clicking on the “#” icon at the end of the second formatting line (the line that starts with B I U).

This will preserve your indentation … which is particularly important in Python!!

That will make your code look like this:

print "Hello Blender!!"

for i in range(5):
    print ( "Counting to " + str(i) )

Please do that, and I’ll see if I can help … no promises!!

GUIs run within a context so you have to pick which context makes sense for your script. If you have not checked out the existing Templates (located under the Templates menu of the built-in text editor) I suggest doing so. There are some simple panel scripts in the list that you can put your test code into.