Hello,first of all I want to say that I am very new to python and don't know much.Also English is not my native/mother tongue,but I will try my best to type as clearly as I can.
I need help with the following code and how to make my IF statement execute that command if the message recieved is "python"
I need help with the following code and how to make my IF statement execute that command if the message recieved is "python"
import socket import sys import time s = socket.socket() host = input(str("Enter Server Hostname : ")) port = 27312 s.connect((host,port)) print(" Connected to chat server") while 1: incoming_message = s.recv(1024) incoming_message = incoming_message.decode() print(" Server : ", incoming_message) if incoming_message = "python": python -m webbrowser -t "http://www.python.org" return print("") message = input(str(">> ")) message = message.encode() s.send(message) print("message has been sent...") print("")