Skip to content

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
workhorsy committed Mar 12, 2019
1 parent 05c6460 commit bf45910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -118,10 +118,13 @@ if __name__ == '__main__':
Run under Pyinstaller
-----
~~~python
# NOTE: Pyinstaller may spawn infinite processes if __main__ is not used
if __name__ == '__main__':
import cpuinfo
from multiprocessing import freeze_support
freeze_support() # NOTE: Needed for Pyinstaller

# NOTE: Pyinstaller also requires freeze_support
freeze_support()
info = cpuinfo.get_cpu_info()
print(info)
~~~
Expand Down
3 changes: 2 additions & 1 deletion example/example_pyinstaller.py
Expand Up @@ -4,10 +4,11 @@
# Import cpuinfo.py from up one directory
sys.path.append('../cpuinfo')

# NOTE: Pyinstaller may spawn infinite processes if __main__ is not used
if __name__ == '__main__':
from multiprocessing import freeze_support
from cpuinfo import get_cpu_info

# NOTE: Make sure to call freeze_support or Pyinstaller will break
# NOTE: Pyinstaller also requires freeze_support
freeze_support()
print(get_cpu_info())

0 comments on commit bf45910

Please sign in to comment.