Skip to content
Permalink
Browse files

파일로부터 데이터 읽기

  • Loading branch information
egoing committed Mar 14, 2018
1 parent 01d5599 commit 4f3b0fcbc9756a3a0883990d75c02d424df1088d
Showing with 9 additions and 3 deletions.
  1. +1 −0 data/CSS
  2. +1 −0 data/HTML
  3. +1 −0 data/JavaScript
  4. +1 −0 data/Python
  5. +5 −3 index.py
@@ -0,0 +1 @@
CSS is Lorem ipsum dolor sit amet, consectetur adipisicing elit. Similique delectus ipsam, vel? Obcaecati natus quod dolores aliquam reprehenderit omnis, quae dolore totam nisi, ab sapiente nulla corporis delectus maiores vel.
@@ -0,0 +1 @@
HTML is Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit perferendis corporis dolorum modi cum incidunt quo aliquid nesciunt excepturi explicabo, sunt, et non in sed. Molestias id culpa non ipsum.
@@ -0,0 +1 @@
JavaScript is Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -0,0 +1 @@
Python is Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -5,8 +5,10 @@
form = cgi.FieldStorage()
if 'id' in form:
pageId = form["id"].value
description = open('data/'+pageId, 'r').read()
else:
pageId = 'Welcome'
description = 'Hello, web'
print('''<!doctype html>
<html>
<head>
@@ -19,10 +21,10 @@
<li><a href="index.py?id=HTML">HTML</a></li>
<li><a href="index.py?id=CSS">CSS</a></li>
<li><a href="index.py?id=JavaScript">JavaScript</a></li>
<li><a href="index.py?id=Python">Python</a></li>
</ol>
<h2>{title}</h2>
<p>The World Wide Web (abbreviated WWW or the Web) is an information space where documents and other web resources are identified by Uniform Resource Locators (URLs), interlinked by hypertext links, and can be accessed via the Internet.[1] English scientist Tim Berners-Lee invented the World Wide Web in 1989. He wrote the first web browser computer program in 1990 while employed at CERN in Switzerland.[2][3] The Web browser was released outside of CERN in 1991, first to other research institutions starting in January 1991 and to the general public on the Internet in August 1991.
</p>
<p>{desc}</p>
</body>
</html>
'''.format(title=pageId))
'''.format(title=pageId, desc=description))

0 comments on commit 4f3b0fc

Please sign in to comment.
You can’t perform that action at this time.