A lot of this info is in the docs for Tables.
Open the file for reading, and get a reference to a table:
>>> with tables.open_file(path, mode='r') as f:
... table = f.root.some_columns.table
A lot of this info is in the docs for Tables.
Open the file for reading, and get a reference to a table:
>>> with tables.open_file(path, mode='r') as f:
... table = f.root.some_columns.table
| """ | |
| This example python code shows how to appropriately query the Preteckt | |
| accelerometer API for data over a date range. | |
| Run with: | |
| $ python get_accel_data.py | |
| """ | |
| A function to enumerate and print a list of items horizontally using the | |
| space available in your terminal (optionally, without wrapping text). | |
| Example: | |
| >>> friendly.test() | |
| 1. a cat 2. a dog 3. Three pairs of socks 4. A kick-ass bicycle | |
| 5. chickens 6. A quick brown fox 7. and a lazy dog | |
| 8. Lorem ipsum dolor sit amet, consectetur |
| """ | |
| This script illustrates how to use sys.argv to | |
| capture command-line arguments. | |
| Dowload & run this file like so: | |
| python example.py | |
| OR like this: |
| #!/usr/bin/env python | |
| """ | |
| Test if we can reliably figure out the uncompressed size of .gz file... | |
| """ | |
| import gzip | |
| import os | |
| import subprocess | |
| #!/usr/bin/env python | |
| """ | |
| process some data | |
| """ | |
| from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor | |
| from joblib import Parallel, delayed | |
| import os | |
| import statistics |
| """ | |
| See Streaming API: https://twython.readthedocs.io/en/latest/usage/streaming_api.html | |
| """ | |
| import os | |
| import sys | |
| from twython import TwythonStreamer | |
| class TweetPrinter(TwythonStreamer): | |
| def on_success(self, data): |
| /** | |
| * | |
| * Experiment: Trying to see how an output file could possibly be corrupted | |
| * by failed program.... | |
| * | |
| * | |
| * e.g. https://trello.com/c/7F9VWd2s/980-error-in-vincsv-from-the-logger | |
| * | |
| * Experiment: | |
| * |
| import json | |
| import requests # 3rd-party lib, "pip install reqeusts" to install. | |
| from pprint import pprint | |
| def get_stuff(payload="hello"): | |
| """ | |
| This function will talk to httpbin.org, via a GET request. It will send | |
| the provided payload, and print out the http status code and the arguments | |
| it receives from httpbin. |
| class Animal: | |
| # This is our base class that describes an Animal. | |
| sound = "..." # The default sound an animal makes. | |
| def __init__(self, sound=None): | |
| # This is a constructor method. It will | |
| # set up an animal's sound. | |
| if sound: | |
| self.sound = sound |