My 13 year old is the proud owner of a MacBook Pro, and I want him to use it for more than just Facebook, so we've got a copy of "Python Programming for the Absolute Beginner" (I liked the idea of learning through coding games) and we're working through it together, me on my PC, him on his MacBook. We hit a problem in Chapter 1.
The code couldn't be more basic:
When I find the file in Windows and double click it opens a console window, displays the two lines of text, then closes the window when you press the enter key, exactly as it should. The problem (and I realise this I'm probably showing my ignorance of things apple here) is that I don't know what the equivalent operation would be on the MacBook.
When my son locates the file in finder and clicks on "open using python launcher" he gets the following:
So clearly something's not happening as it should. Maybe what he's doing isn't the right way to run an executable file on a Mac. What's frustrating is that I can help him with the programming but I have just about zero experience with Macs.
Needless to say any advice would be (very) gratefully received!
The code couldn't be more basic:
print ("game over")
input ("\n\nPress the enter key to exit.")
input ("\n\nPress the enter key to exit.")
When I find the file in Windows and double click it opens a console window, displays the two lines of text, then closes the window when you press the enter key, exactly as it should. The problem (and I realise this I'm probably showing my ignorance of things apple here) is that I don't know what the equivalent operation would be on the MacBook.
When my son locates the file in finder and clicks on "open using python launcher" he gets the following:
Last login: Thu Mar 18 18:15:11 on ttys000
Gareth-Carlesss-MacBook-Pro:~ garethcarless$ cd '/Users/garethcarless/Documents/Python Code/' && '/usr/bin/pythonw' '/Users/garethcarless/Documents/Python Code/game_over.py' && echo Exit status: $? && exit 1
Game Over
Press the enter key to exit.
Traceback (most recent call last):
File "/Users/garethcarless/Documents/Python Code/game_over.py", line 2, in <module>
input("\n\nPress the enter key to exit.")
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
Gareth-Carlesss-MacBook-Pro
ython Code garethcarless$
Gareth-Carlesss-MacBook-Pro:~ garethcarless$ cd '/Users/garethcarless/Documents/Python Code/' && '/usr/bin/pythonw' '/Users/garethcarless/Documents/Python Code/game_over.py' && echo Exit status: $? && exit 1
Game Over
Press the enter key to exit.
Traceback (most recent call last):
File "/Users/garethcarless/Documents/Python Code/game_over.py", line 2, in <module>
input("\n\nPress the enter key to exit.")
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
Gareth-Carlesss-MacBook-Pro
So clearly something's not happening as it should. Maybe what he's doing isn't the right way to run an executable file on a Mac. What's frustrating is that I can help him with the programming but I have just about zero experience with Macs.
Needless to say any advice would be (very) gratefully received!