Archive

Archive for the ‘windows’ Category

Anaconda3, Windows, command-line arguments

April 16, 2017 Leave a comment

Problem
I installed Anaconda3 on Windows 7, but when I wanted to pass a command-line argument to a script, the script didn’t receive the parameter(s). The command-line arguments were simply ignored.

Solution
I found the solution here. This is a blog post from 2010. This issue is still unresolved…

In short: open the registry editor (regedit), find the key HKEY_CLASSES_ROOT\py_auto_file\shell\open\command , and append the string “%*” (without quotes) to the end of the entry. It should look similar to this:

"C:\Anaconda3\python.exe" "%1" %*
Advertisements
Categories: python, windows Tags: , ,

PyScripter: a very nice small IDE for Windows

April 8, 2014 Leave a comment

I found a very nice small Python IDE for Windows called PyScripter.

PyScripter is a free and open-source Python Integrated Development Environment (IDE) created with the ambition to become competitive in functionality with commercial Windows-based IDEs available for other languages. Being built in a compiled language is rather snappier than some of the other Python IDEs and provides an extensive blend of features that make it a productive Python development environment.” (source)

The install file is less than 5 MB and PyScripter provides all the features you want from a modern IDE: syntax highlight, run code and see the output, code completion, built-in Python shell, debugger, etc.

Here is a youtube video for beginners that shows first how to install Python on Windows, then presents PyScripter.

Categories: python, windows Tags: , ,

Qt development under Windows with Python using PySide

January 9, 2013 Leave a comment

Install PySide here: http://qt-project.org/wiki/PySideDownloads. Follow the link “Microsoft Windows” and download the installer.

Categories: python, windows Tags: , ,

IPython for Windows

January 9, 2013 Leave a comment

Installation instructions: http://ipython.org/ipython-doc/stable/install/install.html#windows.

The important thing is to install IPython as administrator. This way Start menu shortcuts will be created and you can launch IPython easily. The IPython shortcut calls ‘C:\Python27\python.exe “C:\Python27\scripts\ipython-script.py”‘ in my case and I don’t want to type all that each time I want to launch IPython :)

Categories: python, windows Tags:

autopy

March 26, 2012 Leave a comment

autopy is a simple, cross-platform GUI automation toolkit for Python

Installation

sudo apt-get install libxtst-dev
sudo pip install autopy

Some mouse actions

import time
import autopy as ap
from autopy.mouse import LEFT_BUTTON

def leftClick():
    ap.mouse.click(LEFT_BUTTON)
    time.sleep(.1)
    print "# click"
    
def leftDown():
    ap.mouse.toggle(True, LEFT_BUTTON)
    time.sleep(.1)
    print '# left down'

def leftUp():
    ap.mouse.toggle(False, LEFT_BUTTON)
    time.sleep(.1)
    print '# left release'
    
#############################################################################
    
if __name__ == "__main__":
    time.sleep(1)
    leftClick()
    leftDown()
    time.sleep(3)
    leftUp()

Related work (20130903)

See also pyrobot: @github, @reddit. Note that pyrobot is for Windows only.

Categories: python, windows Tags: , ,