Ich versuche eine Verbindung zu einer Socket -Datei herzustellen und sie einige Befehle zu senden: < /p>
#!/usr/bin/env python
import socket
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect("/var/run/socket")
s.send('a command here')
data = s.recv(1024)
s.close()
print 'Received', repr(data)
< /code>
Habe ich etwas vermisst? < /p>
Ich bin total neu mit Python. < /p>
Vielen Dank im Voraus für jede Hilfe!>
Senden Sie Befehle mit Python an eine Steckdose ⇐ Python
-
- Similar Topics
- Replies
- Views
- Last post