Am 05.11.2013 20:09, schrieb Thorsten Kampe:
> is it possible to access the source code the PyInstaller executable 
> was built from during the execution?

No, the source is not included into the executable.

> The manual says: "The bundled app does not include any source code. 
> However, PyInstaller bundles compiled Python scripts (.pyc files)." 
> But that's not the truth as you can see with archive_viewer.py.

Why should this not be true? What does archive_viewer show?

> Unfortunately code_context is None when the PyInstaller executable is 
> run. So I get the line number but not the code (of which Python has 
> to know - where would it get the line number from - which is the same 
> as in the .py file).

Starting with Python 2.somehing, line-numbers are held in co_lnotab and
co_firstlineno of the resp. code-object. So you should be able to

> So how can I access the source code (or the source code file)?

This is currently not possible with stock PyInstaller. However you could
heavily tweak your .spec-file so that all dependencies are collected,
but you own modules are not packaged into the PYZ. Then you can package
you own modules in COLLECT(). This should be possible, but may be quite
some work. You may also need to tweak your main-script.


-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Monatliche Kolumne:
http://www.cissp-gefluester.de/2012-02-bring-your-own-life-glosse
Blog: http://www.goebel-consult.de/blog/sundenfall-habe-piwik-installiert

Goebel Consult ist Mitglied bei http://www.7-it.de/

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

Reply via email to