I hereby claim:
- I am verbalhanglider on github.
- I am verbalhanglider (https://keybase.io/verbalhanglider) on keybase.
- I have a public key ASByzzfduMJMFY7VjNTMTDDjscvDkZxUqKnn6ScU_eaRhwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from tempfile import TemporaryDirectory | |
from os import _exit, mkdir | |
from io import BytesIO | |
def make_temp_tree(): | |
td = TemporaryDirectory() | |
mkdir(join(td.name, 'ALTO')) | |
mkdir(join(td.name, 'JPEG')) | |
mkdir(join(td.name, 'TIFF')) | |
new_img1 = Image.new(mode='RGB', size=(128,128), color='blue') |
class NewObject: | |
"""a class to demonsrate making a custom iterable | |
""" | |
def __init__(self, some_list): | |
"""instantiates an instance of the class | |
Takes parameter passed and sets the value of the property 'a' | |
:param list some_list: can be a list of anything | |
"""a real basic and super-contrived example of using callback functions | |
""" | |
from sys import argv, stdout | |
from os import _exit | |
def conditional_callback_1(a_string): | |
"""first conditional: change words that start with C to Dog | |
:param str a_string: the word that is being checked and possibley |
class SimpleClass: | |
"""a new class to hold one property that has a value that is an int | |
""" | |
def __init__(self, some_param): | |
"""initializes a new instance of the class | |
:param int some_param: an integer to store on the new instance | |
""" | |
self.a = some_param |
"""a tutorial example of A CLI module using an argparse.Action class instance to find all files in a directory tree | |
""" | |
from argparse import Action, ArgumentParser | |
from sys import argv, stderr, stdout | |
from os import _exit, scandir | |
from os.path import exists, isdir | |
__VERSION__ = "1.0.0" |
"""a tutorial example of A CLI module using argparse to find all files in a directory tree | |
""" | |
from argparse import ArgumentParser | |
from sys import argv, stderr, stdout | |
from os import _exit, scandir | |
from os.path import exists | |
__VERSION__ = "1.0.0" |
"""a tutorial example of a recursive function using scandir | |
""" | |
from sys import argv, stderr, stdout | |
from os import scandir | |
from os.path import exists | |
def find_all_the_files(path): | |
"""a recursive function to take a path on a disk and find all the files in a complicated directory tree | |