mirror of
https://github.com/balkian/gists.git
synced 2024-11-21 17:22:29 +00:00
Add 'repos/6b6906b97267a0c5ac52/' from commit 'f223e351402a52e6480d962ed72b31afa453b683'
git-subtree-dir: repos/6b6906b97267a0c5ac52 git-subtree-mainline:73c547ec0c
git-subtree-split:f223e35140
This commit is contained in:
commit
0c1d679eb2
9
repos/6b6906b97267a0c5ac52/coding.py
Normal file
9
repos/6b6906b97267a0c5ac52/coding.py
Normal file
@ -0,0 +1,9 @@
|
||||
a = u"codificación"
|
||||
print a # u"codificación"
|
||||
print type(a) # <type 'unicode'>
|
||||
b = a.encode("utf-8")
|
||||
print b # codificación # But it depends on your terminal settings
|
||||
print type(b) # <type 'str'>
|
||||
c = b.decode("utf-8")
|
||||
print type(c) # <type 'unicode'>
|
||||
print c # u"codificación"
|
15
repos/6b6906b97267a0c5ac52/server.py
Normal file
15
repos/6b6906b97267a0c5ac52/server.py
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
from flask import Flask, request, Markup
|
||||
|
||||
app = Flask("prueba")
|
||||
|
||||
@app.route("/")
|
||||
def home():
|
||||
args = ("<pre>")
|
||||
for i in request.args:
|
||||
a = request.args[i]
|
||||
args += u"{} [{}]: {}\n".format(i, Markup.escape(str(type(a))), a)
|
||||
args += "</pre>"
|
||||
return args
|
||||
|
||||
app.run(debug=True)
|
Loading…
Reference in New Issue
Block a user