Skip to content

Instantly share code, notes, and snippets.

@IbroCalculus
Created February 18, 2019 00:17
Show Gist options
  • Save IbroCalculus/306edb8a2a1fa28886eecbd04e308415 to your computer and use it in GitHub Desktop.
Save IbroCalculus/306edb8a2a1fa28886eecbd04e308415 to your computer and use it in GitHub Desktop.
Client code part of the python remote access code to be installed on the machine to be controlled. i.e the client
import socket
import os
s = socket.socket()
host = input('Enter host/server ID: ')
port = 9009
s.connect((host,port))
print('This client has successfully connected to the server')
while True:
receivedCommand = s.recv(1024)
receivedCommand = receivedCommand.decode()
if receivedCommand == 'Get_Current_working_Directory':
execute = os.getcwd()
s.send(execute.encode())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment