1

I need to run pdb2mdb.exe utility, and pass DLL file as argument.

After long googling, and playing with various call/Popen - I still can't find solution...

Here is last code:

def pdb2mdb(logger, modsrcdll): os.chdir("C:\\Program Files (x86)\\Unity\\Editor\\Data\\MonoBleedingEdge\\lib\\mono\\4.0\\") subprocess.call("pdb2mdb.exe %s" % modsrcdll) 

But - this way pdb2mdb.exe don't want accept argument, and prints it's help:

Copy file d:\***.dll to C:\cloudlibrary\data Copy file D:\***.dll.xml to C:\cloudlibrary\data PDP FOUND pdbexe found Mono pdb to mdb debug symbol store converter Usage: pdb2mdb assembly 

Without os.chdir() - it can't parse C:\\Program Files (x86) at all...

I have used subprocess.call() earlier under Linux, and never had such problems, for example:

subprocess.call('ls -l %s | grep -v total' % self.path, shell=True)

1
  • Paths with embedded space characters have to be quoted with ". i.e. subprocess.call('pdb2mdb.exe "%s"' % modsrcdll). Commented Jun 5, 2015 at 12:27

1 Answer 1

2

You can try subprocess.Popen

p = subprocess.Popen("pdb2mdb.exe modsrcdll", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) out, err = p.communicate() print out print err 

Example: The code below will open notepad.exe from C:\\Windows\\System32 and give the file test.txtas an argument. The same might work for your .dll

import subprocess def myFunc(): p = subprocess.Popen("C:\\Windows\\System32\\notepad.exe c:\\Users\\admin\\Desktop\\test.txt", stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() print out print err myFunc() 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.