Ihr könnt mit dieser Software eigene Netwerk-Seiten erstellen oder andere besuchen.
Das Erstellen von diesen Netzwerk-Seiten funktioniert durch das tkinter Modul.
Ihr könnt ganz leicht eine Domain oder Ihre eigene Ip zum Hosten der Seite benutzen.
Mac: http://project-holmes.de.softonic.com/mac
Windows: //
Server:
Code: Alles auswählen
root = Tk()
root.title("PyServer")
root.config(bg="slate gray")
ipl = Label(text="IP/Domain", bg="slate gray").grid(row=0, column=0)
ipe= Entry(highlightbackground="slate grey")
ipe.grid(row=0, column=1)
ipb= Button(text="Select",highlightbackground="slate grey").grid(row=0, column=2)
sitel = Label(text="Site", bg="slate grey").grid(row=1, column=0)
sitee= Entry(highlightbackground="slate grey")
sitee.grid(row=1, column=1)
siteb = Button(text="Select",highlightbackground="slate grey").grid(row=1, column=2)
grun = PhotoImage(file="grun.gif")
rot = PhotoImage(file="rot.gif")
ringgr = Label(image=grun,state=DISABLED, bg="slate grey")
ringgr.grid(row=3, column=0)
ringr = Label(image=rot,state=DISABLED, bg="slate grey")
ringr.grid(row=3, column=1)
def pgrun():
ringgr.config(state="normal")
ringr.config(state="disabled")
Server()
def prot():
ringgr.config(state="disabled")
ringr.config(state="normal")
closeServer()
onb = Button(text="Start Server",highlightbackground="slate grey", command=pgrun).grid(row=4 , column=0)
offb =Button(text="Close Server",highlightbackground="slate grey", command=prot).grid(row=4, column=1)
def Server():
porty =ipe.get()
if porty == "":
ringgr.config(state="disabled")
return
host = porty
port= 5000
s= socket(AF_INET, SOCK_STREAM)
s.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
s.bind((host,port))
while True:
s.listen(10)
c, addr = s.accept()
sityr = sitee.get()
data = open(sityr, "br")
data.read()
c.send(data)
def closeServer():
try:
s.close()
except:
return
root.mainloop()
Code: Alles auswählen
pfad = os.path.dirname(os.path.abspath(__file__))
os.chdir( pfad )
root= Tk()
root.wm_iconbitmap("Project_icon_Holmes.ico")
root.title("Project Holmes")
root.grid_columnconfigure( 1,weight=1)
root.grid_rowconfigure(2,weight=1)
suchleiste = Entry()
suchleiste.grid(row=1, column=1, sticky="wens")
def client():
ae = suchleiste.get()
host = ae
port = 5000
s = socket(AF_INET, SOCK_STREAM)
s.connect((host,port))
sites = s.recv(1000).decode()
site = open("Cachy.py", "w")
site.write(sites)
site.close()
s.close()
try:
import Cachy
Cachy.Sun()
except:
return
butty = Button(text="Search", command=client)
butty.grid(row=1, column=2, sticky="we")
root.mainloop()
