Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-26 Thread Ville M. Vainio
On Jul 23, 11:29 pm, Nick Craig-Wood n...@craig-wood.com wrote:  The syntax would be something like:  def work():    showstatus(building)    r = yield runshell(make)    showstatus(installing)    r = yield runshell(make install)    showstatus(Success)  mygui.startwork(work)  #

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-26 Thread Ville M. Vainio
Apologies for the long subject line, here it is again: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops On Jul 21, 7:48 pm, John Nagle na...@animats.com wrote: The idea: To run functions that execute a series of system commands without

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-20 Thread Ville M. Vainio
On Jul 20, 1:12 pm, Ville Vainio vivai...@gmail.com wrote: Has anyone implementing something like what the subject line ImplentED. I don't think this is that hard to do in the first place, but a generic solution that can be easily tuned for different gui mainloops would be nice. --

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-20 Thread Ville M. Vainio
On Jul 20, 1:12 pm, Ville Vainio vivai...@gmail.com wrote: I imagine runshell() would be implemented in terms of QProcess, or subprocess.Popen/os.system and a worker thread. Actually, the problem is that of general serialization of worker thread operations. That is, it could be something akin

Re: ANN: Leo 4.6 rc1 released

2009-07-10 Thread Ville M. Vainio
On Jul 10, 9:54 pm, Edward K Ream edream...@charter.net wrote: The highlights of Leo 4.6: -- - Leo now features a modern Qt interface by default.   Leo's legacy Tk interface can also be used. And to drive home this point (Qt ui), some screenshots for the visually

Re: Chandler, Python, speed

2009-03-08 Thread Ville M. Vainio
Ville M. Vainio wrote: Alan G Isaac wrote: 3. Chandler is not really an email client. So specifically, which of its functionalities is it slow, and what evidence if any is there that Python is causing this? I remember reading somewhere that the cause of slowness is/was architectural

Re: Email Program

2009-03-07 Thread Ville M. Vainio
J wrote: Is it possible to make a GUI email program in Python that stores emails, composes, ect? Here's one with less than 600 lines: http://code.google.com/p/pyqtimap/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Chandler, Python, speed

2009-03-07 Thread Ville M. Vainio
Alan G Isaac wrote: 3. Chandler is not really an email client. So specifically, which of its functionalities is it slow, and what evidence if any is there that Python is causing this? I remember reading somewhere that the cause of slowness is/was architectural - perhaps it was that chandler

Re: Python equivalent for C module

2008-10-21 Thread Ville M. Vainio
Vinay Sajip [EMAIL PROTECTED] writes: import logging logging.warning(Message with %s data, variable) # or debug, info, error and I'd like to know what simpler interface you think would be better/ easier to grok for quick hack jobs. It's not the logging itself that is a problem, it's

Re: Developing for Python (2.x or 3)?

2008-10-21 Thread Ville M. Vainio
Paulo J. Matos [EMAIL PROTECTED] writes: I am in the process of choosing which Python version for a brand new application. Van Rossum in an interview recently advised all new applications to use Python3 but I am afraid, most libraries (PyGtk, I don't think he meant all new applications, bit

Re: Commercial Products in Python

2008-10-21 Thread Ville M. Vainio
Paulo J. Matos [EMAIL PROTECTED] writes: Hi all, I was just wondering, if you wish to commercialize an application developed in Python, what's the way to go? I guess the only way is to sell the source, right? That should be a good way to go about it. It doesn't make it open source, you can

Re: Python equivalent for C module

2008-10-20 Thread Ville M. Vainio
Bruno Desthuilliers [EMAIL PROTECTED] writes: STDOUT is for *normal* program outputs. Debug informations, warnings, and all verbosity should go to STDERR. Actually, stderr is for errors, by convention. It's rather impolite to dump trivial debug info to stderr, which often alerts the user more

Re: Porting VB apps to Python for Window / Linux use

2008-10-20 Thread Ville M. Vainio
Stef Mientki [EMAIL PROTECTED] writes: Sorry but for GUI design, Python is pre-historic ;-) Time to show the don't feed the troll sign, I guess. Even without the smiley, I'm convinced of my statement. cheers, I don't think I'm feeding the troll, but - ever took a look at PyQt? --

How to run PyOS_InputHook from python code (i.e. yield to event loops)

2008-09-06 Thread Ville M. Vainio
Background: PyOS_InputHook is something that gets run when python is doing raw_input. TkInter and friends use it to run their event loops, so that their events are handled while python is doing raw_input. What I'd like to do is run the same function without having to do raw_input. I.e. I'd like

ANN: IPython 0.8.3 is out

2008-05-29 Thread Ville M. Vainio
Hi all, The IPython team is happy to release version 0.8.3, with lots of new enhancements as well as many bug fixes, and updated documentation that has been long in the coming. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Ville M. Vainio
Fuzzyman [EMAIL PROTECTED] writes: Perhaps a lint-like validation tool would be optimal for this problem... So we can refuse to execute their code if they use private APIs? No, but it could complain and point out the exact offending lines, pointing their development effort to right

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Ville M. Vainio
Duncan Booth [EMAIL PROTECTED] writes: Or if you code in C++ and they *really* need to get at something you made private they will still get at it. I've been there and done that: 'private' in languages which have it is rarely an advantage and frequently a pain. Indeed. In C++, they

Re: Storing objects in relational database

2008-05-24 Thread Ville M. Vainio
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: I don't know if you'd label it 'elegant', but as far as I'm concerned, storing serialized objects as blobs in a relational database is mostly non-sense. If I use a relational database, it's because it is a *relational* database. If you want an

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Ville M. Vainio
Fuzzyman [EMAIL PROTECTED] writes: The 'we told you not to use that' approach, when applied to paying customers doesn't really work... all they see is that you broke their spreadsheet code by changing your API. And the customer point of view is quite reasonable - they have a job to do, and a

Re: feature proposal, debug on exception

2008-05-21 Thread Ville M. Vainio
Simon Forman [EMAIL PROTECTED] writes: This is not exactly an answer to your proposal, I know, but FWIW Ipython has exactly this capability. Yes. When you %run a scripts and get exception, you can launch post-mortem pdb on it by typing %debug. --

Re: Shelve or pickle module

2008-05-18 Thread Ville M. Vainio
Gabriel Genellina [EMAIL PROTECTED] writes: A shelve is just a persistent dictionary that uses pickle to store the objects. If you want to store one or a few objects, using pickle directly may be easier. Any problem you may have with pickle (nonpickleable objects, security risks) will

Re: datamining .txt-files, library?

2008-05-15 Thread Ville M. Vainio
Chris [EMAIL PROTECTED] writes: On May 15, 2:27 pm, globalrev [EMAIL PROTECTED] wrote: i have a big collection of .txt files that i want to open and parse to extract information. is there a library for this or maybe even built in? os.open to open the files and iterate through it and built

Re: portable way to tell what Popen will call

2008-05-14 Thread Ville M. Vainio
Brendan Miller [EMAIL PROTECTED] writes: For instance on unix systems, Popen will work for files flagged with the executable bit, whereas on windows Popen will work on files ending the in .exe extension (and I don't think anything else). Is there a portable way Actually, if you pass the

Re: python vs. grep

2008-05-13 Thread Ville M. Vainio
Ricardo Aráoz [EMAIL PROTECTED] writes: The easy/simple (too easy/simple?) way I see out of it is to read THE WHOLE file into memory and don't worry. But what if the file is too The easiest and simplest approach is often the best with Python. Reading in the whole file is rarely too heavy, and

Re: observer pattern (notification chain synchronization)

2008-05-11 Thread Ville M. Vainio
Alan Isaac [EMAIL PROTECTED] writes: Here is one way: - for each fund, create a ``reportreceived`` dict that maps stocks to booleans (initially False) - as each stock notifies its funds, the fund changes False to True and checks ``all(reportreceived.values())`` to determine whether it is

Re: observer pattern (notification chain synchronization)

2008-05-11 Thread Ville M. Vainio
Alan Isaac [EMAIL PROTECTED] writes: OK, thanks. Another approach is to begin with a set of stocks and remove them as they report. You can then trigger a report with the empty set instead of repeatedly calling ``all``. After a report the set can be refilled. Ah, and I obviously

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Ville M. Vainio
bc90021 [EMAIL PROTECTED] writes: The error message was at the top of the thread (am I incapable of posting it, or are you incapable of following a thread?), but here it is again: IOError: [Errno 2] no such file u'tempfileName' Typically, when you report an error message, it helps to paste

Re: observer pattern question #1 (reference to subject)

2008-05-08 Thread Ville M. Vainio
Alan Isaac [EMAIL PROTECTED] writes: Is anything lost by not maintaining this reference (other than error checking ...)? If I feel the observer needs access to the subject, what is wrong with just having the subject pass itself as part of the notification? It reduces the number of

Re: observer pattern question #1 (reference to subject)

2008-05-08 Thread Ville M. Vainio
Alan Isaac [EMAIL PROTECTED] writes: the following: OK, here's the pattern, now your listener wants to know the event source, do not ask something new the subject to respond to that need. That is unnecessary coupling. Instead, just rewrite your listener to maintain a reference to the

Re: License selection for free software

2008-05-07 Thread Ville M. Vainio
Paul Boddie [EMAIL PROTECTED] writes: original licence as well. Now, I did leave a fair amount of information about the heritage of the code, so that anyone who is scared of the LGPL could just go and get the original work, but that I doubt anyone is really afraid of LGPL. The only problem

Re: License selection for free software

2008-05-06 Thread Ville M. Vainio
Excuse the long post. Ben Finney [EMAIL PROTECTED] writes: I guess it's safe to assume that you are not opposed to using code based on more liberal license, right? :-) I'm less inclined to base work on, or contribute to, a work under a non-copyleft license, because I have less assurance

Re: Python application distribution

2008-05-05 Thread Ville M. Vainio
ron.longo wrote: unable to execute. Why is this? At this point I'm not really keen on handing out the source files to my application, it feels unprofessional. If you plan to deploy on windows, py2exe could be the more professional approach you are thinking of. --

Re: Python application distribution

2008-05-05 Thread Ville M. Vainio
ron.longo wrote: unable to execute. Why is this? At this point I'm not really keen on handing out the source files to my application, it feels unprofessional. If you plan to deploy on windows, py2exe could be the more professional approach you are thinking of. --

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
Zed A. Shaw [EMAIL PROTECTED] writes: GPLv3? How do people feel about Vellum's GPLv3 status? It actually doesn't impact anyone unless you embed Vellum into a project/product or you Yeah, but it effectively prevents people from embedding it into their apps that wish to remain BSD/MIT clean.

Re: [ANN] Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
[EMAIL PROTECTED] writes: I didn't find your language offensive but you might consider toning down your review of the Awesome Window Manager :) Nah - keep up the bad attitude. Your (Zed) blog/articles are one of the few things on the programmosphere that actually make me laugh audibly. --

Re: ISBN Barecode reader in Python?

2008-05-05 Thread Ville M. Vainio
Max Erickson [EMAIL PROTECTED] writes: The killer application for ISBN lookup on Amazon is checking prices while in the bookstore. Being able to email a photo from your phone and then getting an email with the Amazon price in response would be way easier than typing the isbn into Google

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
Paul Boddie [EMAIL PROTECTED] writes: Anyway, I'm just confirming that I'm clearly not one of the many described above. A lot of my own work is licensed under the GPL or I guess it's safe to assume that you are not opposed to using code based on more liberal license, right? :-) My point is:

Re: Python make like tools (was Re: [ANN] DoIt 0.1.0 Released (build tool))

2008-04-23 Thread Ville M. Vainio
Eduardo Schettino wrote: I find the doit syntax a bit cumbersome, especially as you can avoid 'args' by just returning a lamda in 'action'. My idea was to: do *not* add any new syntax (to avoid being cumbersome). It is just python, you dont have to import or subclass Yeah, decorators get

Re: Unix Device File Emulation

2008-04-23 Thread Ville M. Vainio
blaine wrote: example usage: echo 'line 0 0 10 10' /dev/screen On the actual embedded device this is handled by a kernel module. We can spit commands into it as fast as we can and the kernel module can keep up. This is typical unix device file behavior. Any suggestions or advice would be

Python make like tools (was Re: [ANN] DoIt 0.1.0 Released (build tool))

2008-04-21 Thread Ville M. Vainio
Eduardo Schettino wrote: DoIt is a build tool that focus not only on making/building things but on executing any kind of tasks in an efficient way. Designed to be easy to use and get out of your way. I took a look at dolt syntax, and saw this: QQQ def create_folder(path): Create folder