Government Security
Network Security Resources

Jump to content

Photo

Python 3.1.1+ Syntax Error


  • Please log in to reply
7 replies to this topic

#1 Squirell

Squirell

    Private First Class

  • Members
  • 54 posts

Posted 24 April 2010 - 08:52 AM

Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) 
[GCC 4.4.1] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> print('Hello World')
And I keep getting a box that says 'invalid syntax' and it puts a red box around the 1 in 3.[1].1+ so I am guessing that this is the problem but maybe I am wrong... Any help?

#2 bonarez

bonarez

    Retired GSO Second Lieutenant

  • Sergeant Major
  • 1,252 posts

Posted 24 April 2010 - 09:10 AM

It looks like python is trying to interpret the line 'Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22)'

how exactly are you running this? you'll need to elaborate
"Ask the right question and you will receive the right answer. I'm just very sensitive about the right syntax"

Read the rules before you post

#3 Squirell

Squirell

    Private First Class

  • Members
  • 54 posts

Posted 24 April 2010 - 09:12 AM

It looks like perl is trying to interpret the line 'Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22)'

how exactly are you running this? you'll need to elaborate


I am running it in IDLE (using Python-3.1). That's the exact name of it anyhow.

#4 bonarez

bonarez

    Retired GSO Second Lieutenant

  • Sergeant Major
  • 1,252 posts

Posted 24 April 2010 - 09:48 AM

I am running it in IDLE (using Python-3.1). That's the exact name of it anyhow.

the development environment is not important, how the code is interpreted is.. what is in the exact contents of the code window in your IDE?
"Ask the right question and you will receive the right answer. I'm just very sensitive about the right syntax"

Read the rules before you post

#5 Squirell

Squirell

    Private First Class

  • Members
  • 54 posts

Posted 24 April 2010 - 09:55 AM

I am running it in IDLE (using Python-3.1). That's the exact name of it anyhow.

the development environment is not important, how the code is interpreted is.. what is in the exact contents of the code window in your IDE?


What I posted earlier. That is the entire contents of the window. That's all there is.

#6 bonarez

bonarez

    Retired GSO Second Lieutenant

  • Sergeant Major
  • 1,252 posts

Posted 24 April 2010 - 10:50 AM

Well that's why you get the error

Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) 
[GCC 4.4.1] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> print('Hello World')
everything in there gets interpreted by python, whatever you put in there so comment bs out with #

#Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) 
#[GCC 4.4.1] on linux2
#Type "copyright", "credits" or "license()" for more information.
#==== No Subprocess ====
#>>> 
print('Hello World')

+ unix peepz like to see a shabang in front of that
#!/usr/local/bin/python

"Ask the right question and you will receive the right answer. I'm just very sensitive about the right syntax"

Read the rules before you post

#7 Squirell

Squirell

    Private First Class

  • Members
  • 54 posts

Posted 24 April 2010 - 10:58 AM

Well that's why you get the error

Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) 
[GCC 4.4.1] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> print('Hello World')
everything in there gets interpreted by python, whatever you put in there so comment bs out with #

#Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) 
#[GCC 4.4.1] on linux2
#Type "copyright", "credits" or "license()" for more information.
#==== No Subprocess ====
#>>> 
print('Hello World')

+ unix peepz like to see a shabang in front of that
#!/usr/local/bin/python


Hmm... That does make sense. Don't know why I didn't think of that... Thank you for your help mate.

#8 P0W3RFU7

P0W3RFU7

    Private

  • Members
  • 7 posts

Posted 04 September 2010 - 01:41 AM


after reinstalling windows, I installed python 3, when i try to open any python file, it crashes and give me this error!(it didn't have this problem before)

Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp720

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


please help me solve this problem, I'm new to python.
Thanks

---------17----------





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users