print() import cgi, os, view form = cgi.FieldStorage() if 'id' in form: pageid = form["id"].value description = open('data/' + pageid, 'r').read() else: pageid = 'Welcome' description = 'Hello' print(''' <!doctype html> <html> <head> <title>KGW HTML&PYTHON Practice</title> <meta charset="euc-kr"> </head> <body> <h1><a href="index.py">Entertainment</a></h1> <ol>{list}</ol> <a href="create.py">create</a> <form action="process_create.py" method="post" accept-charset="utf-8"> <p><input type="text" name="title" placeholder="title"></p> <p><textarea rows="4" name="description" placeholder="description"></textarea></p> <p><input type="submit"></p> </form> </body> </html> '''.format(list=view.getlist()))
import cgi, os, view form = cgi.FieldStorage() if 'id' in form: pageid = form["id"].value description = open('data/' + pageid, 'r').read() else: pageid = 'Welcome' description = 'Hello' print(''' <!doctype html> <html> <head> <title>KGW HTML&PYTHON Practice</title> <meta charset="euc-kr"> </head> <body> <h1><a href="index.py">Entertainment</a></h1> <ol>{list}</ol> <a href="update.py">update</a> <form action="process_update.py" method="post" accept-charset="utf-8"> <input type="hidden" name="pageid" value={title}> <p><input type="text" name="title" placeholder="title" value={title}></p> <p><textarea rows="4" name="description" placeholder="description">{desc}</textarea></p> <p><input type="submit"></p> </form> </body> </html> '''.format(list=view.getlist(), title=pageid, desc=description))
<meta charset="EUC-KR"> <title>izone</title> </head> <body> <h1> IZONE 멤버 별 정보 등록 PAGE </h1> <ol> <strong>{listStr}</strong> </ol> <br><br><br> <a href="create.py">create</a> <a href="index.py">home</a> {update_link} {delete_action} <h4>아이즈원 갤러리로 이동하려면 <a href="http://127.0.0.1/WEB1/1.HTML">여기</a>를 눌러주세요.</h4> <br><br> <h2>{title}</h2> <p>{desc}</p> </body> </html> '''.format(title=pageId, desc=description, listStr=view.getlist(), update_link=update_link, delete_action=delete_action))
print('''<!DOCTYPE html> <html> <head> <meta charset="EUC-KR"> <title>izone</title> </head> <body> <h1> <a href="index.py">IZONE</a> </h1> <ol> {listStr} </ol> <form action ="process_create.py" method="post"> <a href="create.py">create</a> <p><input type="text" name="title" placeholder="title"></p> <p><textarea rows="5" name="description" placeholder="description" ></textarea></p> <p><input type="submit"></p> </form> <h2>{title}</h2> <p>{desc}</p> </body> </html> '''.format(title=pageId, desc=description, listStr=view.getlist()))
</form> '''.format(pageid) else: pageid = 'Welcome' description = 'Hello' update_link = '' delete_action = '' print(''' <!doctype html> <html> <head> <title>KGW HTML&PYTHON Practice</title> <meta charset="euc-kr"> </head> <body> <h1><a href="index.py">Entertainment</a></h1> <ol>{list}</ol> <a href="create.py">create</a> {update} {delete} <h2>{title}</h2> <p>{desc}</p> </body> </html> '''.format(title=pageid, desc=description, list=view.getlist(), update=update_link, delete=delete_action))
import cgi, os, view 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> <title>WEB1 - Welcome</title> <meta charset="utf-8"> </head> <body> <h1><a href="index.py">WEB</a></h1> <ol> {listStr} </ol> <a href="create.py">create</a> <form action="process_update.py" method="post"> <input type="hidden" name="pageId" value="{form_default_title}"> <p><input type="text" name="title" placeholder="title" value="{form_default_title}"></p> <p><textarea rows="4" name="description" placeholder="description">{form_default_description}</textarea></p> <p><input type="submit"></p> </form> </body> </html> '''.format(title=pageId, desc=description, listStr=view.getlist(), form_default_title=pageId, form_default_description=description))