Browse Source

prak2

master
Amad Colovic 5 years ago
parent
commit
e738928bb8
5 changed files with 86 additions and 0 deletions
  1. 7
    0
      .idea/misc.xml
  2. 8
    0
      .idea/modules.xml
  3. 11
    0
      .idea/webeng1.iml
  4. 49
    0
      praktikum2/HTTP und HTML.py
  5. 11
    0
      praktikum2/Quadratzahlen.py

+ 7
- 0
.idea/misc.xml 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" project-jdk-type="Python SDK" />
</project>

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

+ 11
- 0
.idea/webeng1.iml View File

@@ -0,0 +1,11 @@
<?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>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

+ 49
- 0
praktikum2/HTTP und HTML.py View File

@@ -0,0 +1,49 @@
import http.server

class EigeneHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text-html")
self.end_headers()

if self.path == '/Ying':
msg = """
<html>
<head>
<titel> Ying </titel>
</head>
<body>
<a href="/Yang"> Bei Klick gehe ich zu Yang </a>
</body>
</html>
"""
else:
msg = """
<html>
<head>
<titel> Yang </titel>
</head>
<body>
<a href="/Ying"> Ying </a>
</body>
</html>
"""
self.wfile.write(msg.encode('utf-8'))












port = 12345
handler = EigeneHandler
address = ('', port)

server = http.server.HTTPServer(address, handler)
server.serve_forever()

+ 11
- 0
praktikum2/Quadratzahlen.py View File

@@ -0,0 +1,11 @@
import http.server

class EigeneHandler(http.server.BaseHTTPRequestHandler):

def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text-html")
self.end_headers()


msg = """

Loading…
Cancel
Save