Nov-02-2019, 11:28 PM
(Nov-02-2019, 05:28 PM)SteampunkMaverick12 Wrote: thing is ie already tried 2 methods using os and subprocess I found on redditAs mention you should show what you tired,it also help if understand what code dos
set
is setting environment variable for current session.%CD%
get current working directory,in python os.getcwd()
.As
bin\minecraft.exe
is on a new line means that running minecraft.exe
with environment in set
.So then it could be like this.
import subprocess, os d = dict(os.environ) d['APPDATA'] = f'{os.getcwd()}\\data' subprocess.run(['bin\minecraft.exe'], env=d)