I want to follow the regex tutorial on http://regex.learncodethehardway.org/book/learn-regex-the-hard-waych1.html, but I am unsure how to execute regetron in cmd. I have followed the instructions to install it and the python interpreter does not give me an error when I type import regetron, so I know for certain it is installed.
Scripts usually get installed into the Scripts folder of your Python installation under Windows. Assuming you have Python 2.7 installed in the typical location, you should find a regetron executable in C:\Python27\Scripts
.
FWIW, I typically put both C:\Python27
and C:\Python27\Scripts
on my path under Windows for the above reason. Then commands introduced by packages are immediately available on the command line.
UPDATE: Regetron doesn't currently work for Windows. I've proposed a couple of patches to make it work. In the meantime, you can grab a new .zip from here and use pip to install it:
pip install .\regetron-1.4-windows.zip
UPDATE: My fixes have been incorporated into regetron. It should now work fine under Windows in a future version of regetron.
I used Cygwin to run regetron, and I did the following:
wget http://python-distribute.org/distribute_setup.py
python distribute_setup.py
easy_install pip
pip install regetron
regetron
Another word of caution: cmd.exe handles single-quoted ('
)and double-quoted strings ("
) differently than *nix shells. I've been burned when I've run Python scripts that take regex arguments (e.g. pywikipediabot
) in cmd.exe. You can follow examples exactly, and the Wrong Thing will happen.
Cygwin doesn't have problems with '
and "
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With