Run wine command from python

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
gnerred
Newbie
Newbie
Posts: 2
Joined: Wed Oct 09, 2013 4:37 am

Run wine command from python

Post by gnerred »

I have Apache that serves a web service with a python script. I trie to execute a WINE command from python, but nothing happens...

command1 = 'dir > test.txt'
command2 = 'wine someexecutable.exe inputfile outpufile'
p = subprocess.call(command1, shell=True)
p = subprocess.call(command2, shell=True)

The command1 is normally executed, and I get a test.txt file. It seems that command2 is not executed at all... If I execute it manually from the shell with www-data user, the command2 exectues and I get the output file -> not a permission problem. Is there something to configure to allow python to execute wine commands ? Nothing appears in Apache log. Any idea is welcome.

Thanks !
guest3543
Level 2
Level 2
Posts: 12
Joined: Sat Feb 20, 2010 12:00 am

Re: Run wine command from python

Post by guest3543 »

does it help:

Code: Select all

result = subprocess.Popen( command , shell=True, stdout = subprocess.PIPE, subprocess= sb.PIPE).communicate()
print result
gnerred
Newbie
Newbie
Posts: 2
Joined: Wed Oct 09, 2013 4:37 am

Re: Run wine command from python

Post by gnerred »

I does not solve the problem, but now I see where it is... problem with slashes and backslashes. thanks!
Locked