The objective of this article is to help people understand how the Python VM works, through a poke and learn approach.
Python’s byte code is specific to the CPython implementation. Moreover it is not guaranteed to be stable across CPython versions. And hence it is a bad idea to do such things in production code. The examples provided in this article are for demonstration and learning purposes only.
Thanks to the Indian Python community for recognizing my work, by selecting me for this year’s Kenneth Gonsalves award.
Building the Chennaipy community has been my focus in the past year. I would like to thank all people in Chennai Python community who have contributed to it.
In the December Chennaipy meetup, I did my presentation using asciidoc and dzslides. Though I liked the output, with dzslides' CSS it was not possible to print the slides to PDF. I was looking for ways to convert the slides to PDF, so that I can upload them to slideshare.
For the Chennaipy December meetup, we decided to do a series of 10-min Lightning Talks. But most people I spoke to, were wondering — what can you say in 10 min, how do I compress my 40 min talk into 10 min, … So here are a few suggestions for what to do and what not to do.
The following script finds the latest tag on an SVN project. The basic idea is to use svn info to find the last revision of the tags folder, and identify the tag with that revision. If the tags folder is not present, or if the tags folder is present but empty, the script prints N/O/N/E.
#!/bin/bash # # Usage: svn-latest-tag <SVN-PROJ-URL> # # Prints the latest tag or N/O/N/E if none available. # if [ "x$1" == "x" ]; then echo "Usage: svn-latest-tag <SVN-PROJ-URL>" exit 1 fi # # Tag name to be printed if none found, less likely to be a real tag # name. (directories cannot contain the forward slash, right?) # latest_tag="N/O/N/E" tags=$(svn ls $1/tags) if [ $? -ne 0 ]; then echo $latest_tag exit 1 fi last_rev=$(svn info $1 | grep "Last Changed Rev") if [ $? -ne 0 ]; then echo $latest_tag exit 1 fi # echo $last_rev for tag in $tags; do # echo "Checking tag" $tag if svn info $1/tags/$tag | grep "$last_rev"; then latest_tag=tag break fi done echo $latest_tag