[Zope-it] is live?
Guido Notari
gnotari@linkgroup.it
Sat, 19 Apr 2003 16:24:04 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C30690.17FB2C60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>from os import spawnl, P_WAIT
>def linea():
>return not
>spawnl(P_WAIT,'C:\WINDOWS\system32\ping.exe','ping','-c1','-q','217.58.x=
>xx.yyy')
>
>
>Ma mi restituisce sempre un errore (file not found)
>
>prova
>
>spawnl(P_WAIT,'C:\\WINDOWS\\system32\\ping.exe','ping','-c1','-q','217.5=
8.xxx.yyy')
>
>o anche
>
>spawnl(P_WAIT,'C:/WINDOWS/system32/ping.exe','ping','-c1','-q','217.58.x=
xx.yyy')
> O anche:
> spawnl(P_WAIT, =
r'C:\WINDOWS\system32\ping.exe','ping','-c1','q','217.58.xxx.yyy')
Evidentemente il problema non era nella stringa del path -- anche se non =
e` una buona idea scriverla con i backslash "lisci". A proposito, =
Python, al contrario di qualche altro linguaggio, trasforma solo alcune =
sequenze (per esempio \t) nei caratteri speciali, le altre sequenze con =
backslash rimangono intatte, cioe` \W resta la sequenza dei due =
caratteri \ e W. In altri linguaggi la sequenza viene ridotta alla sola =
lettera W.
Questo comportamento spiega perche` certe volte i path "alla Windows", =
con i backslashes, funzionano, e certe volte no (quando per caso =
contengono un \t...).
Meglio abituarsi a scriverle come dagli esempi sopra.
In ogni caso il problema di samuela sembra diverso.
Sul mio sistema (Win2000), corretto il path che e` diverso, la riga =
funziona.
Piuttosto, gli argomenti della mia versione di ping.exe non corrispondo =
a quelli riportati sopra. In ogni caso non ottengo il messaggio di =
errore.
ciao
Guido
------=_NextPart_000_000E_01C30690.17FB2C60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>><FONT face=3DCourier>from os import spawnl, =
P_WAIT<BR></FONT>><FONT=20
face=3DCourier>def linea():<BR>>return not</FONT><BR>><FONT=20
face=3DCourier>spawnl(P_WAIT,'C:\WINDOWS\system32\ping.exe','ping','-c1',=
'-q','217.58.x<BR>>xx.yyy')<BR>></FONT><BR>><BR>><FONT=20
face=3DCourier>Ma mi restituisce sempre un errore (file not=20
found)<BR>></FONT><BR>><FONT=20
face=3DCourier>prova<BR>></FONT><BR>><FONT=20
face=3DCourier>spawnl(P_WAIT,'C:\\WINDOWS\\system32\\ping.exe','ping','-c=
1','-q','217.58.xxx.yyy')<BR>></FONT><BR>><FONT=20
face=3DCourier>o anche<BR>></FONT><BR>><FONT=20
face=3DCourier>spawnl(P_WAIT,'C:/WINDOWS/system32/ping.exe','ping','-c1',=
'-q','217.58.xxx.yyy')<BR></FONT><FONT=20
face=3DCourier></FONT></DIV>
<DIV><FONT face=3DCourier>> O anche:</FONT></DIV>
<DIV><FONT face=3DCourier>> spawnl(P_WAIT,=20
r'C:\WINDOWS\system32\ping.exe','ping','-c1','q','217.58.xxx.yyy')</FONT>=
</DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>Evidentemente il problema non era nella =
stringa del path=20
-- anche se non e` una buona idea scriverla con i backslash =
"lisci". A=20
proposito, Python, al contrario di qualche altro linguaggio, trasforma =
solo=20
alcune sequenze (per esempio \t) nei caratteri speciali, le altre =
sequenze con=20
backslash rimangono intatte, cioe` \W resta la sequenza dei due =
caratteri=20
\ e W. In altri linguaggi la sequenza viene ridotta alla sola =
lettera=20
W.</FONT></DIV>
<DIV><FONT face=3DCourier>Questo comportamento spiega perche` certe =
volte i path=20
"alla Windows", con i backslashes, funzionano, e certe volte no (quando =
per caso=20
contengono un \t...).</FONT></DIV>
<DIV><FONT face=3DCourier>Meglio abituarsi a scriverle come dagli esempi =
sopra.</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>In ogni caso il problema di samuela sembra=20
diverso.</FONT></DIV>
<DIV><FONT face=3DCourier>Sul mio sistema (Win2000), corretto il path =
che e`=20
diverso, la riga funziona.</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>Piuttosto, gli argomenti della mia versione di =
ping.exe=20
non corrispondo a quelli riportati sopra. In ogni caso non ottengo il =
messaggio=20
di errore.</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>ciao</FONT></DIV>
<DIV><FONT face=3DCourier>Guido</FONT></DIV></BODY></HTML>
------=_NextPart_000_000E_01C30690.17FB2C60--