Changing path to python in pip.exe, ipython.exe, etc

2024-04-25 Thread Olivier B. via Python-list
I am building a python work environment where - i build python from sources - install pip with the wheel bundled with python - then install things with pip, like Jupyter That environment is then deployed on various machines, at various installation folders. One issue I encounter, is the path

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Olivier B. via Python-list
Partly answering myself: For some reason, right after mystdout has been created, i now have to do mystdout.seek(0) and this solves the issue. No idea why though.. Le jeu. 11 avr. 2024 à 14:42, Olivier B. a écrit : > > I am trying to use StringIO to capture stdout, in code that look

First two bytes of 'stdout' are lost

2024-04-11 Thread Olivier B. via Python-list
I am trying to use StringIO to capture stdout, in code that looks like this: import sys from io import StringIO old_stdout = sys.stdout sys.stdout = mystdout = StringIO() print( "patate") mystdout.seek(0) sys.stdout = old_stdout print(mystdout.read()) Well, it is not exactly like this, since

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Olivier B. via Python-list
libpython.so, which could be pointing to any version. I'll try that next Le ven. 29 mars 2024 à 10:10, Barry a écrit : > > > > > On 28 Mar 2024, at 16:13, Olivier B. via Python-list > > wrote: > > > > But on Linux, it seems that linking to libpython3.so instead of >

Making 'compiled' modules work with multiple python versions on Linux

2024-03-28 Thread Olivier B. via Python-list
I have a python module that includes some C++ code that links with the Python C API I have now modified the c++ code so that it only uses the Limited API, and linked with python3.lib instead of python311.lib. I can now use that python module with different python versions on Windows But on

Module use of python3_d.dll conflicts with this version of Python

2023-01-26 Thread Olivier B.
Hi,I am in the process of trying to make my code (an c++ executable and swig modules using the Python C API) lose the dependency to python 3.7, to be compatible with all Python 3.2+ I tried linking to python.lib instead of python37.lib. As i am still using a few things that are not in the limited