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 module | |
e = 10 | |
def main(): | |
while Trye | |
h = module.do_shitty_things(e) | |
print h |
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 twisted | |
import pygame | |
import amp | |
# the game | |
# sell items | |
# here comes the amp protocol | |
# buy items |
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
Traceback (most recent call last): | |
Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused. | |
Done with math: [(True, 94), (False, <twisted.python.failure.Failure <class 'twisted.internet.error.ConnectionRefusedError'>>)] |
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
class FingerFactory(protocol.ServerFactory): | |
def __init__(self, **kwargs): | |
self.users = kwargs | |
users = {'moshez':'happy and well', 'Rob':'Programming','Danny':'being happy'} | |
factory = FingerFactory(users) |
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 twisted.internet import reactor, defer | |
from twisted.internet.protocol import ClientCreator | |
from twisted.protocols import amp | |
from ampserver import Sum, Divide | |
def doMath(): | |
try: | |
a = raw_input('What number for a ? \n >') | |
b = raw_input('What number for b? \n >') |
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
" An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last change: 2008 Dec 17 | |
" | |
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc |
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
Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger | |
return callWithContext({"system": lp}, func, *args, **kw) | |
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext | |
return context.call({ILogContext: newCtx}, func, *args, **kw) | |
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext | |
return self.currentContext().callWithContext(ctx, func, *args, **kw) | |
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext | |
return func(*args,**kw) | |
--- <exception caught here> --- |
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 twisted.application import internet, service | |
from twisted.internet.protocol import ServerFactory, Protocol | |
from twisted.python import log | |
# Normally we would import these classes from another module. | |
class PoetryProtocol(Protocol): | |
def connectionMade(self): | |
poem = self.factory.service.poem |
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 twisted.internet import reactor | |
from twisted.internet.protocol import Protocol, ClientFactory | |
from twisted.protocols import amp | |
class ChangeCurrency(amp.Command): | |
arguments = [('newPrice', amp.Integer())] | |
class MarketProtocol(amp.AMP): | |
def __init__(self, price): | |
self.price = price |
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
class NewProtocol(Protocol): | |
def __init__(self, x): | |
self.x = x | |
class NewFactory(Factory): | |
protocol = Newprotocol # i would think ( x ) but then it becomes an instance |
OlderNewer