Python Forum
Open file - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Open file (/thread-2555.html)



Open file - Alex - Mar-24-2017

Hi. I am trying to open a file in Python IDLE but nothing happends besides theese signs and letters appearing:

Does somone know why this is happening? 
Kind regards,
 Alex

Moderator sparkz_alot:
Moved to proper location.  Added spoiler tags.



RE: Open file - Larz60+ - Mar-24-2017

Posting a big slab of bytecode isn't going to get you anywhere.

Post:
  • Your code
  • Your error traceback verbatim, complete!
  • Where you think the problem may lie (if you have a clue)



RE: Open file - wavic - Mar-24-2017

Is the file extension .pyc ? If it is, this is compiled python source code. You need file with .py at the end


RE: Open file - Alex - Mar-25-2017

Sorry, I did not know how else to formulate the question as I have noe clue whatsoever why the bytecode is appearing. Yes, the file ends with .py


RE: Open file - Larz60+ - Mar-25-2017

This file is compiled python. The original extension was .pyc and was copied to a .py or the extension changed.
You need to find the original .py file to run the code.
If you can't find the original python code, you can try to decompile with https://pypi.python.org/pypi/uncompyle6