This commit is contained in:
khaloufam70043 2019-10-22 15:21:41 +02:00
parent 5b3c211428
commit aa1c1d7331
6 changed files with 69 additions and 16 deletions

13
.idea/Python.iml generated Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7 (Python)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

7
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Python)" project-jdk-type="Python SDK" />
</project>

8
.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/Python.iml" filepath="$PROJECT_DIR$/.idea/Python.iml" />
</modules>
</component>
</project>

6
.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>

View File

@ -7,6 +7,12 @@ class EigenerHandler(http.server.BaseHTTPRequestHandler):
self.send_response(200)
self.send_header('Content-type', 'text-html')
self.end_headers()
von = 3
bis = 10
msg = """
<html>
<head>
@ -16,25 +22,22 @@ class EigenerHandler(http.server.BaseHTTPRequestHandler):
}
</style>
</head>
<body>
<h2>Quadratzahlen</h2>
<body>
<h2>Quadratzahlen</h2>
<form action="http://localhost:12345/" method="get">
<div>
<label for="von">Von</label>
<input name="von" id="von" value="1">
</div>
<div>
<label for="bis">Bis</label>
<input name="bis" id="bis" value="5">
</div>
<div>
<button onclick="myFunction()">Eingeben</button>
</div>
</form>
</body>
<table style="width:100%">
"""
while von <= bis:
msg = msg + "<tr><td>{}</td><td>{}</td></tr>".format(von, von*von)
von = von + 1
msg = msg + """
</table>
</body>
</html>
"""
self.wfile.write(msg.encode())
port = 12345

16
Socket/ohm.server.py Normal file
View File

@ -0,0 +1,16 @@
import socket
s = socket.socket() # instantiate
hostname = "my.ohm-hochschule.de"
path = "content/index.jspx"
host = socket.gethostbyname(hostname) # as both code is running on same pc
port = 80
CRLF = "\r\n"
s.connect((host,port))
msg = ( "GET /{} HTTP /1.1{}".format(path, CRLF) + "Host: {}{}".format(hostname, CRLF) + CRLF)
print(msg)
s.send(msg.encode())
bytes = s.recv(4096)
print(bytes.decode())
s.close()