* Hartmut Goebel (Tue, 05 Nov 2013 20:44:15 +0100)
> 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?

"\program files\pyinstaller\utils\archive_viewer.py" script.exe
 pos, length, uncompressed, iscompressed, type, name
[(0, 1263131, 1263131, 0, 'z', 'out00-PYZ.pyz'),
[...]
 (1279179, 286, 478, 1, 's', 'script'),
[...]

script is script.py from which script.exe was built.

> > 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

I'm already able to via frame.f_lineno. The one that does not work is 
inspect.getframeinfo(frame).code_context.

Thorsten

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to