0

I have just started using python3.3. The shell looks like this:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print ("hello world")

It prints hello world correclty, but in the command line it shows error in line 1 (i.e Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 ) declaring it as a syntax error.

What is the problem??

5
  • 1
    Are you trying to do: print "hello world" in py3.x? Commented Sep 19, 2013 at 9:15
  • 1
    Please show the actual error. Commented Sep 19, 2013 at 9:15
  • @hcwhsa: probably he wants to do print ("hello world") in bash command line Commented Sep 19, 2013 at 9:28
  • @justhalf Could be, but it's hard to say anything unless OP provides actual traceback. Commented Sep 19, 2013 at 9:37
  • You have shown us the code that works, but you have failed to show us the code that doesn't work. Please copy-paste the precise command line you issued, and the response that you see. Commented Sep 19, 2013 at 14:51

2 Answers 2

1

You are specifying the syntax incorrectly on the command line. The correct syntax is:

$ python3 -c 'print ("hello world")'
Sign up to request clarification or add additional context in comments.

Comments

0

That's not an error. That's what appears when you open the interactive interpreter by typing $ python3, telling you what version of python you have and other details (such as the date).

1 Comment

@user26372 Please edit your question showing the full traceback and everything else that is necessary

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.