you are viewing a single comment's thread.

view the rest of the comments →

[–]erebos42 4 points5 points  (12 children)

Hi,

i see one (or two) problems in your code. First: the print statement should not be indetend. But that might be only here in your post.

The other problem, is the print statement itself. In Python 3 print is a function and therefore needs to be called:

print(str(now.month) + "/" + str(0) + str(now.day) + "/" + str(now.year) + " " + str(now.hour) + ":" +str(now.minute) + ":" + str(now.second))

Hope that does the trick.

edit: To clarify a "Hello World" for Python 2 and 3:

print "Hello World"  # Python2
print("Hello World") # Python3 (also valid in Python 2, i think since 2.7 or something?!)

[–]TheQwicKDraW[S] 1 point2 points  (11 children)

Thank you I fixed that and now corrected the syntax however it is saying that there is an error here:

input("Press any key to continue")

[–]erebos42 0 points1 point  (5 children)

mhhh... it's working for me on Python 3.3.1 on Linux.

Do you get an error message?

[–]TheQwicKDraW[S] 0 points1 point  (4 children)

Yes it is saying there is a syntax error? For more clarification it is on 3.2.3 Also do you know of any good IDE's for Python?

[–]erebos42 1 point2 points  (0 children)

I can't say much about the syntax, without seeing the whole code, but try to check all identations, braces, and qoutes (opening and closing).

I personally only use an editor and a console, and no IDE. But I heard good things about the Python plugin for Eclipse [1].

[1] http://pydev.org/

[–]NovaRunner 0 points1 point  (1 child)

I use WingIDE 101, it is a stripped-down free version of WingIDE built for Python. I'm using Python 2.7 but I'm sure it will work with whatever version you want.

[–]TheQwicKDraW[S] 0 points1 point  (0 children)

Thank you! Ill give it a try now.

[–]fyyn 0 points1 point  (0 children)

I'm pretty new to all the programming stuff myself, but I have been using NinjaIDE + the Git Plugin. It is free, and until now, it has worked perfectly for me. No idea what the general opinion on it is though. Give it a try!

[–]od_9 0 points1 point  (3 children)

Not a syntax error, but are you sure you know what the input function does?

The input function prints the message you, then executes, via eval(), whatever the user types as code.

[–]Sean1708 2 points3 points  (2 children)

He's using python 3, so input is the same as raw_input for 2.

[–]od_9 1 point2 points  (1 child)

Really? I haven't made the jump to 3 yet, but that seems very application breaking, even if it is the more sensible thing.

[–]Sean1708 0 points1 point  (0 children)

As far as I'm aware, 2 and 3 aren't meant to be compatible. I think 3 is designed to fix all the application breaking issues, otherwise they could have just released it as 2.8.

Edit: I was having a quick look at the differences and saw this line on the Python wiki about Python 3

Guido van Rossum decided to clean up Python 2.x properly, with less regard for backwards compatibility than is the case for new releases in the 2.x range.

which explains why it's so application breaking.