-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial1.py
More file actions
94 lines (92 loc) · 3.98 KB
/
tutorial1.py
File metadata and controls
94 lines (92 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#tutorial1.py
def tut():
print("Welcome to the tutorial, In this tutorial I will show you how broadcast and \nrecieve information from servers.")
cont = raw_input("")
print("First off we need to connect to a server.")
cont = raw_input("")
print("But we don't have a server module.")
cont = raw_input("")
print("So what we're going to do is go into the modules folder and copy the \nbroadServer.py module into our main folder from the modules/dev folder.")
cont = raw_input("")
print("Now we're ready.")
cont = raw_input("")
print("Open another instance of .shell and type the following.")
cont = raw_input("")
print("\trunProg(\"broadServer.py\")")
cont = raw_input("")
print("This will open a broadcast server")
cont = raw_input("")
print("There are several types of servers for you to connect to,\nfor a list look at the readme file.")
cont = raw_input("")
print("The broadcast server will ask you first for a Host.")
cont = raw_input("")
print("Type in 'localhost'")
cont = raw_input("")
print("Next it will ask for a port, for this tutorial lets use 50123")
cont = raw_input("")
print("Type '50123'")
cont = raw_input("")
print("It will then ask you what data you want to send.")
cont = raw_input("")
print("Since this is only a basic broadcast server, you can only send one line of data.")
cont = raw_input("")
print("For the tutorial just type 'Hello, World!'")
cont = raw_input("")
print("You can type anything you want though later on when broadcasting.")
cont = raw_input("")
print("Next it will ask you for the amount of time you want to send the data for.")
cont = raw_input("")
print("You should enter the time in seconds, it will send 1 packet of data / second")
cont = raw_input("")
print("For the tutorial, type '300'")
cont = raw_input("")
print("After pressing return, you should be seeing your data sending.")
cont = raw_input("")
print("You are now braodcasting data.")
cont = raw_input("")
print("The data is being sent by default on port 50123 within your localhost domain")
cont = raw_input("")
print("The next this to do is recieve the data.")
cont = raw_input("")
print("To do this you need to open your client.")
cont = raw_input("")
print("The easiest way to do it is to open another instance of the shell")
cont = raw_input("")
print("Then you need to type runProg(\"client.py\")")
cont = raw_input("")
print("Oh, that's odd, you got an error.")
cont = raw_input("")
print("Remember how we had to copy the broadServer.py module before?")
cont = raw_input("")
print("We have to do the same with all the modules that we want to use.")
cont = raw_input("")
print("So go ahead and copy the client.py module into your main folder.")
cont = raw_input("")
print("Now try again. Type runProg(\"client.py\")")
cont = raw_input("")
print("It will then ask you for a Host")
cont = raw_input("")
print("You need to enter which host is sending the data.")
cont = raw_input("")
print("We know we want to connect to localhost")
cont = raw_input("")
print("So we need to type 'localhost'")
cont = raw_input("")
print("It will now ask us which port we want.")
print("You need to enter the port that the host is sending the data over.")
cont = raw_input("")
print("We know the port our host is sending data over is 50123")
cont = raw_input("")
print("So we need to type '50123'")
cont = raw_input("")
print("Now it will ask us for a time.")
cont = raw_input("")
print("If you enter 5 it will wait for a packet to be sent through the same port and \nhost and then recieve 5 packets.")
cont = raw_input("")
print("Now we should see the message broadcasted by our server being recieved in the \nclient.")
cont = raw_input("")
print("Once the Broadcast Server has finished broadcasting, it will return to the \nshell.")
cont = raw_input("")
print("Once the client has finished recieving data, it will return to the shell.")
print("Look at the readme for more information.")
tut()