Nov-01-2019, 04:56 PM
Nov-01-2019, 05:03 PM
first, by giving it a try,
and if unsuccessful then asking questions.
and if unsuccessful then asking questions.
Nov-02-2019, 03:22 PM
(Nov-01-2019, 05:03 PM)Larz60+ Wrote: [ -> ]first, by giving it a try,thing is ie already tried 2 methods using os and subprocess I found on reddit
and if unsuccessful then asking questions.
Nov-02-2019, 05:28 PM
show it.
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)