risolto spostando l'eseguibile e con la raw string. Grazie a tutti.
Il giorno 21 ottobre 2013 16:37, Alessandro Dentella <san...@e-den.it> ha scritto: > On Mon, Oct 21, 2013 at 03:36:17PM +0200, Marco Buttu wrote: > > On 10/21/2013 12:45 PM, Marco Passanisi wrote: > > > > > >import subprocess > > >output = subprocess.Popen('"C:\Windows\System32\dnscmd.exe" > > >/EnumZones', shell=True, stdout=subprocess.PIPE, > > >stderr=subprocess.PIPE) > > > > > >out, err = output.communicate() > > > > > >print(err) > > > > Ciao, innanzitutto, come ti hanno detto, dovresti usare delle > > stringhe raw. Pero' il problema non e' questo, perche' sei stato > > fortunato e nessuna delle sequenze di caratterei \x fa parte di una > > sequenza di escape ;) > > Inoltre, quando usi shell=True, la stringa viene eseguita dalla > > shell sottostante, quindi avresti potuto scrivere direttamente: > > > > subprocess.Popen("C:\Windows\System32\dnscmd.exe /EnumZones", > shell=True,...) > > no, qui manca ancora la raw string! > > subprocess.Popen(r"C:\Windows\System32\dnscmd.exe > /EnumZones",shell=True,...) > > forse basta anche > > subprocess.Popen("C:/Windows/System32/dnscmd.exe /EnumZones", > shell=True,...) > > che a me pare più leggibile. > > > sandro > *:-) > > > > -- > Sandro Dentella *:-) > http://www.reteisi.org Soluzioni libere per le scuole > http://sqlkit.argolinux.org SQLkit home page - > PyGTK/python/sqlalchemy > > > > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python >
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python