Skip to content

Instantly share code, notes, and snippets.

View Elizaveta239's full-sized avatar

Elizaveta Shashkova Elizaveta239

View GitHub Profile
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)
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
def norm_case(filename):
filename = os_normcase(filename)
if IS_PY3K:
return filename
enc = sys.getfilesystemencoding()
return filename.decode(enc).lower().encode(enc)
import os
import time
import threading
def child():
print "Child id: %d" % os.getpid()
while True:
print("Child alive")
time.sleep(1)
import os
import time
import threading
def child():
print "Child id: %d" % os.getpid()
while True:
print("Child alive")