What does pyinstaller do with “builtins.help”

25 views
Skip to first unread message

Blair

unread,
Aug 14, 2020, 5:43:14 AM8/14/20
to PyInstaller

I am trying to build a simple Python interactive console application using PyInstaller.

I would like the Python `help()` to be available, but it seems that PyInstaller somehow changes the contents of builtins and removes help.

Here is a simple script that opens a Python window. When I run this script directly in a Windows Command Prompt, I can access help() from the interactive session.

import code code.InteractiveConsole().interact()

However, if I build an executable by

PyInstaller test.py

and run it, help is not available. And when I look at the contents of builtins I see that it is not included.

I am on Windows 10, using the latest Python 3.8 release.

(This question has also been posted here: https://stackoverflow.com/questions/63402450/what-does-pyinstaller-do-with-builtins-help)




This electronic transmission and any documents accompanying this electronic transmission contain confidential information belonging to the sender. This information may be legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited.

To ensure compliance with legal requirements and to maintain cyber security standards, our IT systems are subject to ongoing monitoring, activity logging and auditing. This monitoring and auditing service may be provided by third parties. Such third parties can access information transmitted to, processed by and stored on our IT systems.

Nico Zanferrari

unread,
Aug 14, 2020, 7:04:02 AM8/14/20
to PyInstaller
Hi Blair,

this is due to the fake site.py that PyInstaller uses - it also breaks the quit() and license function in the interactive shell. You need to change it a bit, like what I've done here.


Nico

--
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 pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/38169c3b-c348-4295-845c-f8437615d4d3n%40googlegroups.com.

Blair

unread,
Aug 15, 2020, 7:38:23 AM8/15/20
to PyInstaller
Excellent. Problem solved. Thank you Nico :-)
Reply all
Reply to author
Forward
0 new messages