Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19068
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <prvs=356196b0a=jeanmichel@sequans.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'python,': 0.01; 'flags': 0.05; 'python': 0.08; '(possibly': 0.09; 'chose': 0.09; 'coding.': 0.09; 'expected.': 0.09; 'subject:python': 0.10; 'library': 0.13; 'cc:addr:python-list': 0.15; 'backends': 0.16; 'deserved': 0.16; 'pygtk,': 0.16; 'style,': 0.16; 'wrote:': 0.16; 'practices,': 0.18; 'switched': 0.18; 'cc:no real name:2**0': 0.21; 'maybe': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.25; 'code': 0.25; 'thanks.': 0.25; 'exercise': 0.25; 'subject: : ': 0.25; 'code.': 0.26; 'import': 0.27; 'asking': 0.27; 'coding': 0.28; 'sound': 0.28; 'bit': 0.28; 'anyway.': 0.28; 'cc:addr:python.org': 0.29; '"why': 0.30; 'processes.': 0.30; 'threads': 0.30; 'error': 0.30; 'sort': 0.32; "won't": 0.33; 'it.': 0.33; 'header:User-Agent:1': 0.33; 'instead': 0.33; 'discussed': 0.34; 'rule': 0.34; 'list.': 0.34; 'all.': 0.34; 'anything': 0.34; 'subject:project': 0.34; 'yet,': 0.34; 'things': 0.35; 'be.': 0.35; 'switch': 0.35; 'project': 0.35; 'comment': 0.35; 'install': 0.35; 'starting': 0.36; 'but': 0.37; 'could': 0.37; 'some': 0.38; 'listed': 0.38; 'should': 0.38; 'difficult': 0.39; "i'd": 0.39; 'why': 0.39; 'subject:: ': 0.39; 'more': 0.61; 'hope': 0.61; 'your': 0.61; 'improve': 0.62; 'here': 0.64; 'show': 0.67; 'subject:First': 0.67; 'yourself': 0.69; 'touch': 0.69; 'race': 0.77; 'pro': 0.81; 'conditions,': 0.93; 'frequency': 0.93; 'url:fr': 0.96 |
| X-IronPort-AV | E=Sophos;i="4.71,524,1320620400"; d="scan'208";a="81404" |
| X-Virus-Scanned | amavisd-new at zimbra.sequans.com |
| Date | Tue, 17 Jan 2012 20:59:17 +0100 |
| From | Jean-Michel Pichavant <jeanmichel@sequans.com> |
| User-Agent | Mozilla-Thunderbird 2.0.0.24 (X11/20100328) |
| MIME-Version | 1.0 |
| To | Jérôme <jerome@jolimont.fr> |
| Subject | Re: First python project : Tuner |
| References | <20120117151601.78e495cb@bouzin.lan> |
| In-Reply-To | <20120117151601.78e495cb@bouzin.lan> |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4819.1326830384.27778.python-list@python.org> (permalink) |
| Lines | 45 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1326830384 news.xs4all.nl 6979 [2001:888:2000:d::a6]:53070 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:19068 |
Show key headers only | 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
Re: First python project : Tuner Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-01-17 20:59 +0100
csiph-web