If you are programming in python or you are learning it right now and have not found ipython yet this post is for you.
So what is this Ipython all about? Which features make it superior to the standardInterpreter?
Just a quick overview:
------------Shortend for brevity !------------------
In : # This is a nice list isn't it :) so lets see what capitalize does
So if u don't have any Idea how to obtain Ipython use the Packagemanagment of your Linuxdistribution or use the python tool "pip" like that:(bash or windows cmd)
$ pip install ipython
I will cover the other two features on my list in a upcoming post about debugging. For now you can also have a look at the Ipython-Website.
Some years ago I had the some problems with an legacy programm that had no API at all. So the only thing I could do was emulating mouseclicks to do get the job automated. Therefore I had to know positions of buttons etc... It turnend out that it was quite hard to get x,y coordinates on linux. After some 2 hours of trial and error I found a solution:
from Xlib import X, display d = display.Display().screen().root.query_pointer()._data print "x=" print d["root_x"] print "y=" print d["root_y"]Just put it in a file and name it somecode.py then u can fire it up with python somecode.py .
I did not write a loop for continous updates because it is very annoying that the cmd will be floded with numbers.
This snippet can also be found on Snipplr. For those who don't want to copypaste I have attached a file containing the script.
The next few days i will move some old things to this new location. For example the codesnippet that lets u figure out mouseposition on Linux etc.. I will also update my links from snipplr so that everyone can find my new location.
I hope u will enjoy the new site because it gives me the freedom to do more then just blogging.
1-3 of 3