Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How does WinPython find and use winpython.ini#1423

Answeredbystevecj
stevecj asked this question inQ&A
Discussion options

I am trying to write a compiled wrapper that runs Python programs via WinPython, passing an environment similar to the environment that is set up bypython.bat (which invokesenv.bat). I can tell that I'm getting a different result because if I add an entry to the[environment] section ofwinpython.ini, then Python can read that value when executed through python.bat but not when executed through my compiled wrapper.

I have tried comparing the environments generated by my wrapper and bypython.bat, and there is nothing different that seems like it could be relevant.

What am I missing?

Things I have double checked:

  • sys.executable does have the correct value.
  • Values passed into the environment of the subprocess by my executable wrapper are accessible by the Python code.

Why it matters for me:

I don't actually need to configure anything throughwinpython.ini, but the fact that the configuration is not being applied makes me concerned about what else might not work correctly for me using this process.

You must be logged in to vote

I finally figured out thatwinpython.ini is actually handled inenv_for_icons.bat, not env.batand that it is converted into commands that are executed from within that batch file that do things like setting environment variables, so that's why nothing inwinpython.ini` was having any effect.

Replies: 7 comments 2 replies

Comment options

I finally figured out thatwinpython.ini is actually handled inenv_for_icons.bat, not env.batand that it is converted into commands that are executed from within that batch file that do things like setting environment variables, so that's why nothing inwinpython.ini` was having any effect.

You must be logged in to vote
0 replies
Answer selected bystevecj
Comment options

Indeed, this is this beautiful line:

FOR /F "delims=" %%i IN ('""%WINPYDIR%\python.exe" "%~dp0WinpythonIni.py""') DO set winpythontoexec=%%i%winpythontoexec%set winpythontoexec=

As you can't propagate upward a change of variables, you have to "replay" the output kindly generated per WinpythonIni.py
(or WinpythonIni.vbs in earlier versions)

You must be logged in to vote
0 replies
Comment options

Where did the functionality ofwinpython.ini moved onto?
Is the user expected to useenv.ini inscripts instead ofwinpython.ini insettings?

You must be logged in to vote
2 replies
@stonebig
Comment options

Env.ini is to not have to regenerate the env.bat every release . Whatever small things that can trouble an anti virus

@RoyiAvital
Comment options

So why iswinpython.ini missing from the latest release?

Comment options

Hu ? Hummm, did I forgot to force generate it at first icon click ?

You must be logged in to vote
0 replies
Comment options

apparently i did remove the "useless otherwise" call to get that winpython.ini generated per winpythonini.py.

so until you try an icon, it's not created

... someone has to find where that overkill broomstick gesture happened

You must be logged in to vote
0 replies
Comment options

before summer 2024 settings/winpython.ini was created if empty per env.bat
now it's only created per env_for_icons.bat via winpython.ini
... may need a tweak of build process

You must be logged in to vote
0 replies
Comment options

#1581

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@stevecj@stonebig@RoyiAvital

[8]ページ先頭

©2009-2025 Movatter.jp