Skip to content

Instantly share code, notes, and snippets.

@blink1073
blink1073 / pypi_binary_downloader.py
Last active December 11, 2015 18:49
PyPi Binary Downloader Pulls the latest binary package from pypi, and installs it intelligently Accounts for current python version and path (including virtualenv), and system architecture (32 vs 64 bit) If an alternate filename is provided, it will use that instead of the default created by distutils (<package>-<version>.win**-py*.*.exe)
'''
PyPi Binary Downloader
Pulls the latest binary package from pypi, and installs it intelligently
Accounts for current python version and path (including virtualenv), and
system architecture (32 vs 64 bit)
If an alternate filename is provided, it will use that instead of the default
created by distutils (<package>-<version>.win**-py*.*.exe)
@blink1073
blink1073 / anaconda_bash_script_maker.py
Last active February 19, 2016 14:18
Generate Bash scripts to run the Anaconda Batch Scripts on Windows
''' Python Shell-Script Maker for Windows MSYS
Creates a bash shell script for all the `.bat` files in the Scripts directory.
This allows for compatibility with MSYS bash.
For example, `spyder.bat` would yield a file called `spyder`:
#!/bin/bash
cmd //c "spyder" "$@"
See http://sourceforge.net/p/mingw/bugs/1902/ for an explanation.
@blink1073
blink1073 / Atom PyQtGraph Scatter3D Plot Example
Last active February 1, 2022 05:26
Demonstration of the pyqtgraph.opengl.GLScatterPlotItem in a pyqtgraph.opengl.GLViewWidget with Atom bindings. This is meant to be used as the basis of a point cloud GUI in Enaml.
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 20 14:27:48 2013
@author: silvester
Demonstration of Point Cloud tool using OpenGL bindings in PyQtGraph
Based on GLScatterPlotItem.py example from PyQtGraph
License: MIT
@blink1073
blink1073 / gl_mesh_item.enaml
Last active December 28, 2015 00:09
Demonstrate an OpenGL example in enaml. This is a port of the PyQtGraph GLMesh Example to Enaml.
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 04:16:39 2013
@author: silvester
@license: MIT
"""
from enaml.qt import QtCore, QtGui
from enaml.widgets.api import *
from pyqtgraph import opengl as gl
@blink1073
blink1073 / gl_demo.enaml
Created November 11, 2013 13:04
Demonstration of PyQt4.OpenGL.QGLWidget in enaml
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 04:16:39 2013
@author: Steven Silvester (steven.silvester@iee.org)
@license: Public Domain
Based on: http://www.siafoo.net/snippet/316
Created on Jul 7, 2009
@blink1073
blink1073 / javascript_in_enaml.enaml
Last active December 28, 2015 14:29
Javascript in Enaml
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 17 09:15:29 2013
@author: Steven Silvester <steven.silvester@ieee.org>
@license: MIT
Adapted from @pedrotechless answer:
http://stackoverflow.com/questions/6447011/pyqt-pyside-webkit-and-exposing-methods-from-to-javascript
"""
@blink1073
blink1073 / enaml_snapshot.py
Last active December 29, 2015 17:39
Take a snapshot of an enaml application.
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 29 07:29:42 2013
@author: Steven Silvester <steven.silvester@ieee.org>
@license: MIT
Take a snapshot of an enaml application.
Open an enaml application, save a snapshot, and optionally close it.
@blink1073
blink1073 / picker_demo.enaml
Created December 6, 2013 12:23
Enaml MPLCanvas Event Demo
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 06 06:07:21 2013
@author: Steven Silvester <steven.silvester@ieee.org>
@license: MIT
"""
import functools
import matplotlib.pyplot as plt
@blink1073
blink1073 / jedi_memory.py
Last active December 30, 2015 11:39
Test Jedi Memory Usage
# -*- coding: utf-8 -*-
"""
@author Steven Silvester <steven.silvester@ieee.org>
@license MIT
"""
import pkgutil
import os
from wmi import WMI # pip install wmi (windows only)
# see http://stackoverflow.com/questions/938733/total-memory-used-by-python-process
import jedi
@blink1073
blink1073 / jedi_mem_profiler.py
Created January 12, 2014 15:37
Profiling Jedi Memory using memory_profiler
# -*- coding: utf-8 -*-
"""
@author Steven Silvester <steven.silvester@ieee.org>
@license MIT
"""
import pkgutil
import os
from memory_profiler import memory_usage
import jedi