Posts: 8,160
Threads: 160
Joined: Sep 2016
Note that the original file has 57 line, so there is something extra in the OP file.
If you select the code and ©2017 (that is below the code) from Github and paste in a new file, then ©2017 is exactly on line 60.
Posts: 382
Threads: 94
Joined: Mar 2017
All that is very hard for me. Yes I am with Linux, pong was created for Windows. I tried the first line:/usr/bin/python3.5 /home/sylvain/PycharmProjects/ping/game.py
File "/home/sylvain/PycharmProjects/ping/game.py", line 3
-*- coding: utf-8 -*-
^
SyntaxError: invalid syntax
Posts: 7,319
Threads: 123
Joined: Sep 2016
Sep-22-2017, 01:46 PM
(This post was last modified: Sep-22-2017, 01:51 PM by snippsat.)
(Sep-22-2017, 01:41 PM)sylas Wrote: File "/home/sylvain/PycharmProjects/ping/game.py", line 3 -*- coding: utf-8 -*- has to be on line 1.
And you are using Python 2?
Edit:
Also missing #
# -*- coding: utf-8 -*-
Posts: 382
Threads: 94
Joined: Mar 2017
I removed the comments at the bottom of "button.py". So I came on the original code..... The result..../usr/bin/python3.5 /home/sylvain/PycharmProjects/ping/data/GUI/button.py
File "/home/sylvain/PycharmProjects/ping/data/GUI/button.py", line 60
© 2017
^
SyntaxError: invalid character in identifier
Posts: 1,298
Threads: 38
Joined: Sep 2016
Why is it on line 3? Your first two lines should look like this if you are using Python 2.x:
#! /usr/bin/python3.5
# -*- coding: utf-8 -*- Since you are using Python 3.5 you only need line 1:
#! /usr/bin/python3.5
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 382
Threads: 94
Joined: Mar 2017
Sep-22-2017, 02:25 PM
(This post was last modified: Sep-22-2017, 02:34 PM by sparkz_alot.)
I put you new first line. Now i have:/usr/bin/python3.5 /home/sylvain/PycharmProjects/ping/game.py
Traceback (most recent call last):
File "/home/sylvain/PycharmProjects/ping/game.py", line 5, in <module>
from data.main import main
File "/home/sylvain/PycharmProjects/ping/data/main.py", line 3, in <module>
from .control import Control
File "/home/sylvain/PycharmProjects/ping/data/control.py", line 4, in <module>
from .states import (classic, menu, mode, options, controls, audio, ghost, splash, keybinding, getkey)
File "/home/sylvain/PycharmProjects/ping/data/states/classic.py", line 6, in <module>
from .. import AI
ImportError: bad magic number in 'data.AI': b'\x03\xf3\r\n'
Process finished with exit code 1
Posts: 1,298
Threads: 38
Joined: Sep 2016
(Sep-22-2017, 02:25 PM)sylas Wrote: I put you new first line. Now i have:/usr/bin/python3.5 /home/sylvain/PycharmProjects/ping/game.py
If this is your first line, it is wrong and not what I showed. There should be nothing after 'python3.5' on line 1
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 382
Threads: 94
Joined: Mar 2017
I beg pardon to all of you. I have the bad way to put the name of the file at the top. I made the two tries you suggest to me, one at first , the two lines, later, but the result is always the same: bad magic number.
Posts: 5,151
Threads: 396
Joined: Sep 2016
Sep-22-2017, 05:43 PM
(This post was last modified: Sep-22-2017, 05:43 PM by metulburr.)
(Sep-22-2017, 02:25 PM)sylas Wrote: I put you new first line. Now i have:/usr/bin/python3.5 /home/sylvain/PycharmProjects/ping/game.py
Traceback (most recent call last):
File "/home/sylvain/PycharmProjects/ping/game.py", line 5, in <module>
from data.main import main
File "/home/sylvain/PycharmProjects/ping/data/main.py", line 3, in <module>
from .control import Control
File "/home/sylvain/PycharmProjects/ping/data/control.py", line 4, in <module>
from .states import (classic, menu, mode, options, controls, audio, ghost, splash, keybinding, getkey)
File "/home/sylvain/PycharmProjects/ping/data/states/classic.py", line 6, in <module>
from .. import AI
ImportError: bad magic number in 'data.AI': b'\x03\xf3\r\n'
Process finished with exit code 1 I know you are changing the code from what is actually there.
https://github.com/metulburr/pong/blob/m...trol.py#L4
There is no parenthesis on the original code, as well as no copyright symbol, you must of copy and pasted it wrong. Dont copy and paste, just download the repo. If you are changing the code from what is there, who knows what else you changed to cause the problems you are having.
As for py2, py3, linux, or windows.... I created the exe from python2.7.* on windows. As well as ran both python versions in linux and windows before uploading the repo.
Recommended Tutorials:
|