by alexander white ©
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 click import command, option, Option, UsageError | |
class MutuallyExclusiveOption(Option): | |
def __init__(self, *args, **kwargs): | |
self.mutually_exclusive = set(kwargs.pop('mutually_exclusive', [])) | |
help = kwargs.get('help', '') | |
if self.mutually_exclusive: | |
ex_str = ', '.join(self.mutually_exclusive) | |
kwargs['help'] = help + ( |
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 time | |
>>> def test(): | |
... """Comapring concat. + vs list.extend vs +=""" | |
... x = range(10000000) | |
... y = range(10000000) | |
... x0 = time.clock() | |
... z = x + y | |
... t1 = time.clock() - x0 | |
... x1 = time.clock() | |
... x.extend(y) |
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
Game setup - woרks with Fedora: | |
1. Download game: | |
wget -O ardentryst1.71.tar.gz http://goo.gl/fJnyAs | |
2. Install Pygame: | |
Fedora: sudo yum install pygame | |
3. Untar game: | |
tar -xzvf ardentryst1.17.tar.gz | |
4. cd ardentryst1.17 |