Cross-Platform


PyChecker is a cool tool for checking Python scripts for bugs. It works with Python 2.0 – 2.7. In this article, we will write some crappy code to see what PyChecker can pick up on. Then we’ll improve the code according to what we find until the code checks out. According to PyChecker’s website, it can detect the following problems:

  • No global found (e.g., using a module without importing it)
  • Passing the wrong number of parameters to functions/methods/constructors
  • Passing the wrong number of parameters to builtin functions & methods
  • Using format strings that don’t match arguments
  • Using class methods and attributes that don’t exist
  • Changing signature when overriding a method
  • Redefining a function/class/method in the same scope
  • Using a variable before setting it
  • self is not the first parameter defined for a method
  • Unused globals and locals (module or variable)
  • Unused function/method arguments (can ignore self)
  • No doc strings in modules, classes, functions, and methods

(more…)

It’s time for another edition of the “weekly Python news”! What happened this week in Python world? You’ve come to the right place to find out. We missed the announcement last week about Germany’s Python Academy’s course schedule, so be sure to check that out. This week we have a lot of news from the Python web world (again) as well as news about a great new Python book.

  • Working with Django Settings files – I don’t do much with Django right now, but this looks interesting.
  • The Hudson project is supposedly going to get forked. The new fork is called Jenkins. You can read all about it on Greg Turnquist’s blog
  • The Pyramid project is a new development from the Pylons people. In this blog you can learn about Pyramid’s Auth API.
  • Did you know about ep.io, a new Python hosting service? Well you can read about it here if you like
  • Enthought recently added PySide support to some of their products.
  • Mark Lutz and O’Reilly have released the 4th edition of Programming Python, which is updated for Python 3. You can buy it from Amazon right now!
  • Wingware’s latest 4.0 beta is now out. You can read about it here and here

If you think that some news is missing, be sure to drop me a line via the comments or the contact form. Have a great week!

Last year, we covered some tips and tricks for the Grid control.In this article, we will go over a few tips and tricks for the wx.ListCtrl widget when it’s in “report” mode. Take a look at the tips below:

  • How to create a simple ListCtrl
  • How to sort the rows of a ListCtrl
  • How to make the ListCtrl cells editable in place
  • Associating objects with ListCtrl rows
  • Alternate the row colors of a ListCtrl

(more…)

This week’s Python news covers new modules, updates to old modules, a newish Python Magazine (no, not that one!), an update on what’s going on with the new wxPython and more!

  • TurboGears Joins the Pylons Project” (Alt title: TurboGears Becomes TurboPyramid). I think the title says it all…and no, they didn’t really rename the project.
  • wxPython’s “Project Phoenix” gets an update – this gives an update on how Robin Dunn is moving away from SWIG to make it easier to do documentation and the Python 3 port.
  • Michael Foord’s new “e” module makes a debut…read all about it on his blog
  • PET: Issue #1 – English translation of a magazine created by the Argentina Python Users Group. Yes, this is kind of old news, but I thought it was really cool and it needs YOUR support!
  • .

  • The PSF blog talks about high schoolers using Python to program robots under the guidance of Vern Ceder
  • PyCrypto gets a Python 3 port courtesy of Thorsten Behrens. Check out the thread and download your copy to help find any bugs!

That’s it for this week. Next time we’ll be in 2011! That’s amazing! Anyway, I hope you have a nice holiday and you’ll let me know of any Python news that I should talk about for the next post. Thanks!

A lot of websites are doing year-end retrospectives this week, so I thought you might find it interesting to know which articles on this blog were the most popular this year. Below you will find links to each article along with the page view count I got from Google Analytics:

  1. A Simple Step-by-Step Reportlab Tutorial, 9,709 page views, posted 03/08/2010
  2. Another Step-by-Step SqlAlchemy Tutorial Part 1, 7,746 page views, posted 02/03/2010
  3. Another Step-by-Step SqlAlchemy Tutorial Part 2, 4,858 page views, posted 02/03/2010
  4. Manipulating PDFs with Python and pyPdf, 4,511 page views, posted 05/15/2010
  5. Python 101: Introspection, 4,473 page views, posted 10/14/2010
  6. wxPython: Grid Tips and Tricks, 3,476 page views, posted 04/04/2010
  7. wxPython: Creating a Simple MP3 Player, 3,401 page views, posted 04/20/2010
  8. Python and Microsoft Office – Using PyWin32, 3,323 page views, posted 07/16/2010
  9. wxPython and Threads, 3,183 page views, posted 05/22/2010

It would seem that SqlAlchemy and Reportlab are pretty popular topics. Are there any articles about either of these cool packages that you think I should write? As you can see, wxPython makes it into the top ten 3 times! What should I write about next regarding wxPython?

This upcoming year, I plan to write about some of the other GUI toolkits. Which one do you think I should do first? Tkinter, PySide, PyGUI or something else? What packages or standard libraries do you think I should cover? Feel free to let me know via the comments below or via my contact form (link at top). I’m looking forward to another year of Python tinkering and writing and I hope you are too! Thanks for your readership and encouragement this year!

Earlier this week, there was a discussion on the wxPython IRC channel about how to store objects in wx.ListBox. Then later on that day, there was a question on StackOverflow about the same thing, but in relation to the wx.ComboBox. Fortunately, both of these widgets inherit from wx.ItemContainer and contain the Append method, which allows you to associate an object with an item in these widgets. In this article, you will find out how this is done. (more…)

When I originally started this blog, it was mostly a brain dump on my part so I wouldn’t forget how I did something cool with Python. Later on, I decided to use it to also document what I considered under-documented portions of wxPython. If my posts drew enough interest, I would also re-work the post into a wiki page on the wxPython wiki. (more…)

Almost any computer power user will want to use keyboard shortcuts (AKA: accelerators) to get their work done. Fortunately for us, wxPython provides a way to accomplish this very easily using an Accelerator Table via the wx.AcceleratorTable class. In this article we will look at a couple examples to see how this is accomplished. (more…)

Elixir is a lightweight declarative layer on top of SqlAlchemy that’s been around since 2006, well before SqlAlchemy released their own built-in Declarative syntax. Elixir was created by a collaboration between Jonathan LaCour, Daniel Haus and GaĆ«tan de Menten who had a passion for making SqlAlchemy even easier to use. In this tutorial, we’ll look at how to to create our own database with Elixir and how to communicate with a pre-existing database. (more…)

Last time, we looked at one of Python’s built-in XML parsers. In this article, we will look at the fun third-party package, lxml from codespeak. It uses the ElementTree API, among other things. The lxml package has XPath and XSLT support, includes an API for SAX and a C-level API for compatibility with C/Pyrex modules. We’ll just do a few simple things with it though. (more…)

« Previous PageNext Page »