Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 21:58:46 +, Steven D'Aprano wrote: > On Mon, 04 Feb 2008 17:08:02 +, Marc 'BlackJack' Rintsch wrote: > >>> Surprisingly, Method 2 is a smidgen faster, by about half a second over >>> 500,000 open-write-close cycles. It's not much faster, but it's >>> consistent, over m

Re: extending python with array functions

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 20:56:02 -0200, Gabriel Genellina wrote: > - the array module http://docs.python.org/lib/module-array.html provides > homogeneuos arrays that may be more efficient for your application. arrays > don't have a special API, you have to import the module and use its > functio

Re: future multi-threading for-loops

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 19:22:29 -0800, castironpi wrote: > Some iterables and control loops can be multithreaded. Worries that > it takes a syntax change. > > for X in A: > def f( x ): > normal suite( x ) > start_new_thread( target= f, args= ( X, ) ) > > Perhaps a control-flow wrap

Re: future multi-threading for-loops

2008-02-04 Thread castironpi
On Feb 5, 12:26 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 5 feb, 03:46, [EMAIL PROTECTED] wrote: > > > Some timing stats: On Windows XP, Python 3.0a2. > > > [timing code, 10,000 calls] > > [ f( X ) ]: 0.0210021106034 > > [ start_new_thread( f, X ) ]: 1.15759908033 > > [ Thread( f, X ).s

Re: future multi-threading for-loops

2008-02-04 Thread Gabriel Genellina
On 5 feb, 03:46, [EMAIL PROTECTED] wrote: > Some timing stats: On Windows XP, Python 3.0a2. > > [timing code, 10,000 calls] > [ f( X ) ]: 0.0210021106034 > [ start_new_thread( f, X ) ]: 1.15759908033 > [ Thread( f, X ).start() ]: 1.85400099733 > [ Thread( f, X ).start and .join() ]: 1.93716743329

Re: Elementary string-parsing

2008-02-04 Thread Odysseus
In article <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > The term "global" usually means "module global" in Python. Because they're like the objects obtained from "import"? > [T]he functions depend on some magic data coming from "nowhere" and > it's much harder t

Re: Binary file Pt 1 - Only reading some

2008-02-04 Thread Gabriel Genellina
On 5 feb, 01:51, Mastastealth <[EMAIL PROTECTED]> wrote: > I'm trying to create a program to read a certain binary format. I have > the format's spec which goes something like: > > First 6 bytes: String > Next 4 bytes: 3 digit number and a blank byte > --- > Next byte: Height (Number up to 255) > N

nonblocking read of one xml element?

2008-02-04 Thread mh
So, I'm parsing a log file that's being written out in real time. 123foo 456bar <--- no , coz the file hasn't yet been closed This is part of an event loop, so I want to have some code that looks like this: when logfile is readable: read one node, including children

Re: Very weird behavior in MySQLdb "execute"

2008-02-04 Thread Gabriel Genellina
On 5 feb, 01:42, Steve Holden <[EMAIL PROTECTED]> wrote: > John Nagle wrote: > > Carsten Haese wrote: > >> On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote: > >>> Restarting the MySQL instance changes the database.  The entry > >>> "google.com" > >>> disappears, and is replaced by "www.google.c

Re: future multi-threading for-loops

2008-02-04 Thread castironpi
On Feb 4, 9:22 pm, [EMAIL PROTECTED] wrote: > Some iterables and control loops can be multithreaded.  Worries that > it takes a syntax change. > > for X in A: >     def f( x ): >         normal suite( x ) >     start_new_thread( target= f, args= ( X, ) ) > > Perhaps a control-flow wrapper, or metho

Re: Spawn new process -> get pid

2008-02-04 Thread Gabriel Genellina
On 4 feb, 22:21, breal <[EMAIL PROTECTED]> wrote: > On Feb 4, 3:34 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Mon, 04 Feb 2008 20:59:16 -0200, breal <[EMAIL PROTECTED]> > > escribió: > > > > I have a soap server written in Python that acts as an intermediary > > > between a web ser

Re: Client side GUI-like web framework ?

2008-02-04 Thread USCode
jay graves wrote: > On Feb 4, 11:45 am, USCode <[EMAIL PROTECTED]> wrote: >> Wouldn't it be handy if there was a web framework that allowed you to >> create pages and control the interface like you would using a >> client-side GUI framework such as Tkinter? > > What about GWT? > http://code.google

Re: Binary file Pt 1 - Only reading some

2008-02-04 Thread Jared Grubb
You should look into the struct module. For example, you could do the same thing via (using the variable names you used before): header_str = info.read(13) a,b,c,d,e = struct.unpack("6s4sBBB", header_str) After that, you will probably be able to get the integers by (doing it one at a time... read'

Re: (websearch) script ?

2008-02-04 Thread Bernard
On 4 fév, 17:17, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > Being very satisfied with Python as a general program language, > and having troubles with a number of PHP scripts, moving to another > provider, > I wanted to replace the PHP scripts with Python Scripts. > > The most important o

Re: Elementary string-parsing

2008-02-04 Thread Odysseus
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 04 Feb 2008 09:43:04 GMT, Odysseus > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > > > Thanks, that will be very useful. I was casting about for a replacement > > for PostScript's

Re: Client side GUI-like web framework ?

2008-02-04 Thread jay graves
On Feb 4, 11:45 am, USCode <[EMAIL PROTECTED]> wrote: > Wouldn't it be handy if there was a web framework that allowed you to > create pages and control the interface like you would using a > client-side GUI framework such as Tkinter? What about GWT? http://code.google.com/webtoolkit/ Or its pyth

Binary file Pt 1 - Only reading some

2008-02-04 Thread Mastastealth
I'm trying to create a program to read a certain binary format. I have the format's spec which goes something like: First 6 bytes: String Next 4 bytes: 3 digit number and a blank byte --- Next byte: Height (Number up to 255) Next byte: Width (Number up to 255) Next byte: Number 0 - 5 Every 2 bytes

Re: Very weird behavior in MySQLdb "execute"

2008-02-04 Thread Steve Holden
John Nagle wrote: > Carsten Haese wrote: >> On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote: >>> Restarting the MySQL instance changes the database. The entry "google.com" >>> disappears, and is replaced by "www.google.com". This must indicate a >>> hanging >>> transaction that wasn't commit

Re: Client side GUI-like web framework ?

2008-02-04 Thread USCode
Michael L Torrie wrote: > Which is a heck of lot better than OS lock in. Of course you can use > xul-runner or something. Gecko and XUL are both open source, so I'm not > quite sure what this lock in really is, though. > Lock-in in the sense that your application would only run in the Firefox b

future multi-threading for-loops

2008-02-04 Thread castironpi
Some iterables and control loops can be multithreaded. Worries that it takes a syntax change. for X in A: def f( x ): normal suite( x ) start_new_thread( target= f, args= ( X, ) ) Perhaps a control-flow wrapper, or method on iterable. @parallel for X in A: normal suite( X )

Re: Client side GUI-like web framework ?

2008-02-04 Thread Michael L Torrie
USCode wrote: > Michael L Torrie wrote: >> But it is served up in the firefox web browser. A good example is: >> >> http://www.faser.net/mab/chrome/content/mab.xul >> > That's pretty slick, but unfortunately then you're locked into only the > Firefox web browser, which many folks don't use. You'

Make Money

2008-02-04 Thread GorskiKamil . 1993
Hello, do you want make money? Its easy :)) Just register on alertpay.com.Register on http://bux.to/?r=kimozek ( pls dont delete "kimozek" ) . While you do it, just click on links and get money!! -- http://mail.python.org/mailman/listinfo/python-list

Re: Client side GUI-like web framework ?

2008-02-04 Thread Eric
On Feb 4, 9:45 am, USCode <[EMAIL PROTECTED]> wrote: > Wouldn't it be handy if there was a web framework that allowed you to > create pages and control the interface like you would using a > client-side GUI framework such as Tkinter? > > The framework would need a small, fast web server that would

Re: Client side GUI-like web framework ?

2008-02-04 Thread USCode
Michael L Torrie wrote: > > But it is served up in the firefox web browser. A good example is: > > http://www.faser.net/mab/chrome/content/mab.xul > That's pretty slick, but unfortunately then you're locked into only the Firefox web browser, which many folks don't use. You're trading OS lock

Re: Spawn new process -> get pid

2008-02-04 Thread breal
On Feb 4, 3:34 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 04 Feb 2008 20:59:16 -0200, breal <[EMAIL PROTECTED]> > escribió: > > > I have a soap server written in Python that acts as an intermediary > > between a web service and an InDesign server. The indesign server is > > non-t

Re: Client side GUI-like web framework ?

2008-02-04 Thread Michael L Torrie
USCode wrote: > [EMAIL PROTECTED] wrote: >> You just described what XUL aims to be >> http://developer.mozilla.org/en/docs/The_Joy_of_XUL >> http://developer.mozilla.org/en/docs/XULRunner >> >> At present it lacks for sure documentation (or maybe it isn't >> organized really well) > > Just took a

Re: Spawn new process -> get pid

2008-02-04 Thread Gabriel Genellina
En Mon, 04 Feb 2008 20:59:16 -0200, breal <[EMAIL PROTECTED]> escribió: > I have a soap server written in Python that acts as an intermediary > between a web service and an InDesign server. The indesign server is > non-threaded, so when all instances are used up I want to create a new > instanc

Re: Mysterious xml.sax Encoding Exception

2008-02-04 Thread John Machin
On Feb 5, 9:02 am, JKPeck <[EMAIL PROTECTED]> wrote: > On Feb 2, 12:56 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] > > nomine.org> wrote: > > -On [20080201 19:06], JKPeck ([EMAIL PROTECTED]) wrote: > > > >In both of these cases, there are only plain, 7-bit ascii characters > > >in the xml,

Spawn new process -> get pid

2008-02-04 Thread breal
I have a soap server written in Python that acts as an intermediary between a web service and an InDesign server. The indesign server is non-threaded, so when all instances are used up I want to create a new instance, get the pid, use the process, then kill it. What is the best way to do this? I

Re: extending python with array functions

2008-02-04 Thread Gabriel Genellina
En Mon, 04 Feb 2008 18:44:42 -0200, Janwillem <[EMAIL PROTECTED]> escribió: > I want to make numerical functions that can be called from python. > I am programming in pascal the last few decades so I had a look at > "python for delphi" (P4D). The demo09 gives as example add(a,b) using > integer

Re: Module/package hierarchy and its separation from file structure

2008-02-04 Thread NickC
On Jan 31, 12:27 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > Python stores filename and line number information in code objects > (only). If you have a reference to any code object (a method, a > function, a traceback...) inspect can use it to retrieve that > information. Aside from general

Dynamic Lookup in C#

2008-02-04 Thread bearophileHUGS
It seems C# 4.0 may become a bit closer to dynamic languages, especially closer to the Boo language (that is mostly static): http://blogs.msdn.com/charlie/archive/2008/01/25/future-focus.aspx As it develops, and its VM gains the method inlining capabilities of HotSpot, it will be faster. Static la

Re: Problem with Image: Opening a file

2008-02-04 Thread Graham Dumpleton
On Feb 4, 6:51 pm, mcl <[EMAIL PROTECTED]> wrote: > I am obviously doing something stupid or not understanding the > difference between HTML file references and python script file > references. > > I am trying to create a thumbnail of an existing .jpg file. It is in > the directory 'temp', which is

Re: Windows - remote system window text

2008-02-04 Thread Gabriel Genellina
En Mon, 04 Feb 2008 17:25:00 -0200, rdahlstrom <[EMAIL PROTECTED]> escribió: > On Feb 4, 2:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Well, i guess you will need a process on each machine you need to >> monitor, and then you do have a client server setup. > > Crap, that's what I di

(websearch) script ?

2008-02-04 Thread Stef Mientki
hello, Being very satisfied with Python as a general program language, and having troubles with a number of PHP scripts, moving to another provider, I wanted to replace the PHP scripts with Python Scripts. The most important one is a PHP script that searches text in all documents on my website.

Re: Very weird behavior in MySQLdb "execute"

2008-02-04 Thread John Nagle
Carsten Haese wrote: > On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote: >> Restarting the MySQL instance changes the database. The entry "google.com" >> disappears, and is replaced by "www.google.com". This must indicate a >> hanging >> transaction that wasn't committed. >> >> But that trans

Re: Mysterious xml.sax Encoding Exception

2008-02-04 Thread JKPeck
On Feb 2, 12:56 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080201 19:06], JKPeck ([EMAIL PROTECTED]) wrote: > > >In both of these cases, there are only plain, 7-bit ascii characters > >in the xml, and it really is valid utf-16 as far as I can tell. > > Did you

Re: Unexpected timing results with file I/O

2008-02-04 Thread Steven D'Aprano
On Mon, 04 Feb 2008 17:08:02 +, Marc 'BlackJack' Rintsch wrote: >> Surprisingly, Method 2 is a smidgen faster, by about half a second over >> 500,000 open-write-close cycles. It's not much faster, but it's >> consistent, over many tests, changing many of the parameters (e.g. the >> number of f

Re: Linux Journal Survey

2008-02-04 Thread Florian Diesch
Albert van der Horst <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Russ P. <[EMAIL PROTECTED]> wrote: >>On Jan 23, 7:42 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >>> On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: >>> >>> > The annual Linux Journal survey is online now for any Lin

Re: Project naming suggestions?

2008-02-04 Thread [EMAIL PROTECTED]
On 4 fév, 18:26, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On Feb 3, 7:17 pm, [EMAIL PROTECTED] wrote: > > > > > I'm considering writing a little interpreter for a python-like > > language and I'm looking for name suggestions. :-) > > > Basically, I don't want to change a whole lot about Python. I

Re: type, object hierarchy?

2008-02-04 Thread Steve Holden
Christian Heimes wrote: > 7stud wrote: >> The output suggests that Dog actually is a subclass of type--despite >> the fact that issubclass(Dog, type) returns False. In addition, the >> output of dir(type) and dir(object): > > No, type is the meta class of the class object: > issubclass(obje

Re: App idea, Any idea on implementation?

2008-02-04 Thread Dr Mephesto
thanks for the pointers! I just found a program that does more or less what I want, but I would still like to have a go myself. The link is: http://www.akoff.com/music-composer.html I gave the program a go, as there is a free trial. I found that it had a hard time doing the conversion (or I am a

Re: MySQLdb: commit before cursor close, or after?

2008-02-04 Thread John Nagle
Steve Holden wrote: > Carsten Haese wrote: >> On Mon, 2008-02-04 at 19:53 +0100, Frank Aune wrote: >>> No, you obviously need to commit your changes before closing the >>> cursor. I'm surprised if your code above even works if adding content >>> to the db. >> >> Why is that obvious? Is this some

Re: polling for output from a subprocess module

2008-02-04 Thread jakub . hrozek
On 4 Ún, 11:49, Thomas Bellman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > try: > > test = Popen(test_path, > > stdout=PIPE, > > stderr=PIPE, > > close_fds=True, > >

extending python with array functions

2008-02-04 Thread Janwillem
I want to make numerical functions that can be called from python. I am programming in pascal the last few decades so I had a look at "python for delphi" (P4D). The demo09 gives as example add(a,b) using integers and pyarg_parsetuple. That works! However, I cannot figure out what to do when a,

Re: MySQLdb: commit before cursor close, or after?

2008-02-04 Thread Steve Holden
Carsten Haese wrote: > On Mon, 2008-02-04 at 19:53 +0100, Frank Aune wrote: >> No, you obviously need to commit your changes before closing the cursor. I'm >> surprised if your code above even works if adding content to the db. > > Why is that obvious? Is this some MySQL-specific oddity? In other

Re: Pysqlite issue no attribute 'autocommit'

2008-02-04 Thread Paul McNett
Andy Smith wrote: > Im trying to run a Python based program which uses MySQL with > python-sqlite and Im recieving this error, > > 'Connection' object has no attribute 'autocommit' > > I´ve had a google for this and its seems like it may be a bug > python-sqlite or sqlite bug , but also

Re: Very weird behavior in MySQLdb "execute"

2008-02-04 Thread Carsten Haese
On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote: > Restarting the MySQL instance changes the database. The entry "google.com" > disappears, and is replaced by "www.google.com". This must indicate a hanging > transaction that wasn't committed. > > But that transaction didn't come from the Pyt

Pysqlite issue no attribute 'autocommit'

2008-02-04 Thread Andy Smith
Hi there, Im trying to run a Python based program which uses MySQL with python-sqlite and Im recieving this error, 'Connection' object has no attribute 'autocommit' I´ve had a google for this and its seems like it may be a bug python-sqlite or sqlite bug , but also I tried searching for it

Re: MySQLdb: commit before cursor close, or after?

2008-02-04 Thread Carsten Haese
On Mon, 2008-02-04 at 19:53 +0100, Frank Aune wrote: > No, you obviously need to commit your changes before closing the cursor. I'm > surprised if your code above even works if adding content to the db. Why is that obvious? Is this some MySQL-specific oddity? In other databases, it's the cursor's

Re: Windows - remote system window text

2008-02-04 Thread rdahlstrom
On Feb 4, 2:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I can understand that. But look at the bright side, you don't have to > rely on windows authentication, you just need an open port. Now i > don't know what you are building, but with a client/server setup you > can also get to othe

Re: When is min(a, b) != min(b, a)?

2008-02-04 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Thu, 24 Jan 2008 13:34:56 +, Antoon Pardon wrote: > >> On 2008-01-21, Steven D'Aprano <[EMAIL PROTECTED]> >> wrote: >>> On Sun, 20 Jan 2008 21:15:02 -0600, Albert Hopkins wrote: >>> >>> According to the IEEE-754 sta

Re: Windows - remote system window text

2008-02-04 Thread [EMAIL PROTECTED]
I can understand that. But look at the bright side, you don't have to rely on windows authentication, you just need an open port. Now i don't know what you are building, but with a client/server setup you can also get to other data that you might need, like mouse movement to detect for activity, us

Re: MySQLdb: commit before cursor close, or after?

2008-02-04 Thread Frank Aune
On Monday 04 February 2008 19:14:13 John Nagle wrote: >I'm getting some wierd commit-related behavior from MySQLdb. I'm > using InnoDB, so transactions really matter. > > I'm currently doing > > cursor = db.cursor() > cursor.execute(...) > cursor.close() > db.commit() >

Re: Extending the import mechanism - what is recommended?

2008-02-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Jan 29, 2:36 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I need to extend the import mechanism to support another file type. >>> I've already written the necessary C library to read the file and >>> return a python code object. >>> I fou

Re: Extending the import mechanism - what is recommended?

2008-02-04 Thread dbr517
On Jan 29, 2:36 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I need to extend the import mechanism to support another file type. > > I've already written the necessary C library to read the file and > > return a python code object. > > > I found one example which just

Re: Windows - remote system window text

2008-02-04 Thread rdahlstrom
On Feb 4, 2:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Well, i guess you will need a process on each machine you need to > monitor, and then you do have a client server setup. > > This can be easily accomplished with fx Pyro (http:// > pyro.sourceforge.net/) for communication, and the

Very weird behavior in MySQLdb "execute"

2008-02-04 Thread John Nagle
This has me completely mystified. Some SELECT operations performed through MySQLdb produce different results than with the MySQL graphical client. This failed on a Linux server running Python 2.5, and I can reproduce it on a Windows client running Python 2.4. Both are running MySQL 2.5. The

Re: Windows - remote system window text

2008-02-04 Thread [EMAIL PROTECTED]
Well, i guess you will need a process on each machine you need to monitor, and then you do have a client server setup. This can be easily accomplished with fx Pyro (http:// pyro.sourceforge.net/) for communication, and the Win32 Python library (https://sourceforge.net/projects/pywin32/) for creati

Re: Client side GUI-like web framework ?

2008-02-04 Thread Salvatore
[EMAIL PROTECTED] a écrit : > > You just described what XUL aims to be > http://developer.mozilla.org/en/docs/The_Joy_of_XUL > http://developer.mozilla.org/en/docs/XULRunner XUL is great but it does not allow yet to use Python. There use to be such a beast, it was named 'Nufox'... Give a try to

Re: Client side GUI-like web framework ?

2008-02-04 Thread USCode
[EMAIL PROTECTED] wrote: > You just described what XUL aims to be > http://developer.mozilla.org/en/docs/The_Joy_of_XUL > http://developer.mozilla.org/en/docs/XULRunner > > At present it lacks for sure documentation (or maybe it isn't > organized really well) Just took a look at XUL and it in som

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 10:48:32 -0800, rdahlstrom wrote: > It doesn't matter how many doors opening and closing there are, it > matters the order in which the opening, walking through, and closing > are done. That's my point. In the second example, all of the disk > operations are done at the same

Re: type, object hierarchy?

2008-02-04 Thread 7stud
Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected timing results with file I/O

2008-02-04 Thread rdahlstrom
It doesn't matter how many doors opening and closing there are, it matters the order in which the opening, walking through, and closing are done. That's my point. In the second example, all of the disk operations are done at the same time. That's what I meant by people going through the doors.

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 10:18:39 -0800, rdahlstrom wrote: > On Feb 4, 1:12 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: >> > You have 500,000 people to fit through a door. Here are your options: >> >> > 1. For each person, open the door, walk

Re: Client side GUI-like web framework ?

2008-02-04 Thread [EMAIL PROTECTED]
On 4 Feb, 18:45, USCode <[EMAIL PROTECTED]> wrote: > Wouldn't it be handy if there was a web framework that allowed you to > create pages and control the interface like you would using a > client-side GUI framework such as Tkinter? > > The framework would need a small, fast web server that would >

Re: Unexpected timing results with file I/O

2008-02-04 Thread rdahlstrom
On Feb 4, 1:12 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > > > > > On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED] > > > cybersource.com.au> wrote: > > > After reading an earlier thread about opening and closing lots of files, > > >

Re: Unexpected timing results with file I/O

2008-02-04 Thread Carl Banks
On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > After reading an earlier thread about opening and closing lots of files, > > I thought I'd do a little experiment. > > > Suppose you have a whole

MySQLdb: commit before cursor close, or after?

2008-02-04 Thread John Nagle
I'm getting some wierd commit-related behavior from MySQLdb. I'm using InnoDB, so transactions really matter. I'm currently doing cursor = db.cursor() cursor.execute(...) cursor.close()

Re: Unexpected timing results with file I/O

2008-02-04 Thread Gabriel Genellina
En Mon, 04 Feb 2008 15:53:11 -0200, rdahlstrom <[EMAIL PROTECTED]> escribi�: > On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> >> Suppose you have a whole lot of files, and you need to open each one, >> append a string, then close them. There's two obvious

Windows - remote system window text

2008-02-04 Thread rdahlstrom
OK - I know how to get the text/title of the windows on a local system by using the window handle. What I want to do is to get the text/ title of the windows on a remote system. Enumerating the window handles will of course not work remotely, I know that. Does anyone know anything short of a cli

Re: Unexpected timing results with file I/O

2008-02-04 Thread rdahlstrom
On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > After reading an earlier thread about opening and closing lots of files, > I thought I'd do a little experiment. > > Suppose you have a whole lot of files, and you need to open each one, > append a string, then clos

Re: Python-URL! - weekly Python news and links (Feb 4)

2008-02-04 Thread Arnaud Delobelle
On Feb 4, 4:24 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > "It's a very good idea to read the entire FAQ as soon as you've gotten past > the very basic Python level, so that you can save yourself and others a lot > of time stumbling over the traditional problems that everyone goes through.

Client side GUI-like web framework ?

2008-02-04 Thread USCode
Wouldn't it be handy if there was a web framework that allowed you to create pages and control the interface like you would using a client-side GUI framework such as Tkinter? The framework would need a small, fast web server that would automatically fire up when you ran your application and you

Re: Python GUI toolkit

2008-02-04 Thread Chris Mellon
On Feb 4, 2008 10:46 AM, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > > > > I didn't say inherently unable, I said the toolkit doesn't provide it. > > Note that you said that you did a lot of work to follow OS X > > conventions and implement behavior. The toolkit doesn't help y

Pydev 1.3.13 Released

2008-02-04 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.13 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: [2.4.2/Linux] Getting Python to fork?

2008-02-04 Thread Jon Ribbens
On 2008-02-04, Christian Heimes <[EMAIL PROTECTED]> wrote: > Jon Ribbens wrote: >> Why? I don't think you do. >> Neither does BSD daemon.c or glibc daemon.c > > The problem is well documented at > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 OK I understand what is being said here

App idea, Any idea on implementation?

2008-02-04 Thread Dr Mephesto
Hi Guru's, As a python newb, I was thinking about trying to implement a program that converts whistled music into midi; the idea coming from a proposed application in the Mydreamapp competition hosted last year, more details here: http://stratfordisland.com/whistler/ So, does anyone have a sugge

Re: Smart Debugger (Python)

2008-02-04 Thread kraman
On Feb 3, 3:55 pm, Norm Matloff <[EMAIL PROTECTED]> wrote: > I have something of an obsession with debuggers, so I was glad to see > this posting. While we're on the subject, I might as well add my own > small contribution, which I call Xpdb. > > Xpdb is available athttp://heather.cs.ucdavis.edu/~

Re: Project naming suggestions?

2008-02-04 Thread Kay Schluehr
On Feb 3, 7:17 pm, [EMAIL PROTECTED] wrote: > I'm considering writing a little interpreter for a python-like > language and I'm looking for name suggestions. :-) > > Basically, I don't want to change a whole lot about Python. In fact, > I see myself starting with the compiler module from Python 2.

Re: Python feature request : operator for function composition

2008-02-04 Thread Kay Schluehr
This won't work for builtin functions. It hardly works for functions and methods defined in 3rd party modules and in no way for functions defined in C extensions. It adds boilerplate statically to remove it at runtime. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 15:17:18 +, Steven D'Aprano wrote: > # Method one: grouped by file. > for each file: > open the file, append the string, then close it > > > # Method two: grouped by procedure. > for each file: > open the file > for each open file: > append the string > for ea

Python-URL! - weekly Python news and links (Feb 4)

2008-02-04 Thread Gabriel Genellina
QOTW: "Everyone with a PC knows that eventually their computer will slow down, crash unexpectedly, and develop problems with applications." - promotional materials for award-winning *Degunking Windows* book "It's a very good idea to read the entire FAQ as soon as you've gotten past the very basic

Re: Too many open files

2008-02-04 Thread Gabriel Genellina
En Mon, 04 Feb 2008 12:50:15 -0200, Christian Heimes <[EMAIL PROTECTED]> escribi�: > Jeff wrote: >> Why don't you start around 50 threads at a time to do the file >> writes? Threads are effective for IO. You open the source file, >> start a queue, and start sending data sets to be written to t

Re: Elementary string-parsing

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 09:43:04 +, Odysseus wrote: > In article <[EMAIL PROTECTED]>, > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> def extract_data(names, na, cells): >> found = dict() > > The problem with initializing the 'super-dictionary' within this > function is that I w

Re: Pysqlite issue no attribute 'autocommit' RESOLVED

2008-02-04 Thread Andy Smith
Ok, simple fix... Updated to MySQL_python-1.2.2 and all ok now! :D - Original Message - From: Andy Smith To: python-list@python.org Sent: Monday, February 04, 2008 3:45 PM Subject: Pysqlite issue no attribute 'autocommit' Hi there, Im trying to run a Python based pro

Re: Python GUI toolkit

2008-02-04 Thread Kevin Walzer
Chris Mellon wrote: > > I didn't say inherently unable, I said the toolkit doesn't provide it. > Note that you said that you did a lot of work to follow OS X > conventions and implement behavior. The toolkit doesn't help you with > any of this. A mac-native toolkit (or one that strives for native

Re: [2.4.2/Linux] Getting Python to fork?

2008-02-04 Thread Jon Ribbens
On 2008-02-04, Rolf van de Krol <[EMAIL PROTECTED]> wrote: > To create a deamon, you indeed need to fork two times. For more > information and a working example see: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 . I'm > quite sure this works, because I used it several times to

Re: Python feature request : operator for function composition

2008-02-04 Thread Dustan
On Feb 4, 10:11 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > This is nice. Thanks. > * I wouldn't choose '&' as the composing operator as when I read > 'double & square' I think 'take an x, double it & square it' which is > the wrong interpretation (perhaps << instead?). A very good point t

Re: PyOpenGL

2008-02-04 Thread Mike C. Fletcher
[EMAIL PROTECTED] wrote: > Hi all, > > I apologize if this question was already answered before but I was > unable to find a proper solution to my problem. Anyways, I am trying > to run shaderobjects.py on Windows (Python 2.5.1) by just double- > clicking, and I got the following error: > > [...] >

Re: Is it explicitly specified?

2008-02-04 Thread George Sakkis
On Feb 4, 6:53 am, André Malo <[EMAIL PROTECTED]> wrote: > * Steven D'Aprano wrote: > > On Sun, 03 Feb 2008 15:31:49 -0800, Paul Boddie wrote: > > >> I don't know whether I can offer much better advice than others, but I > >> have noticed that a lot of my own code has moved in the direction of not

Re: Elementary string-parsing

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 12:25:24 +, Odysseus wrote: > I'm not clear on what makes an object global, other than appearing as an > operand of a "global" statement, which I don't use anywhere. But "na" is > assigned its value in the program body, not within any function: does > that make it global

Re: Too many open files

2008-02-04 Thread Gary Herron
AMD wrote: > Hello, > > I need to split a very big file (10 gigabytes) into several thousand > smaller files according to a hash algorithm, I do this one line at a > time. The problem I have is that opening a file using append, writing > the line and closing the file is very time consuming. I'd

Re: Python GUI toolkit

2008-02-04 Thread Chris Mellon
On Feb 4, 2008 9:57 AM, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > > Nitpick, but an important one. It emulates *look*. Not feel. Native > > look is easy and totally insufficient for a "native" app - it's the > > feel that's important. > > Is this opinion based on firsthand e

Re: Python feature request : operator for function composition

2008-02-04 Thread Arnaud Delobelle
On Feb 4, 3:00 pm, Dustan <[EMAIL PROTECTED]> wrote: > On Feb 2, 11:09 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > [snip] > > While you're waiting for it to be implemented, you can build your own > version as a decorator. Here's an example written in haste: > > >>> class composer(object): > >

Re: Unexpected timing results with file I/O

2008-02-04 Thread Christian Heimes
Steven D'Aprano wrote: > So, what's going on? Can anyone explain why the code which does more work > takes less time? Short answer: CPU and RAM are much faster than hard disks. The three loops and the creation of a list costs only a few CPU cycles compared to flushing the new data to disk. Chri

Re: Too many open files

2008-02-04 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 04 Feb 2008 13:57:39 +0100, AMD wrote: > >> The problem I have under windows is that as soon as I get to 500 files I >> get the Too many open files message. I tried the same thing in Delphi >> and I can get to 3000 files. How can I increase the

Re: Python GUI toolkit

2008-02-04 Thread Kevin Walzer
Chris Mellon wrote: > Nitpick, but an important one. It emulates *look*. Not feel. Native > look is easy and totally insufficient for a "native" app - it's the > feel that's important. Is this opinion based on firsthand experience with use of the Tile/ttk widgets on any of the relevant platforms

Re: Terse Syntax through External Methods

2008-02-04 Thread aggergren
On Jan 29, 11:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jens schrieb: > > > > > On Jan 25, 3:19 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> Jens schrieb: > > >>> Hello Everyone > >>> I'm newbie toZopeand i have a few questions regarding external > >>> methods. What i wan't t

Re: [2.4.2/Linux] Getting Python to fork?

2008-02-04 Thread Rolf van de Krol
To create a deamon, you indeed need to fork two times. For more information and a working example see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 . I'm quite sure this works, because I used it several times to create a deamon. Jon Ribbens wrote: > On 2008-02-04, Christian H

  1   2   >