1

For example in batch (windows) you can use %CD%\ or .\ to start something from cwd but I dont know how to do it on python...

I triedsubprocess.call(['.\somedirectory\someprogram.exe']) And subprocess.call(['\\somedirectory\someprogram.exe'])

edit: Also the command I used in batch is: start %CD%\somedirectory\someprogram.exe or start .\somedirectory\someprogram.exe

gunpowder
  • 19
  • 2
  • Possible duplicate of [Find current directory and file's directory](http://stackoverflow.com/questions/5137497/find-current-directory-and-files-directory) – Namit Singal Mar 27 '16 at 13:46

1 Answers1

0

I havent tested it but this should work:

from subprocess import call
call(["start %CD%\somedirectory\someprogram.exe", "-l"])

However your filepath declaration seems a bit strange to me.

frankenapps
  • 5,800
  • 6
  • 28
  • 69
  • Did you mean 'os.system(start %CD%\somedirectory\someprogram.exe)' Because the command you suggested does not work. Note: im using python 3.5 and Im trying to make something all in python. – gunpowder Mar 27 '16 at 14:30