This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jinja2 import Environment | |
from jinja2.loaders import FileSystemLoader | |
if __name__ == '__main__': | |
context = {'seq': [2, 3, 4], 'name': 'Armin'} | |
env = Environment(loader=FileSystemLoader('templates')) | |
tmpl = env.get_template('test3.html') | |
answer = tmpl.render(context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from _pydev_bundle._pydev_filesystem_encoding import getfilesystemencoding | |
def norm_case(filename): | |
filename = os_normcase(filename) | |
enc = getfilesystemencoding() | |
if IS_PY3K or enc == 'UTF-8': | |
return filename | |
res = filename.decode(enc).lower().encode(enc) | |
print(filename, res, enc) | |
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def norm_case(filename): | |
filename = os_normcase(filename) | |
if IS_PY3K: | |
return filename | |
enc = sys.getfilesystemencoding() | |
return filename.decode(enc).lower().encode(enc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import threading | |
def child(): | |
print "Child id: %d" % os.getpid() | |
while True: | |
print("Child alive") | |
time.sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import threading | |
def child(): | |
print "Child id: %d" % os.getpid() | |
while True: | |
print("Child alive") |
NewerOlder