Posts tagged with python
So, EuroPython 2011 came and went, and it was great fun. I'll try to write down some impressions before I forget them entirely. UPDATE: I finally got to publish this more than a year after it has been written. I won't even bother to read it much.
After reading my William Reade's post about a small path library he wrote to tame a build script, I thought I'd share a cool trick that has helped me greatly in the current project - the promise pattern.
OH: "async won't take hold until it sucks less." It cannot suck less because we are writing async code in languages designed to be procedural, given that you read them top-to-bottom.
The results of the 2nd PyAthens meeting: 17 participants, 8 presentations, souvlaki & beer ending, what's not to like?
I haven't been surprised by Python in a long time, but today I got surprised by lambdas and how do they capture their surrounding state.
Announcing the second meeting of the Athens Python User Group. Wednesday 21 October 2009, 19:00. Read on for details.
At my current gig we need to expand the team. We're looking for good all-round Python developers, who are comfortable with learning new technologies. Read on for more details.
After a long IRC chat with the kind Twisted folks on IRC, I am writing here
a post that could easily serve as an overview page of
twisted.mail.smtp. In my
opinion, Twisted sorely lacks overview pages, with real words and not just
links to examples. It also needs some Google love, so I hope this page will help
others looking how to send emails with Twisted.
In the spirit of the wonderful "Twisted web in 60 seconds" posts, I'm going to contribute here a small post about the Twisted reactor and Deferreds.
The Athens Python User Group had its first meeting on 9/9, at the Eleftheroudakis bookstore Café. This is a post describing what happened and what are the next steps.
I recently signed up to stdlib-sig so I could just nod in agreement to the people that suggested that the stdlib needs to evolve. In the discussions that ensued, the backwards compatibility argument came up often. I think it's not a valid argument for the specific discussion, though. Here are my thoughts.
We have a venue for the first meeting of the Athens Python User Group: See you at the Eleftheroudakis Bookstore café, Panepistimiou 17, 6th floor, on Wednesday 9 September, 7.00pm.
This is an announcement for the just-created Athens Python User Group. The 1st meeting will take place on Wednesday 9 September, 7:00 pm. Venue: Eleftheroudakis Bookstore café, Panepistimiou 17, 6th floor!
EuroPython is over, so it's time for me to write down my thoughts and impressions! Read on.
My employer is looking for an excellent Pythonista to fill a contracting position, part-time or full-time. Read inside for more information.
Well, it's over a month since my last update, so I might as well describe what I've been working on for the past month or so!
Key Value Coding or KVC is a very important part of Cocoa. Accessing these properties can be a kludge though - you have to use
setValue_forKey_(value, key) and
valueForKey_(key) which is quite verbose. Luckily, PyObjC has a nice shortcut: a single underscore.
As I mentioned some time ago, I'm now doing contracting. At my current project we need to get some more people on board. So if you're a Pythonista and want to work on exciting and challenging stuff for a couple of months (or more), read on!
Last Friday was my last day at Resolver Systems. I am now doing contracting work (mostly Python) for various clients, and I plan to move back to Greece soon.
Here is what I think about it.
PySmell is an autocompletion library for Python, supporting Vim, Emacs and TextMate.
This is a very minor release, just because I had some commits unreleased for two months. Changelog inside.
2008 is almost gone, and I got a lot of things done. Here's what I did, and here's what I plan to do in 2009.
Today I worked with William on the promising ironclad project which allows you to use CPython extension such as numpy under IronPython. Ironclad needs to setup some import hooks to allow the loading of .pyd files. Here's some findings.
After a ton of bug reports for TextMate, and some very constructive feedback and testing from Jesse Noller, I've decided there's no much point in waiting, so I'm happy to announce PySmell v0.7.2.
Grab it from PyPI and follow the instructions in README.markdown.
I often exchange small snippets or links with my girlfriend, and it's been very annoying having to right click on iChat, select the correct account and start a chat. So I've automated it!
Here is a small PyObjC snippet that will allow you to send iChat messages from the command line, using the ScriptingBridge framework and a bit of elbow grease. The next step would be to make a wrapper for it so it can live a an icon on the Desktop, but I'll try that some other time.
I'm very proud to announce the release of PySmell v0.7. PySmell is an auto-completion library for Python, meant to be plugged in different editors.
The big news for this release is the support for Emacs and TextMate, on top of the already existing Vim support.
Grab PySmell from PyPI
EDIT: PySmell 0.7.1 fixes a nasty TextMate bug, so please try again if you were put off by it!
Read inside for more information!
I'm not sure how much I've written about this, but you can probably discern by the titles of my blog posts that I'm looking for a good text editor. I think I've finally nailed my frustrations, and I think I have a glimpse of a solution.
One of the pleasures of open source is that random people contribute back uninvited. I received a setuptools patch the other day, and I'm trying to make things work. However, setuptools makes things hard -- although not so hard that I couldn't manage uploading PySmell to PyPI.
I'm happy to announce PySmell v0.6, an autocompletion library for Python and Vim (other editors pending).
New features include:
- Import statement completion
- Support for multiple TAGS files (that means external libraries)
- Support for analysing Python 2.4-2.5 stdlib.
Plus many bugfixes and minor improvements.
Grab it here: PySmell v0.6
In PyCon UK, the two keynote speakers, Mark Shuttleworth and Ted Leung raised the issue of how Python should "open up" and aim to be the best language at everything (Mark's point) and the easiest language to work with (Ted's point). I agree with both them, I was nodding all the time when they spoke.
Here are my thoughts on the state of GUI toolkits and how could Python take a first step to be on the web.
I've justed tagged version 0.5 of PySmell, the intellisense (or auto-completion, or omni-completion) provider for Python in github.
You can grab it here: http://github.com/orestis/pysmell/tree/v0.5
UPDATE: I've put up my lighting talk here: http://orestis.gr/static/downloads/pysmell-lightningtalk.pdf
Sitting in the lunch refectory, writing about the talks I've witnessed:
- The Savoury Flavors of Python 2.6 and Python 3.0
- PyPy's Python Interpreter - Status and Plans
- In Search of Speed and Flexibility
Following up from my previous post on Python and static typing, I'm proud to announce PySmell v0.1!
UPDATE2: PySmell v0.5 released
UPDATE: PySmell v0.2 released, get it here
PySmell is a python IDE completion helper, that covers 80% of the cases, leaving the rest to superior human brains.
It tries to statically analyze Python source code, without executing it, and generates information about a project's structure that IDE tools can use. There is currently support for Vim's omnicompletion, but porting to other editors which provide similar mechanisms should be straightforward.
In its current state it doesn't do any type inferencing, but it's surprisingly useful even without that. I plan to add simple type inferencing in the coming versions.
I'm building a small proof-of-concept to do something like that in Python, for Python. Here are my thoughts... UPDATE: Read about PySmell, a tool I wrote to provide static auto-completion for Python projects.
I've created and released a small Vim plugin that will try to mimic TextMate's behaviour to insert the closing pair of quotes, brackets, parentheses, braces etc. Download simple pairs! (I've also created one for Emacs)
I used Vim's built-in python scripting support, and seeing that it wasn't documented very well, I present some useful patterns here.
I've been stumbled a bit just now, trying to populate an NSOutlineView from PyObjC.
Read on for my solution!
I'm planning to do a screencast for this, but knowing myself, I'll just put the code here in case I run off to a different direction tomorrow...
So, I present a very lightly annotated hello world app in PyObjC!
Download PyObjC tutorial (24 KB)
If you like Python and you like Mac OS X, you should really check out PyObjC.
It's a bridge that allows you to create first-class Cocoa applications using Python. It also has support from Interface Builder and XCode in Leopard and it's already bundled with Apple's Developer Tools!
Unfortunately, if you followed the above link, it doesn't seem there's a lot of stuff going on. The examples are outdated and there hasn't been any update since January.
This is a call to arms to help the project gain some better documentation, for the benefit of everyone involved.
In the office I have to use Windows instead of my preferred OS X - no wonder, since we're developing a Windows application using .NET and IronPython.
This is a post detailing my quest to make emacs behave as I want it, that is, to make it more Windows-y and more TextMate-y.
As you may know (you probably don't :), I've built a greeklish to greek converter for my Diploma thesis, using Python.
It worked well enough (for a diploma thesis), but it was slow. I mean, really, really slow. It was coded in Pure Python (tm) and had no optimizations whatsoever.
After optimizing some stuff I decided I had to rewrite it using numpy, if I wanted to see significant speed-ups. I document some of my findings in this post.
So, yesterday I was asked an interesting question:
Int: Are you familiar with Python's
Me: Um, yes?
Interviewer clarifies what it's all about
Int: So I now want you to implement
__getattr__in such a way that when a method is called with the prefix
I spend much time on other people's computers - I'd like to be able to hack for 30 minutes on an idea, but unfortunately, it isn't easy. I have to download and install numerous software packages, like python, django, subversion, an SSH client etc. So I decided to put all that in a flash drive and take it around with me.
There is a neat piece of functionality in Django that will allow you to traverse your object graph by date:
Get next or previous by FOO, where FOO is a Date or DateTime field:
For every DateField and DateTimeField that does not have null=True, the object will have get_next_by_FOO() and get_previous_by_FOO() methods, where FOO is the name of the field. This returns the next and previous object with respect to the date field, raising the appropriate DoesNotExist exception when appropriate...
However, these methods use the default manager, that may be not what one wants.
Congratulations, boulder sprinters!
Or, a tale of reinventing the wheel
Seriously. For web-apps we have tens (maybe hundreds) of frameworks that abstract away the painful details of creating data-based applications.
I mean, using Django, you can whip-up some models, generate the appropriate database schema, play around in admin, maybe use databrowse, generate nice html forms, add a dash of HTML+CSS and you get maybe 80% of the functionality. Then you add your custom views, report generation, a bit of AJAX --if necessary-- and you have a nice data-based web application ready for deployment.