A server launcher with log console in Python Tkinter

Posted on Fri 13 March 2015 in Python • Tagged with GUI, Multithreading, python, Tkinter, UDPLeave a comment

I'm working on an Tk application that should start and stop an UDP server, I need to show server logs in the Tk GUI with a "Pause & Resume" button.

I already have the UDP server implemented using the blocking SocketServer.BaseRequestHandler , so in order to wrap a GUI to ...

Continue reading

Using special chars in Python string Templates

Posted on Wed 05 June 2013 in Python • Tagged with coding, python, strings, templatingLeave a comment

PEP-292 introduced a nice Python templating feature.
Templates placehoder names are subject to some restrictions,Documentation says:

$identifier names a substitution placeholder matching a mapping key of "identifier".
By default, "identifier" must spell a Python identifier.
The first non-identifier character after the $ character terminates this placeholder specification.

This means that ...

Continue reading

Encoding and decoding Encapsulated DHCP options (RFC 2132)

Posted on Fri 19 October 2012 in Python • Tagged with decoding, dhcp, encapsulated options, encoding, python, rfc2132Leave a comment

Vendor specific DHCP options may be provided encapsulated in DHCP option 43.
With this little script you can encode and decode vendor encapsulated option according to RFC 2132.

For example with this command you can tunnel options 66 (TFTP Server), 67 (TFTP Path), 132 (VLAN ID) and 133 (VLAN QOS ...

Continue reading

Simple CMS using web.py and Markdown

Posted on Fri 18 November 2011 in Python • Tagged with python, web.py, webapplicationsLeave a comment

With a bit of code you can build a simple but powerful, single page, CMS using python, web.py and content stored in markdown files.

1) the application: application.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20 ...
Continue reading

Client side result pagination in python-ldap

Posted on Tue 25 October 2011 in Python • Tagged with code, ldap, python, python-ldapLeave a comment

Sometime I must fighting with monkeys-configured LDAP servers.
This time DIT does not support RFC2696 (Paged Results for LDAP query), the data tree contains over 90000 entries.
Thanks to ldap.resiter is possible to implement client side pagination in ldap scripts.
These simple lines of code explain how to:

import ...
Continue reading

Hacking della seriale

Posted on Thu 09 February 2006 in Python • Tagged with serial portLeave a comment

Leggere e modificare lo stato dei pin di seganalzione della seriale:
due script

Continue reading