print '''Content - type: text/html
5 replies to this topic
#1
Posted 18 May 2011 - 08:58 PM
When I type this in IDLE, it just goes in a loop. Whats happening here? I'm using Python 3.1.3 on Win7.
|
|
|
#2
Posted 18 May 2011 - 09:03 PM
I do not know anything about Python, although when I run it I get this:
[FONT=Courier New] File "prog.py", line 2
print '''Content - type: text/html
^ SyntaxError: EOF while scanning triple-quoted string literal[/FONT]The IDE you are using likely has trouble parsing that statement and returning its error.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 19 May 2011 - 04:05 AM
@Alexander: IDLE is not an IDE, it's a GUI for the Python REPL.
@OP: The reason IDLE is just looping is you never complete the triple-quote string, which is by it's nature a multi-line string. You have to close it:
@OP: The reason IDLE is just looping is you never complete the triple-quote string, which is by it's nature a multi-line string. You have to close it:
print('''Content - type: text/html
You can have more content here.
And then end it with 3 quotes.''')
Remember that in Python 3 (what you're using), print is no longer a keyword and is now a function.
Edited by ZekeDragon, 19 May 2011 - 08:32 PM.
Wow I changed my sig!
#4
Posted 19 May 2011 - 09:50 AM
I see. Thanx everyone.
#6
Posted 19 May 2011 - 08:31 PM
Alexander said:
IDLE is an IDE.
Wow I changed my sig!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









