Python Forum
I'm afraid it is a question of copyright
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm afraid it is a question of copyright
#11
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.
Reply
#12
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
Reply
#13
(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 -*-
Reply
#14
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
Reply
#15
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
Reply
#16
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
Reply
#17
(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
Reply
#18
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.
Reply
#19
(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:
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020