compilation

How can I use the python compile function on an empty string?

How can I use the python compile function on an empty string? Question: I have a piece of code that calculates the sum of a number of variables. For example, with 3 variables (A = 1, B = 2, C = 3) it outputs the sum X = 6. The way the code is implemented …

Total answers: 2

How to replace setup.py with a pyproject.toml for a native C build dependency?

How to replace setup.py with a pyproject.toml for a native C build dependency? Question: I came across this little project for creating a C-compiled version of the Black-Scholes function to be used in python. Although the example code seem to have been published in July this year, it seem that the use setup.py type of …

Total answers: 1

why python compiler doesn't ignore syntax errors after exit()?

why python compiler doesn't ignore syntax errors after exit()? Question: I have a question about the python compiler. I was running the below code but I got some errors that weren’t logical. if you run a python code and then add the exit() function to it, it would exit the program and the following codes …

Total answers: 1

Pyinstaller can't find a module? (error loading Python DLL)

Pyinstaller can't find a module? (error loading Python DLL) Question: I compiled my program with pyinstaller, and it works fine on my computer, but whenever I ty to run it in another computer (with no python), I get the following error: Error loading Python DLL ‘C:UsersperezAppDataLocalTemp_MEI28162python310.dll’. LoadLibrary: Cannot find specified module What can I do? …

Total answers: 3

PyInstaller won't import pywin32 / win32clipboard – ImportError upon running executable

PyInstaller won't import pywin32 / win32clipboard – ImportError upon running executable Question: I’m working in Windows 10 with Python 3.8.6 and using PyInstaller 4.0 to compile my script as an executable for distribution. I just added a feature today that required importing win32clipboard. PyInstaller finishes compiling without any errors, but the excecutable fails to load …

Total answers: 2

Should I add Python's pyc files to .dockerignore?

Should I add Python's pyc files to .dockerignore? Question: I’ve seen several examples of .dockerignore files for Python projects where *.pyc files and/or __pycache__ folders are ignored: **/__pycache__ *.pyc Since these files/folders are going to be recreated in the container anyway, I wonder if it’s a good practice to do so. Asked By: planetp || …

Total answers: 1

OpenSSL FIPS_mode_set not working in Python cryptography library

OpenSSL FIPS_mode_set not working in Python cryptography library Question: According to Python Cryptography library’s documentation [1], it is possible to build a custom cryptography wheel with OpenSSL statically linked. I tried doing this with an OpenSSL installation built with FIPS object module and was able to successfully build the wheel but found out that it …

Total answers: 1

How to use pyinstaller?

How to use pyinstaller? Question: Okay so I’m a complete noob in programming and I’m trying to compile a simple program I wrote that takes in a string and prints out the string in morse code it’s called morse.py. I installed pyinstaller using pip install pyinstaller and I am trying to compile my program using …

Total answers: 5

Unable to build blender

Unable to build blender Question: I am trying to build blender so that I can use it directly from python and was going through this tutorial and I got stuck on the very first make command giving me CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find PythonLibsUnix (missing: PYTHON_LIBRARY PYTHON_LIBPATH PYTHON_INCLUDE_DIR PYTHON_INCLUDE_CONFIG_DIR) I am using …

Total answers: 6

Cython for a Django app: would it work?

Cython for a Django app: would it work? Question: Would compiling with cython work with a python 3.4 Django app, or could it be made to work without a huge amount of effort? This answer – https://stackoverflow.com/a/7347168/805141 – to a question about protecting python code prompted me to ask this question. A similar question has …

Total answers: 3