Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19068

Re: First python project : Tuner

Date 2012-01-17 20:59 +0100
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: First python project : Tuner
References <20120117151601.78e495cb@bouzin.lan>
Newsgroups comp.lang.python
Message-ID <mailman.4819.1326830384.27778.python-list@python.org> (permalink)

Show all headers | View raw


Jérôme wrote:
> Hi all.
>
> Like others before me, I'd like to show you my first python attempt, in the
> hope in can get advices on how to improve my coding.
>
> I started learning python and pyGTK last november. I had had a short
> experience of GTK with C, but had given up as I lacked time and I found it
> more difficult than I expected. python makes things more easy. Yet, after
> starting with pyGTK, I switched to PyGObject, and lack of documentation made
> small things a bit hard sometimes...
>
> The project I chose as an exercise is some sort of guitar tuner. It can be
> found here :
> http://devs.jolimont.fr/tuner/
>
> The choice of the sound backends was already discussed on this list. Next
> step would be to switch to a python audio library and use threads instead of
> processes.
>
> I added flags to avoid race conditions, perhaps with a little bit of
> clumsyness. This makes the code more complicated than it deserved to be.
>
> Any comment is welcome, be it about code optimization, coding style,
> pythonification, good practices, or simply program features and usability.
>
> Thanks.
>
>   
My system failed to import gi.repository
But don't bother I won't install anything anyway.
If it is not listed in your dependencies, maybe you should add it.

You could also display the frequency of A2 (possibly 440Hz), would give 
a pro touch to the thing :D

As for python, why don't use use 'pylint' on it. It is one good way to 
know about your code. It's not about correcting any error reported, but 
by simply looking at the messages/warnings, and asking yourself "why 
that rule ?" you can improve your coding style and design, maybe for the 
next application.

JM

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: First python project : Tuner Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-01-17 20:59 +0100

csiph-web