Created
February 18, 2019 00:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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