[Python] subprocess
Ciao a tutti credo che questo argomento sia gia' stato affrontato posso collegarmi a una shell in ssh mettendo user/pass ed eseguire un comando ? credo di si il modulo e' subprocess? se qualcuno a dritte... Grazie Mille ___ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python
Re: [Python] subprocess
Puoi usare subprocess per lanciare il comando 'ssh', ma penso che sia banale inserire la password visto che ssh per sicurezza non usa lo standard input per leggerla. Inoltre dovresti prepararti a parsare il'output di ssh per gestire gli errori. Non è una cosa banale né pulita. Ti consiglio di dare un'occhiata a paramiko: http://www.lag.net/paramiko/ Non l'ho usato direttamente ma è usato da bzr. È una implementazione pythonica di ssh, quindi fai tutto senza passare da shell e ti becchi eccezioni invece di errori testuali, che mi sembra un'ottima cosa :) On May 21, 2008, at 5:44 PM, salvatore monaco wrote: Ciao a tutti credo che questo argomento sia gia' stato affrontato posso collegarmi a una shell in ssh mettendo user/pass ed eseguire un comando ? credo di si il modulo e' subprocess? se qualcuno a dritte... Grazie Mille ___ 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
Re: [Python] subprocess
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 salvatore monaco ha scritto: | Ciao a tutti credo che questo argomento sia gia' stato affrontato | posso collegarmi a una shell in ssh mettendo user/pass | ed eseguire un comando ? | credo di si | il modulo e' subprocess? | | se qualcuno a dritte... | io uso pexpect, ottima la uso per interfacciarmi sia a ssh sia rsync... http://www.noah.org/wiki/Pexpect - -- La domanda che mi lascia piu' confuso e': 'Sono pazzo io o lo sono gli altri?' - --Albert Einstein-- Scopel Emanuele. Linux Registered User: #425729. jabber: [EMAIL PROTECTED] http://orso.homelinux.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFINF16J47VmkHcLCERAkA1AJ9r9qPMlKXaZ0pvaigqXen1PuMVJQCfaO0d +WVoEx0FpGpAv/F6oF4Cujc= =94Pf -END PGP SIGNATURE- ___ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python