Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cant Run Code
#1
my question here: I tried running this code in Python 2.7 (pressing F5) it shows syntax error help!

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print raw_input("USERNAME: ")
USERNAME: username
username
>>> print raw_input("PASSWORD: ")
PASSWORD: password
password
>>> print 1234
1234
>>> print raw_input("Enter The Captcha (number on screen): ")
Enter The Captcha (number on screen): 1234
1234
>>> print raw_input("Login?")
Login?Yes
Yes
>>> print ("Login Success!")
Login Success!
>>> print (" You have two 15 new Mails!")
 You have two 15 new Mails!
>>> 
Reply
#2
https://python-forum.io/Thread-Basic-How...ython-code

Read our tutorial how to execute python code. It looks like you try to re-run code written in the interactive prompt.
Reply
#3
Quote:I tried running this code in Python 2.7 (pressing F5) it shows syntax error help!
You can not have >>> in script,it's used when in interactive shell.
So if run code as script,i need to not use >>>.

[Image: Wn7asS.jpg]

As a new user you should use Python 3.6 and pip installation under Windows
Find a editor better than IDLE.
PyCharm free Community edition , Thonny.
REPL IPython  or ptpython and look at part-2.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020