Собрали в одном месте самые важные ссылки
читайте нас в Twitter
# Comments with '#'
# All code start with a dash (consistency).
# Define a variable like this:
-var name = 'PyPUGly'
# Define a function like this:
-def title(name):
h1.title '{name}''
html(lang="en")
head
# All strings must be quoted. Only single-quotes are accepted (consistency).
title 'This is {name}'
body
# Call a function like this:
+title('PyPUGly')
#container
p 'Strings must be quoted.'
Работает бот с помощью RNN + генетического алгоритма
class MyApp(sdl2ui.App): width = 256 height = 224 zoom = 3 # NOTE: the fps you desire: less fps = less CPU usage fps = 30 name = "My Application" # NOTE: order the handlers in what you want to display first default_handlers = [MainHandler, ListSelectorHandler, MenuHandler] default_resources = [('background', 'background.png')] logging.basicConfig(level=logging.DEBUG) app = Meldnafen(handlers=[sdl2ui.handler.DebuggerHandler]) app.loop() del app
from purl import Purl url = Purl('https://github.com/search?q=cat) str(url.add_query('q', 'dog')) # => 'https://github.com/search?q=dog'
url = Purl('https://github.com/search) str(url.add_query({ 'q': 'cat', 'l': 'JavaScript', 'type': 'Issues' })) url = Purl('https://github.com/search) str(url.add_query('q', 'cat') .add_query('l', 'JavaScript') .add_query('type', 'Issues')) # => 'https://github.com/search?l=JavaScript&q=cat&type=Issues'
from trender import TRender template = '@greet world!' compiled = TRender(template) output = compiled.render({'greet': 'Hello'}) print(output) # => Hello world!
from datetimerange import DateTimeRange time_range = DateTimeRange() print time_range.is_set() time_range.set_time_range("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900") print time_range.is_set()
from genty import genty, genty_repeat, genty_dataset from unittest import TestCase # Here's the class under test class MyClass(object): def add_one(self, x): return x + 1 # Here's the test code @genty class MyClassTests(TestCase): @genty_dataset( (0, 1), (100000, 100001), ) def test_add_one(self, value, expected_result): actual_result = MyClass().add_one(value) self.assertEqual(expected_result, actual_result)