MapIt program to launch Google Maps

September 30th, 2011

I was tired of copying an address, then opening a new tab and then going to http://maps.google.com and then pasting the address, and hitting return.

So I’ve written a program that will automatically open a new browser window pointed to Google Maps at whatever text is in the clipboard. Now I just copy the address, hit Win+R to bring up the Windows “Run” dialog, and then type “mapit”. Instant map.

You can also type “mapit <type address here>” to run it from the command line.

Download the Windows Executable (6.2 MB, big since it’s a compiled Python script)

 

Download the Python script (2 KB)

The Python script should work with Python 2 and 3, and on Windows, Mac, Linux (but I haven’t tested it on Mac & Linux yet).

Here’s the code on github: https://github.com/asweigart/mapitpy

JavaScript Cipher Wheel

September 21st, 2011

I’ve created a web version of the Caesar Cipher wheel using JQuery and CSS sprites.

JavaScript Cipher Wheel

I also have a Pygame version and Windows executable of this.

“MooseGesture” – Python Mouse Gestures Module

May 9th, 2011

“MooseGesture” is a Python module that implements a basic mouse gesture recognition system. It can identify gestures made up of strokes in the eight cardinal and diagonal directions.

A mouse gesture is holding down the mouse button and moving the mouse cursor in a specific pattern to issue a command.
Mouse gestures are a way of dragging with the mouse in order to draw out a certain pattern. The most mainstream uses of mouse gestures in computer software are for web browsers. (Chrome, Firefox, Opera, Internet Explorer)

You can download the module (and a simple Pygame test script that uses it) here:

MooseGestures & Test App (zipped)

moosegesture.py

moosegesturetest.py

(The screenshot above shows the test app after entering a mouse gesture. It correctly identifies the gesture as Down Right Up.)

(The above screenshot shows a more complicated gesture: Down, Up, Down, Right, Left, Right.)
(more…)

Learn You A Origami!

November 11th, 2010

I’ve set up a new site called Learn You A Origami!, which features video tutorials from YouTube of how to fold several different models. I’ll be adding new models periodically.

Pentagonal Gift Box origami picture

The site uses my StepReplay software, which is a JavaScript library that puts “steps” in any YouTube video using the YouTube API. The problem with most origami video tutorials is that they go too fast for people just learning a new model, and you have to pause and rewind the video frequently. StepReplay will automatically pause the video when it reaches the next step, and with one click you can also replay the previous video. It also has an option to loop through a single step over and over.

This can be used for any instructional video on YouTube. StepReplay is released under a BSD license.

Learn You A Origami! main site.

StepReplay can be downloaded here.

Pyperclip – A cross-platform clipboard module for Python

October 9th, 2010

I got tired of not having a good cross-platform module for accessing the clipboard in Python, so I put this together. It is a module that loads a getcb() and setcb() function depending on what your operating system (or window manager) is.

It has the following requirements:

  • Windows - No requirements. You don’t need the win32 module installed.
  • Mac - Requires the pbcopy and pbpaste, which come with OS X.
  • Linux - Requires the xclip command, which possibly comes with the os. If not, run sudo apt-get install xclip. Or have the gtk or PyQt4 modules installed.
  • Pyperclip runs on both Python 2 and Python 3.

Usage is simple:

import pyperclip
pyperclip.setcb('The text to be copied to the clipboard.')
spam = pyperclip.getcb()

UPDATE: (9/13/2011) I’ve fixed a small TypeError that some people were coming across that Gustav pointed out below.

UPDATE: Kenneth Reitz pointed out that he’s coded a similar module called Xerox. I missed it in my prior art search. http://github.com/kennethreitz/xerox It seems to have a fairly similar implementation as Pyperclip, except requires the win32 Python module to work on Windows.

I’m busy trying to figure out X11 programming so I can get rid of the xclip dependency.

Next Page »

Powered by WordPress