GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — How does WinPython find and use winpython.ini · winpython/winpython · Discussion #1423

How does WinPython find and use winpython.ini #1423

Answered by stevecj
stevecj asked this question in Q&A
How does WinPython find and use winpython.ini #1423
@stevecj stevecj
Oct 14, 2024 · 7 comments · 2 replies
Answered by stevecj Return to top
Discussion options
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Uh oh!

    There was an error while loading. Please reload this page.

stevecj
Oct 14, 2024

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 by python.bat (which invokes env.bat). I can tell that I'm getting a different result because if I add an entry to the [environment] section of winpython.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 by python.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 through winpython.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
All reactions
Answered by stevecj Oct 16, 2024

I finally figured out that winpython.ini is actually handled in env_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.

View full answer

Replies: 7 comments · 2 replies

Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

stevecj
Oct 16, 2024
Author

I finally figured out that winpython.ini is actually handled in env_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
All reactions
  • ❤️ 1
0 replies
Answer selected by stevecj
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig
Oct 21, 2024
Maintainer

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
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

RoyiAvital
May 5, 2025

Where did the functionality of winpython.ini moved onto?
Is the user expected to use env.ini in scripts instead of winpython.ini in settings?

You must be logged in to vote
All reactions
2 replies
@stonebig
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig May 5, 2025
Maintainer

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

All reactions
@RoyiAvital
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

RoyiAvital May 5, 2025

So why is winpython.ini missing from the latest release?

All reactions
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig
May 5, 2025
Maintainer

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

You must be logged in to vote
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig
May 5, 2025
Maintainer

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
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig
May 5, 2025
Maintainer

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
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

stonebig
May 5, 2025
Maintainer

#1581

You must be logged in to vote
All reactions
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
@stevecj @stonebig @RoyiAvital
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.