Useful tip from the late creator of matplotlib, John Hunter.
http://matplotlib.1069221.n5.nabble.com/dynamically-add-subplots-to-figure-td23571.html
import matplotlib.pyplot as plt
# start with one
fig = plt.figure()
ax = fig.add_subplot(111)| #!/bin/sh | |
| # iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file | |
| # For usage with iTerm2: | |
| # In iTerm's Preferences > Profiles > Default > Advanced > Semantic History, | |
| # choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2". | |
| # Usage: iterm_open_with $(pwd) filename [linenumber] | |
| # $(pwd) = current working directory (either use `pwd` or $PWD) | |
| # filename = filename to open | |
| # lineno = line number | |
| pwd=$1 |
Useful tip from the late creator of matplotlib, John Hunter.
http://matplotlib.1069221.n5.nabble.com/dynamically-add-subplots-to-figure-td23571.html
import matplotlib.pyplot as plt
# start with one
fig = plt.figure()
ax = fig.add_subplot(111)| from gmusicapi import Webclient | |
| from gmusicapi import Mobileclient | |
| import vlc | |
| import urllib | |
| # Use Google account credintials. If two factor is enabled, use application specific password. | |
| email = '[email protected]' | |
| password = 'password' | |
| # Device ID for API queries. Leave blank if unknown. |
This snippet of code was posted in 2014 and slightly revised in 2016 and 2017. It was more of a quick'n'dirty script than a polished tool. It is made only for Linux and in Python 2, which has since become outdated.
I currently do not use it, and I suggest you avoid it as well. Please do not expect support for using this script.
🔥 If you need an alternative, @glaucocustodio has kindly suggested EasyVPN in this comment.
The rest of the README is left for historical purposed.
| # -*- coding: utf-8 -*- | |
| '''recorder.py | |
| Provides WAV recording functionality via two approaches: | |
| Blocking mode (record for a set duration): | |
| >>> rec = Recorder(channels=2) | |
| >>> with rec.open('blocking.wav', 'wb') as recfile: | |
| ... recfile.record(duration=5.0) | |
| Non-blocking mode (start and stop recording): |
| # | |
| # sound_delay.py | |
| # | |
| """ | |
| Record sound and play it back after a delay. | |
| """ | |
| import multiprocessing as mp | |
| import time |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <form method="post"> | |
| {{ form.hidden_tag() }} | |
| {{ form.example }} |
| import os | |
| import wave | |
| import threading | |
| import sys | |
| # PyAudio Library | |
| import pyaudio | |
| class WavePlayerLoop(threading.Thread) : | |
| """ |