-2

I have a small project compiled as an exe and heard that you can decompile python projects. I have downloaded uncompyle2 but am unfamiliar how to install and use it on the exe. Any help or tutorial links would be good. I am new to python so go gentle.

I did use cd 'dir' command to navigate to the setup.py file and installed it but now i am not sure how to call it unless i did something wrong during the installation maybe?

George Veron
  • 35
  • 1
  • 6

2 Answers2

0

From the uncompyle2 README:

Usage
-----

uncompyle2 -h       prints short usage
uncompyle2 --help   prints long usage
martineau
  • 119,623
  • 25
  • 170
  • 301
  • I typed that command but it didn't work to i have to navigate to a different path? – George Veron May 29 '12 at 02:06
  • Actually i now found that it installed in C:\python27\lib\site-packages not sure how to use it no – George Veron May 29 '12 at 03:56
  • Uncompyle2 is a Python script, so you'd need to run it using the Python interpreter (i.e. `c:\python27\python uncompyle2.py --help`) or `import` it into your own script. Note that it decompiles Python 2.7 byte-code .pyc/.pyo files, not Windows .exe files. – martineau May 29 '12 at 08:23
  • See [How to decompile an exe file compiled by py2exe?](http://stackoverflow.com/questions/6287918/how-to-decompile-an-exe-file-compiled-by-py2exe) – martineau May 29 '12 at 08:29
  • @martineau, what exactly do you mean when running it in python internpreter? I'm in python prompt but can't get this working – incognito Sep 24 '12 at 17:24
  • @incognito: The line shown in my previous comment is how to start the Python interpreter and tell it to run the Uncompyle2 script at a Windows command-line prompt. You could `import` it at a Python interpreter prompt, but it then would be difficult to pass the `-h` or `--help` argument that way. You might need to manually define the contents of `sys.argv` before doing the `import` to get it to print the help messages. – martineau Sep 24 '12 at 18:56
0

Did you import uncompyle2? You have to import it from python interpreter before using it.