Skip to content

ernstki/whirlwind-tour-of-python

Repository files navigation

A Whirlwind Tour of Python

The main repository for this project is:

https://github.com/ernstki/whirlwind-tour-of-python

Slides

Slides from the "Python: a quick introduction" presentation (created using reveal.js) may be found in the slides subdirectory of this repository, and may also be viewed online here.

A "Python 101"-level tour of the language syntax is available in tour_of_python_syntax.py.

Sequencing Core downloader

A small-but-complete Python application is included which downloads sequencing results from the CCHMC Sequencing Core web site.

You might like to view the source here on GitHub.

It has a --help option; if you provide the --with-curl command line option, the results include an authentication cookie which allows you to pipe the results directly into bash or parallel.

Sample invocation of seq_core_downloader.py

What you'll need to run the example script

  • some small bit of command line experience (e.g., where to find the Terminal / Command Prompt application for your OS)
  • an installation of Git on your computer
    • probably already available on macOS / OS X
    • sudo apt-get install git on Debian/Ubuntu or sudo yum install git on CentOS/Fedora/RHEL
    • optionally, maybe also a GUI like GitHub's or Syntevo SmartGit
  • a code editor like Atom or Sublime Text; Windows' Notepad or OS X's TextEdit.app are not suitable for this activity

Decide on a nice home for your copy of the project. (Git calls this a "clone"). I like putting projects in a folder called "devel" in my home directory ($HOME/devel on Unix or OS X, C:\Users\YourName\devel on Windows).

Then:

# on Windows, this might look like 'cd /d "C:\Users\YOURUSERNAME\dev\stuff"
cd /to/the/place/where/you/do/dev/stuff

git clone https://github.com/ernstki/whirlwind-tour-of-python

# install dependencies; use a virtualenv if that's your choice
cd whirlwind*
python3 -m venv venv
# on Windows, I think it's just '.\venv\Scripts\activate'
source venv/bin/activate

# skip the above two 'venv'-related commands and add '--user' if you're OK
# with installing to your "personal" Python 'site-packages' directory
pip install -r requirements.txt

# test to see if the 'seq_core_downloader.py' script works
# on Windows, leave off the './'
./seq_core_downloader.py --help

Reporting bugs

Please report bugs on the Weirauch Lab internal issue tracker here.

The output of seq_core_downloader.py --help also has a shortlink that takes you to the same place.

Getting help

Please see the "Getting started" slide (#5) from the included presentation.

You may also find these slides useful:

Author

Kevin Ernst (kevin.ernst -at- cchmc.org)

License

Reveal.js is provided under the MIT license, as are the example Python scripts.