Skip to content

Instantly share code, notes, and snippets.

@enlavin
Created March 3, 2010 17:24
Show Gist options
  • Save enlavin/320782 to your computer and use it in GitHub Desktop.
Save enlavin/320782 to your computer and use it in GitHub Desktop.
@echo off
rem Windows version of http://gist.github.com/320272
if "%1" == "" goto noargs
set MODULE_LOCATION=
for /f %%f in ('python -c "import %1; print %1.__file__.rstrip('c')"') do set MODULE_LOCATION=%%f > NUL 2>&1
if "%MODULE_LOCATION%" == "" goto nomodule
gvim "%MODULE_LOCATION%"
goto bye
:noargs
echo Usage: vipy pythonmodule
goto bye
:nomodule
echo Module %1 not found
:bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment