Added Murach python tutorials

This commit is contained in:
Ganome 2021-05-17 10:58:35 -06:00
parent b80404e1c4
commit 7530150136
12 changed files with 43 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import socket
targetHost = "127.0.0.1"
targetPort = 80
targetPort = 9999
print(targetHost)
#create a socket object
@ -13,11 +13,14 @@ client.connect((targetHost, targetPort))
#send some data
message = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n"
#we have to encode our string using UTF-8
#client.send(message.encode("utf-8"))
client.send(message.encode("utf-8"))
#client.send(b"GET / HTTP/1.1\r\nHost: google.com\r\n\r\n") ##THIS LINE ENCODE THE STRING AT UTF-8 using the 'b'
#receive some data
response = client.recv(4096) #This is the amount of bytes you want to read!!
client.close()
#print the response
print(response)

View File

@ -2,7 +2,7 @@
import socket
targetHost = "127.0.0.1"
targetPort = 22
targetPort = 9999
print(targetHost)
#create a socket object

View File

@ -91,7 +91,7 @@ def main():
elif o in ("-t","--target"):
target = a
elif o in ("-p","--port"):
port = (int)a
port = (int)
else:
assert False,"Unhandled Option"
if not listen and len(target) and port > 0:

3
python/murach-python/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
python/murach-python/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>

8
python/murach-python/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/murach-python.iml" filepath="$PROJECT_DIR$/.idea/murach-python.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
python/murach-python/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>