Re: [python-cffi] Fwd: Re: Progress migrating cffi and pycparser to libclang

2018-01-06 Thread Eli Bendersky
ase which remembers for each file what the exact flags to compile it are (https://clang.llvm.org/docs/JSONCompilationDatabase.html) To make this *really* work for CFFI you'd have to take all of this into account -- do you really want to deal with this on the CFFI level? Eli > >

Re: Re: Progress migrating cffi and pycparser to libclang

2018-01-05 Thread Armin Rigo
Hi Etienne, On 5 January 2018 at 10:15, Etienne Robillard wrote: > Forwarding this thread to the CFFI developers... > If you're asking whether we could add libclang as a dependency to CFFI, the answer is no, sorry. I feel that I've already explained exactly this to you several times in private

Fwd: Re: Progress migrating cffi and pycparser to libclang

2018-01-05 Thread Etienne Robillard
Forwarding  this thread to the CFFI developers... Re Paul: Thanks for your feedback. My intended audience are developers who can use hg to fetch/build source code without pip. Best regards, Etienne Message transféré Sujet : Re: Progress migrating cffi and

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
On 4 January 2018 at 21:02, Etienne Robillard wrote: >> As a fork/extension for cffi, I have no particular opinion (I'm >> unlikely to ever use it). But the advantage of pycparser is that it's >> cross-platform and pure Python, so I doubt this will be acceptable for >> inclusion into CFFI itself.

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Etienne Robillard
Hi Paul, Le 2018-01-04 à 06:41, Paul Moore a écrit : Presumably that will introduce a dependency on some clang module? You mention clang.cindex - but the only clang package I can find on PyPI says "OBSOLETE. LLVM-CLANG NOW PUBLISHES PYTHON PACKAGE. JUST ADD THE OFFICIAL llvm-3.7 repo in your ap

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
On 4 January 2018 at 09:50, Etienne Robillard wrote: > Hi, > > I will be creating a repository for this: > https://bitbucket.org/tkadm30/cffi-libclang > > The goal is to generate a AST object from a C header by preprocessing with > clang -E then compile the python bindings with CFFI... > > ffi.cde

Re: Progress on the Gilectomy

2018-01-03 Thread harindudilshan95
Why not make the garbage collector check the reference count before freeing objects? Only c extensions would increment the ref count while python code would just use garbage collector making ref count = 0. That way even the existing c extensions would continue to work. Regarding to Java using

Re: Progress on the Gilectomy

2017-06-23 Thread Ethan Furman
On 06/22/2017 10:26 PM, Rustom Mody wrote: Lawrence d'Oliveiro was banned on 30th Sept 2016 till end-of-year https://mail.python.org/pipermail/python-list/2016-September/714725.html Is there still a ban? My apologies to Lawrence, I completely forgot. The ban is now lifted. -- ~Ethan~ -- htt

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-23 Thread Marko Rauhamaa
Gregory Ewing : > Lawrence D’Oliveiro wrote: >> what WOULD you consider to be so “representative”? > > I don't claim any of them to be representative. Different GC > strategies have different characteristics. My experiences with Hotspot were a bit disheartening. GC is a winning concept provided t

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-23 Thread Gregory Ewing
Lawrence D’Oliveiro wrote: what WOULD you consider to be so “representative”? I don't claim any of them to be representative. Different GC strategies have different characteristics. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Progress on the Gilectomy

2017-06-22 Thread Gregory Ewing
Marko Rauhamaa wrote: And, BTW, my rule of thumb came from experiences with the Hotspot JRE. I wouldn't take a Java implementation to be representative of the behaviour of GC systems in general. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Progress on the Gilectomy

2017-06-22 Thread Rustom Mody
On Thursday, June 22, 2017 at 4:28:03 AM UTC+5:30, Steve D'Aprano wrote: > On Thu, 22 Jun 2017 08:23 am, breamoreboy wrote: > > > Don't you know that Lawrence D’Oliveiro has been banned from the mailing > > list > > as he hasn't got a clue what he's talking about, > > That's not why he was give

Re: Progress on the Gilectomy

2017-06-22 Thread Steve D'Aprano
On Fri, 23 Jun 2017 01:07 am, [email protected] wrote: > 11 comments on the thread "Instagram: 40% Py3 to 99% Py3 in 10 months" showing > that he knows as much about Unicode as LDO knows about garabge collection. Who cares? Every time he opens his mouth to write absolute rubbish he just make

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-22 Thread CFK
On Jun 22, 2017 4:03 PM, "Chris Angelico" wrote: On Fri, Jun 23, 2017 at 5:22 AM, CFK wrote: > On Jun 22, 2017 9:32 AM, "Chris Angelico" wrote: > > On Thu, Jun 22, 2017 at 11:24 PM, CFK wrote: >> When >> I draw memory usage graphs, I see sawtooth waves to the memory usage which >> suggest that

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-22 Thread Chris Angelico
On Fri, Jun 23, 2017 at 5:22 AM, CFK wrote: > On Jun 22, 2017 9:32 AM, "Chris Angelico" wrote: > > On Thu, Jun 22, 2017 at 11:24 PM, CFK wrote: >> When >> I draw memory usage graphs, I see sawtooth waves to the memory usage which >> suggest that the garbage builds up until the GC kicks in and re

Re: Progress on the Gilectomy

2017-06-22 Thread Ned Batchelder
On Thursday, June 22, 2017 at 11:07:36 AM UTC-4, [email protected] wrote: > On Wednesday, June 21, 2017 at 11:58:03 PM UTC+1, Steve D'Aprano wrote: > > On Thu, 22 Jun 2017 08:23 am, breamoreboy wrote: > > > > > Don't you know that Lawrence D’Oliveiro has been banned from the mailing > > > list >

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-22 Thread CFK
On Jun 22, 2017 9:32 AM, "Chris Angelico" wrote: On Thu, Jun 22, 2017 at 11:24 PM, CFK wrote: > When > I draw memory usage graphs, I see sawtooth waves to the memory usage which > suggest that the garbage builds up until the GC kicks in and reaps the > garbage. Interesting. How do you actually

Re: Progress on the Gilectomy

2017-06-22 Thread Chris Angelico
On Fri, Jun 23, 2017 at 1:48 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> not "aim for 400MB because the garbage collector is only 10% >> efficient". Get yourself a better garbage collector. Employ Veolia or >> something. > > It's about giving GC room (space- and timewise) to operate. Also, y

Re: Progress on the Gilectomy

2017-06-22 Thread Marko Rauhamaa
Marko Rauhamaa : > Chris Angelico : > >> not "aim for 400MB because the garbage collector is only 10% >> efficient". Get yourself a better garbage collector. Employ Veolia or >> something. > > It's about giving GC room (space- and timewise) to operate. Also, you > don't want your memory consumptio

Re: Progress on the Gilectomy

2017-06-22 Thread Marko Rauhamaa
Chris Angelico : > not "aim for 400MB because the garbage collector is only 10% > efficient". Get yourself a better garbage collector. Employ Veolia or > something. It's about giving GC room (space- and timewise) to operate. Also, you don't want your memory consumption to hit the RAM ceiling even

Re: Progress on the Gilectomy

2017-06-22 Thread Chris Angelico
On Thu, Jun 22, 2017 at 11:27 PM, Marko Rauhamaa wrote: > CFK : > >> Yes, and this is why I suspect CPython would work well too. My usage >> pattern may be similar to Python usage patterns. The only way to know for >> sure is to try it and see what happens. > > I have a rule of thumb that your ap

Re: Progress on the Gilectomy

2017-06-22 Thread Marko Rauhamaa
CFK : > Yes, and this is why I suspect CPython would work well too. My usage > pattern may be similar to Python usage patterns. The only way to know for > sure is to try it and see what happens. I have a rule of thumb that your application should not need more than 10% of the available RAM. If y

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-22 Thread Chris Angelico
On Thu, Jun 22, 2017 at 11:24 PM, CFK wrote: > When > I draw memory usage graphs, I see sawtooth waves to the memory usage which > suggest that the garbage builds up until the GC kicks in and reaps the > garbage. Interesting. How do you actually measure this memory usage? Often, when a GC frees u

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-22 Thread CFK
On Jun 22, 2017 12:38 AM, "Paul Rubin" wrote: Lawrence D’Oliveiro writes: > while “memory footprint” depends on how much memory is actually being > retained in accessible objects. If the object won't be re-accessed but is still retained by gc, then refcounting won't free it either. > Once agai

Re: Progress on the Gilectomy

2017-06-22 Thread CFK
On Jun 21, 2017 1:38 AM, "Paul Rubin" wrote: Cem Karan writes: > I'm not too sure how much of performance impact that will have. My > code generates a very large number of tiny, short-lived objects at a > fairly high rate of speed throughout its lifetime. At least in the > last iteration of th

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-21 Thread Paul Rubin
Lawrence D’Oliveiro writes: > while “memory footprint” depends on how much memory is actually being > retained in accessible objects. If the object won't be re-accessed but is still retained by gc, then refcounting won't free it either. > Once again: The trouble with GC is, it doesn’t know when

Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-21 Thread Steve D'Aprano
On Thu, 22 Jun 2017 10:30 am, Lawrence D’Oliveiro wrote: > Once again: The trouble with GC is, it doesn’t know when to kick in: it just > keeps on allocating memory until it runs out. Once again: no it doesn't. Are you aware that CPython has a GC? (Or rather, a *second* GC, apart from the refer

Re: Progress on the Gilectomy

2017-06-21 Thread Steve D'Aprano
On Thu, 22 Jun 2017 08:23 am, [email protected] wrote: > Don't you know that Lawrence D’Oliveiro has been banned from the mailing list > as he hasn't got a clue what he's talking about, That's not why he was given a ban. Being ignorant is not a crime -- if it were, a lot more of us would be

Re: Progress on the Gilectomy

2017-06-21 Thread Paul Rubin
Lawrence D’Oliveiro writes: > The trouble with GC is, it doesn’t know when to kick in: it just keeps > on allocating memory until it runs out. That's not how GC works, geez. Typically it would run after every N bytes of memory allocated, for N chosen to balance memory footprint with cpu overhead

Re: Progress on the Gilectomy

2017-06-20 Thread Marko Rauhamaa
Paul Rubin : > How it works (i.e. what the implementation does) is quite simple and > understandable. The amazing thing is that it doesn't leak memory > catastrophically. If I understand it correctly, the 32-bit Go language runtime implementation suffered "catastrophically" at one point. The reas

Re: Progress on the Gilectomy

2017-06-20 Thread Paul Rubin
Cem Karan writes: > I'm not too sure how much of performance impact that will have. My > code generates a very large number of tiny, short-lived objects at a > fairly high rate of speed throughout its lifetime. At least in the > last iteration of the code, garbage collection consumed less than 1

Re: Progress on the Gilectomy

2017-06-20 Thread Cem Karan
On Jun 20, 2017, at 1:19 AM, Paul Rubin wrote: > Cem Karan writes: >> Can you give examples of how it's not reliable? > > Basically there's a chance of it leaking memory by mistaking a data word > for a pointer. This is unlikely to happen by accident and usually > inconsequential if it does ha

Re: Progress on the Gilectomy

2017-06-20 Thread Marko Rauhamaa
Paul Rubin : > The simplest way to start experimenting with GC in Python might be to > redefine the refcount macros to do nothing, connect the allocator to > the Boehm GC, and stop all the threads when GC time comes. I don't > know if Guile has threads at all, but I know it uses the Boehm GC and >

Re: Progress on the Gilectomy

2017-06-19 Thread Paul Rubin
Cem Karan writes: > Can you give examples of how it's not reliable? Basically there's a chance of it leaking memory by mistaking a data word for a pointer. This is unlikely to happen by accident and usually inconsequential if it does happen, but maybe there could be malicious data that makes it

Re: Progress on the Gilectomy

2017-06-19 Thread Paul Rubin
Chris Angelico writes: > Or let's look at it a different way. Instead of using a PyObject* in C > code, you could write C++ code that uses a trivial wrapper class that > holds the pointer, increments its refcount on construction, and > decrements that refcount on destruction. That's the C++ STL s

Re: Progress on the Gilectomy

2017-06-19 Thread Chris Angelico
On Tue, Jun 20, 2017 at 1:52 PM, Rustom Mody wrote: > Saw this this morning > https://medium.com/@alexdixon/functional-programming-in-javascript-is-an-antipattern-58526819f21e > > May seem irrelevant to this, but if JS, FP is replaced by Python, GC it > becomes > more on topical https://rhetting

Re: Progress on the Gilectomy

2017-06-19 Thread Rustom Mody
On Tuesday, June 20, 2017 at 5:53:00 AM UTC+5:30, Cem Karan wrote: > On Jun 19, 2017, at 6:19 PM, Gregory Ewing wrote: > > > Ethan Furman wrote: > >> Let me ask a different question: How much effort is required at the C > >> level when using tracing garbage collection? > > > > That depends on t

Re: Progress on the Gilectomy

2017-06-19 Thread Cem Karan
On Jun 19, 2017, at 6:19 PM, Gregory Ewing wrote: > Ethan Furman wrote: >> Let me ask a different question: How much effort is required at the C level >> when using tracing garbage collection? > > That depends on the details of the GC implementation, but often > you end up swapping one form o

Re: Progress on the Gilectomy

2017-06-19 Thread Gregory Ewing
Ethan Furman wrote: Let me ask a different question: How much effort is required at the C level when using tracing garbage collection? That depends on the details of the GC implementation, but often you end up swapping one form of boilerplate (maintaining ref counts) for another (such as makin

Re: Progress on the Gilectomy

2017-06-19 Thread Chris Angelico
On Tue, Jun 20, 2017 at 1:44 AM, Skip Montanaro wrote: > On Mon, Jun 19, 2017 at 10:20 AM, Ethan Furman wrote: > >> Programming at the C level is not working in Python, and many Python >> niceties simply don't exist there. > > > True, but a lot of functionality available to Python programmers exi

Re: Progress on the Gilectomy

2017-06-19 Thread Ethan Furman
On 06/19/2017 08:44 AM, Skip Montanaro wrote: On Mon, Jun 19, 2017 at 10:20 AM, Ethan Furman wrote: Programming at the C level is not working in Python, and many Python niceties simply don't exist there. True, but a lot of functionality available to Python programmers exists at the extensi

Re: Progress on the Gilectomy

2017-06-19 Thread Skip Montanaro
On Mon, Jun 19, 2017 at 10:20 AM, Ethan Furman wrote: > Programming at the C level is not working in Python, and many Python > niceties simply don't exist there. True, but a lot of functionality available to Python programmers exists at the extension module level, whether delivered as part of t

Re: Progress on the Gilectomy

2017-06-19 Thread Ethan Furman
On 06/19/2017 08:06 AM, Skip Montanaro wrote: On Mon, Jun 19, 2017 at 9:20 AM, Ethan Furman wrote: Reference counting is a valid garbage collecting mechanism, therefore Python is also a GC language. Garbage collection is usually thought of as a way to remove responsibility for tracking of

Re: Progress on the Gilectomy

2017-06-19 Thread Skip Montanaro
On Mon, Jun 19, 2017 at 9:20 AM, Ethan Furman wrote: > Reference counting is a valid garbage collecting mechanism, therefore > Python is also a GC language. Garbage collection is usually thought of as a way to remove responsibility for tracking of live data from the user. Reference counting doe

Re: Progress on the Gilectomy

2017-06-19 Thread Rustom Mody
On Monday, June 19, 2017 at 7:40:49 PM UTC+5:30, Robin Becker wrote: > On 19/06/2017 01:20, Paul Rubin wrote: > ... > > the existing C API quite seriously. Reworking the C modules in the > > stdlib would be a large but not impossible undertaking. The many > > external C modules out there woul

Re: Progress on the Gilectomy

2017-06-19 Thread Ethan Furman
On 06/19/2017 07:10 AM, Robin Becker wrote: I have always found the management of reference counts to be one of the hardest things about the C api. I'm not sure exactly how C extensions would/should interact with a GC python. There seem to be different approaches eg lua & go are both GC langu

Re: Progress on the Gilectomy

2017-06-19 Thread Robin Becker
On 19/06/2017 01:20, Paul Rubin wrote: ... the existing C API quite seriously. Reworking the C modules in the stdlib would be a large but not impossible undertaking. The many external C modules out there would be more of an issue. I have always found the management of reference counts to b

Re: Progress on the Gilectomy

2017-06-18 Thread Paul Rubin
I always thought the GIL removal obstacle was the need to put locks around every refcount adjustment, and the only real cure for that is to use a tracing GC. That is a good idea in many ways, but it would break the existing C API quite seriously. Reworking the C modules in the stdlib would be a l

Re: Progress on the Gilectomy

2017-06-13 Thread Skip Montanaro
On Tue, Jun 13, 2017 at 1:53 PM, Terry Reedy wrote: > This was tried at least once, perhaps 15 years ago. Yes, I believe Greg Smith (?) implemented a proof-of-concept in about the Python 1.4 timeframe. The observation at the time was that it slowed down single-threaded programs too much to be a

Re: Progress on the Gilectomy

2017-06-13 Thread Terry Reedy
On 6/13/2017 12:09 PM, Robin Becker wrote: On 11/06/2017 07:27, Steve D'Aprano wrote: I'm tired of people complaining about the GIL as a "mistake" without acknowledging that it exists for a reason. I thought we were also consenting adults about problems arising from bad extensions. T

Re: Progress on the Gilectomy

2017-06-13 Thread Skip Montanaro
On Tue, Jun 13, 2017 at 11:09 AM, Robin Becker wrote: > I looked at Larry's talk with interest. The GIL is not a requirement as he > pointed out at the end, both IronPython and Jython don't need it. But they don't support CPython's extension module API either, I don't think. (I imagine that mig

Re: Progress on the Gilectomy

2017-06-13 Thread Robin Becker
On 11/06/2017 07:27, Steve D'Aprano wrote: I'm tired of people complaining about the GIL as a "mistake" without acknowledging that it exists for a reason. I thought we were also consenting adults about problems arising from bad extensions. The GIL is a blocker for cpython's ability

Re: Progress on the Gilectomy

2017-06-10 Thread Steve D'Aprano
On Sun, 11 Jun 2017 04:21 pm, Stefan Behnel wrote: > Serhiy Storchaka schrieb am 11.06.2017 um 07:11: >> And also GIL is used for guaranteeing atomicity of many operations and >> consistencity of internal structures without using additional locks. Many >> parts of the core and the stdlib would j

Re: Progress on the Gilectomy

2017-06-10 Thread Stefan Behnel
Serhiy Storchaka schrieb am 11.06.2017 um 07:11: > 10.06.17 15:54, Steve D'Aprano пише: >> Larry Hastings is working on removing the GIL from CPython: >> >> https://lwn.net/Articles/723949/ >> >> For those who don't know the background: >> >> - The GIL (Global Interpreter Lock) is used to ensure th

Re: Progress on the Gilectomy

2017-06-10 Thread Serhiy Storchaka
10.06.17 15:54, Steve D'Aprano пише: Larry Hastings is working on removing the GIL from CPython: https://lwn.net/Articles/723949/ For those who don't know the background: - The GIL (Global Interpreter Lock) is used to ensure that only one piece of code can update references to an object at a

Re: Progress on the Gilectomy

2017-06-10 Thread Irmen de Jong
On 10-6-2017 14:54, Steve D'Aprano wrote: > Larry Hastings is working on removing the GIL from CPython: > > https://lwn.net/Articles/723949/ Here is Larry's "How's it going" presentation from Pycon 2017 on this subject https://www.youtube.com/watch?v=pLqv11ScGsQ -irmen -- https://mail.python.o

Re: progress bar

2015-02-25 Thread Denis McMahon
On Tue, 24 Feb 2015 23:42:42 -0800, Swapnil Pande wrote: > i want to call another tkinter window after completing the progress bar > an n e one help me Try shouting "Oi, Window!" Or show us the code that isn't working (just the bit that isn't working) and explain what it should be doing and wha

Re: progress bar

2015-02-25 Thread Steven D'Aprano
Swapnil Pande wrote: > i want to call another tkinter window after completing the progress bar > an n e one help me What does "call another tkinter window" mean? I understand "call another function", but how do you call a window? Perhaps it will help if you show us some code. -- Steven --

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-25 Thread Ross Ridge
Luke Kenneth Casson Leighton wrote: >this is a progress report on compiling python using entirely free >software tools, no proprietary compilers or operating systems >involved, yet still linking and successfully running with msvcr80 >assemblies. MSVCR80.DLL is part of the Microsoft Visual C++ ru

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-25 Thread Luke Kenneth Casson Leighton
> Have you made some benchmarks like pystone? > Cheers, > Cesare Cesare, hi, thanks for responding: unfortunately, there's absolutely no point in making any benchmark figures under an emulated environment which does things like take 2 billion instruction cycles to start up a program named "c:/msy

Re: About SCons Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-24 Thread anatoly techtonik
On Sat, Jan 24, 2009 at 12:28 AM, Roumen Petrov >> >> I would better use SCons for both unix and windows builds. In case of >> windows for both compilers - mingw and microsoft ones. To port curses >> extension to windows I need to know what gcc options mean, what are >> the rules to write Makefiles

Re: About SCons Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-23 Thread Roumen Petrov
anatoly techtonik wrote: On Thu, Jan 22, 2009 at 12:51 AM, Roumen Petrov wrote: Against 2.3, rejected due to dependence on SCons. Also appears to have been incomplete, needing more work. No it was complete but use SCons. Most of changes changes in code you will see again in 3871. I would be

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-21 Thread Roumen Petrov
Terry Reedy wrote: Luke Kenneth Casson Leighton wrote: i look forward to seeing the same incremental improvement applied to the development of python, evidence of which would be clearly seen by the acceptance of one of the following patches, one of which is dated 2003: http://bugs.python.org

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-21 Thread Terry Reedy
Luke Kenneth Casson Leighton wrote: i look forward to seeing the same incremental improvement applied to the development of python, evidence of which would be clearly seen by the acceptance of one of the following patches, one of which is dated 2003: http://bugs.python.org/issue841454 Again

Re: progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-21 Thread Luke Kenneth Casson Leighton
> http://bugs.python.org/issue5010 correction: that's http://bugs.python.org/issue5026 apologies for the mix-up. also,for the msvcrt80 build, it is _essential_ that you use a patched version of mingw32-runtime, see: https://sourceforge.net/tracker/index.php?func=detail&aid=2134161&group_id=2435&a

Re: progress indicator in a mod_python script

2007-05-18 Thread Larry Bates
Rajarshi wrote: > Hi, I have a web application built using mod_python.Currently it > behaves like a standard CGI - gets data from a form, performs a query > on a backend database and presents a HTML page. > > However the query can sometimes take a bit of time and I'd like to > show the user some f

Re: progress indicator in a mod_python script

2007-05-17 Thread Josh Bloom
Hi Rajarshi, What you probably want to do is break this into multiple parts. When a request comes in to perform a query consider this a new job, give it an ID and set it off and running. Then return an HTML page that knows to keep checking a status URL (based on the ID) every few seconds to see

Re: progress

2007-05-05 Thread half . italian
On May 5, 1:46 am, Merrigan <[EMAIL PROTECTED]> wrote: > Hi All, > > I have posted yesterday about an ftplib issue, this has been resolved. > > I actually want to ask something here... > > The script that that ftplib error was from...I was wondering - What do > I need to do to print the stats (spee

Re: Progress when parsing a large file with SAX

2007-02-12 Thread marc . omorain
On Feb 12, 1:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Anastasios Hatzis wrote: > > Diez B. Roggisch wrote: Thanks guys! I'll try it out later today and let you know how I get on. -- http://mail.python.org/mailman/listinfo/python-list

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Diez B. Roggisch
Anastasios Hatzis wrote: > Diez B. Roggisch wrote: > > ... > > I got the same problem with large XML as Marc. > > So you deserve also my thanks for the example. :-) > >> class PercentageFile(object): >> >>def __init__(self, filename): >>self.size = os.stat(filename)[6] >>s

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Anastasios Hatzis
Diez B. Roggisch wrote: ... I got the same problem with large XML as Marc. So you deserve also my thanks for the example. :-) > class PercentageFile(object): > >def __init__(self, filename): >self.size = os.stat(filename)[6] >self.delivered = 0 >self.f = file(filena

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi there, > > I have a 28mb XML file which I parse with SAX. I have some processing > to do in the startElement / endElement callbacks, which slows the > parsing down to about 60 seconds on my machine. > > My application is unresponsive for this time, so I would like t

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread James Thiele
if you invoke python with the -u option the output of print is unbuffered. On Jan 11, 7:04 am, Tommy Grav <[EMAIL PROTECTED]> wrote: > This certainly does work when running the interpreter interactively, > but when inserted into a script it seems to buffer the print statement > and not write it ou

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread reed
> > for i in range(100): > > sys.stdout.write( "\r" + "count ", i,) >> sys.stdout.flush() > > print # done maybe Tommy Grav wrote: > This certainly does work when running the interpreter interactively, > but when inserted into a script it seems to buffer the

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread Tommy Grav
This certainly does work when running the interpreter interactively, but when inserted into a script it seems to buffer the print statement and not write it out to the terminal. How can I force the print statement to not buffer the output? Cheers Tommy On Jan 11, 2007, at 9:22 AM, Fredrik L

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread Fredrik Lundh
Tommy Grav <[EMAIL PROTECTED]>: >I have a program that does a lot of iterations and would like > to follow its progress by having it print out the current iteration > number as it progresses. How do I do this so that it appears > like a counter that increases in the same place in the terminal > wi

Re: Progress Box or Bar in Windows

2006-12-31 Thread tubby
cyberco wrote: > Go for wxPython, it'll fulfill all your GUI needs. Handsdown the best > GUI toolkit I ever ran into. Thanks a lot! I had no idea wxPython was so easy to use. I added a progress bar from wx to the app. Less than 20 lines of code and it only took about 5 minutes! -- http://mail.p

Re: Progress Box or Bar in Windows

2006-12-31 Thread cyberco
Go for wxPython, it'll fulfill all your GUI needs. Handsdown the best GUI toolkit I ever ran into. It can't get much simpler than: wx.MessageBox('hi') And there are tons of readymade dialogs and progressbars in the library. Check out the demo.py under the wxPython installation dir to see demos (a

Re: Progress Box or Bar in Windows

2006-12-31 Thread dkinakin
Not that I want to suggest a completely different solution; however, I have used: http://www.averdevelopment.com/python/EasyDialogs.html to add simple file open dialogs, message boxes, and progress bars to many of my scripts. You may want to have a look at it. It's easy to install and really sim

Re: Progress Bars in python

2006-07-12 Thread Larry Bates
Hari Sekhon wrote: > Hi, > I've written a script which backs up a huge bunch of files, but I > don't want the script to output the file names as it does this as it > clutters the screen, I only output errors. > > So in order to see that the script is working and not stuck, I'd like to > implemen

Re: Progress Bars in python

2006-07-12 Thread Hari Sekhon
On 12/07/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > If the output of the script is sent to a logfile, this tends to puke all> over the logfile... creating one additional entry per iteration, but it's a> good start and I'll look at that link which looks very promising. there's no way to do this

Re: Progress Bars in python

2006-07-12 Thread skip
Hari> So in order to see that the script is working and not stuck, I'd Hari> like to implement some kind of progress bar or something, ... Here's mine: http://orca.mojam.com/~skip/python/progress.py There are both Progress and Counter classes. Same idea, different output. Skip --

Re: Progress Bars in python

2006-07-12 Thread Fredrik Lundh
Hari Sekhon wrote: > I've written a script which backs up a huge bunch of files, but I > don't want the script to output the file names as it does this as it > clutters the screen, I only output errors. > > So in order to see that the script is working and not stuck, I'd like to > implement some

Re: Progress bar in web-based ftp?

2006-05-09 Thread Larry Bates
CatDude wrote: > I've got an application that prompts the user to select a file from his > local computer, checks the user's selection, then sends the file via > enctype="multipart/form-data"> > > In the python code that receives the files I've got a section that does > the following: > >

Re: Progress Bar with urllib2

2005-04-26 Thread John A Ferguson
On Tue, 26 Apr 2005 20:28:43 GMT, Andrew Godwin wrote: > I'm trying to write a python script to download data (well, files) from a > HTTP server (well, a PHP script spitting them out, at least). > The file data is just the returned data from the request (the server script > echoes the file and t

Re: Progress Bar with urllib2

2005-04-26 Thread Trent Mick
> But some of these files are going to be really, really big, and I want > to get a progress bar going. I've tried doing a while loop like this: Here is a little snippet that I use occassionally: -- geturl.py --- import os import sys import urllib def _re