A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| #!/bin/bash | |
| #SBATCH | |
| if [[ "$SLURM_PROCID" = "0" ]]; then | |
| ssh -R 0.0.0.0:9999:localhost:8888 -f -N login-0-1 | |
| jupyter notebook | |
| elif [[ "$SLURM_PROCID" = "1" ]]; then | |
| ipcontroller --ip='*' | |
| elif [[ "$SLURM_PROCID" = "2" ]]; then | |
| mpirun --bind-to=none -n "$((SLURM_NTASKS-2))" ipengine |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
| import Tweet | |
| import simplejson | |
| import urllib2 | |
| def read_tweets(user, num_tweets): | |
| tweets = [] | |
| url = "http://api.twitter.com/1/statuses/user_timeline.json?\ | |
| screen_name=%s&count=%s&include_rts=true" % (user, num_tweets) | |
| file = urllib2.urlopen(url) |