gametechmods
Off-Topic => Off-Topic Discussion => Topic started by: Condor33 on July 21, 2009, 03:37:02 PM
-
Allow me to ask the dumbest question ever. I'm trying to create a python script (I only know programming in BASIC) but I keep getting a weird error. If I type even the most simple piece of code like
print 'Hello world!'
I get an error highlighting the second [ ' ] and saying "invalid syntax." I know this is not the best forum to ask for help on, but several people here know Python and I'm the most worthless programmer ever, so I might as well ask. Anyone know what I should do here? I'm running python version 3.1 and using the copy of IDLE included with the download.
-
i think its "hecko world" and not 'hecko world'
-
in Visual Basic they use Msgbox("text here") so yes probably you need "" not ''
-
Never mind, I was reading a tutorial for 2.6 and was using 3.1, which isn't backwards compatible. :vista: I don't know how they managed to break something as simple as "hecko world," but they did, so I'm switching versions. Thanks for the help though!
-
I knew I should've chosen Python over XHTML for my subject. Darn.
-
Never mind, I was reading a tutorial for 2.6 and was using 3.1, which isn't backwards compatible. :vista: I don't know how they managed to break something as simple as "hecko world," but they did, so I'm switching versions. Thanks for the help though!
In 3.x print is a function, not a statement like it was before, so you do
print("Holy sh**!")
It's actually good they made it a function.
-
I assume that was to fix the problem of not being able to use apostrophes in print statements easily.
-
I assume that was to fix the problem of not being able to use apostrophes in print statements easily.
No, that was to make it consistent. Having one instruction a statement was a bit weird. Oh, and 3.0 was meant to break backwards-compability, hence the version number (and not 2.8).