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
def dirt(module, substring=''): print('\n'.join((d for d in dir(module) if substring in d))) | |
Usage: | |
$ python | |
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> def dirt(module, substring=''): print('\n'.join((d for d in dir(module) if substring in d))) | |
... | |
>>> import os.path |
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
# hitta element baserat på id | |
elem = driver.find_element_by_id('some-id') | |
# hitta element baserat på class | |
elem = driver.find_element_by_xpath("//*[contains(@class, 'some-class')]") | |
# hitta element baserat på del-av-id | |
elem = driver.find_element_by_xpath("//*[contains(@id,'some-id-substring')]") | |
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
# COMMAND PROMPT ENVIRONMENT | |
python -c "import urllib.request;open('distribute_setup.py', 'wb').write(urllib.request.urlopen('http://python-distribute.org/distribute_setup.py').read())" | |
python distribute_setup.py | |
python -c "import urllib.request;open('get-pip.py', 'wb').write(urllib.request.urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py').read())" | |
python get-pip.py | |
# GIT-MSYS ENVIRONMENT | |
curl -O http://python-distribute.org/distribute_setup.py | |
python distribute_setup.py |
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
data Story = Snippet String Story Story | |
| End |
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 random | |
class Sensor(object): | |
OFFSET = 16 | |
def pop_next_pressure_psi_value(self): | |
pressure_telemetry_value = self.sample_pressure() | |
return Sensor.OFFSET + pressure_telemetry_value | |
def __iter__(self): |
NewerOlder