Собрали в одном месте самые важные ссылки
читайте нас в Telegram
Модуль реализован на основе модуля signal
from timeoutcontext import timeout, TimeoutException from time import sleep try: with timeout(1): sleep(2) except TimeoutException: print('timeout')
Демо по ссылке http://demo.simiki.org/
from easy_class import EasyClass, StringVariable, IntegerVariable class MyClass(EasyClass): attr1 = IntegerVariable() attr2 = StringVariable()
{% load django_vimeo_tags %} The video tag: {% vimeo instance.video width=600 as video %} <video width="600" loop="loop" autoplay="autoplay" poster="{{ video.optimal_picture.link }}"> <source src="{{ video.optimal_file.link_secure }}" type='{{ video.optimal_file.type }}'> {% trans 'tag "video" not supported by your browser' %} <a href="{{ video.optimal_download.link }}">{% trans 'download video' %}</a>. </video> {% endvimeo %} Or embed shortcut: {% vimeo instance.video width=600 %}
from pickleshare import * db = PickleShareDB('~/testpickleshare') db.clear() print "Should be empty:",db.items() db['hello'] = 15 db['aku ankka'] = [1,2,313] db['paths/are/ok/key'] = [1,(5,46)] print db.keys()
Библиотека поддерживает несколько базовый типов данных. Ниша библиотеки - хранение сложных структур данных
import serial import streamexpect # timeout=0 is essential, as streams are required to be non-blocking ser = serial.Serial('COM1', baudrate=115200, timeout=0) with streamexpect.wrap(ser) as stream: stream.write('\r\nuname -a\r\n') match = stream.expect_bytes('Linux', timeout=1.0) print(u'Found Linux at index {}'.format(match.start))