imagegrab python code example
Example 1: setwd python
os.chdir("/home/varun/temp")
Example 2: dizionari python
>>> d = {'a': 1, 'b': 2, 'c': 3}
>>> len(d)
3
>>> d.items()
dict_items([('c', 3), ('a', 1), ('b', 2)])
>>> d.keys()
dict_keys(['c', 'a', 'b'])
>>> d.values()
dict_values([3, 1, 2])
>>> d.get('c', 0)
3
>>> d.get('x', 0)
0
>>> d
{'c': 3, 'a': 1, 'b': 2}
>>> d.pop('a', 0)
1
>>> d.pop('x', 0)
0
>>> d
{'c': 3, 'b': 2}
>>> d.pop('x')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'x'
>>> d.popitem()
('c', 3)
>>> d
{'b': 2}
>>> d.update({'a': 1, 'c': 3})
>>> d
{'c': 3, 'a': 1, 'b': 2}
>>> d.clear()
>>> d
{}
Example 3: import ImageGrab
from PIL import ImageGrab