Re: MySQLDB - server has gone on blob insertion...

2010-06-03 Thread durumdara
Hi! No, there is no same program. I got this ref: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html I will try it. Thanks: dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Forum

2010-06-03 Thread News123
pyDev wrote: > Hello, > > I would like to let the community know that there is a new web-based > forum for Python enthusiasts over at PythonForum.org (http:// > pythonforum.org). Web-based forums is a preferred method by Python > newcomers to get help in exploring the world of Python and programmi

Re: Python Forum

2010-06-03 Thread Ben Finney
News123 writes: > However, whether we like it or not: > Fewer and fewer newcomers are willing, knowledgable, aware of nntp If so, isn't that an indication that better education about the benefits is required? Perhaps in combination with improving the tool support for the NNTP protocol? > If you

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
On Thu, 2010-06-03 at 09:52 +0200, News123 wrote: > > I would like to let the community know that there is a new web-based > > forum for Python enthusiasts over at PythonForum.org (http:// > > pythonforum.org). Web-based forums is a preferred method by Python > > newcomers to get help in exploring

Re: Python Forum

2010-06-03 Thread Pierre Quentel
On 3 juin, 10:57, Ben Finney wrote: > News123 writes: > > However, whether we like it or not: > > Fewer and fewer newcomers are willing, knowledgable, aware of nntp > > If so, isn't that an indication that better education about the benefits > is required? Perhaps in combination with improving th

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 11:16, Pierre Quentel wrote: I'm not saying that pythonforum.org is the best solution but it certainly looks more attractive than c.l.p. to the new generation of Python users - Pierre On the other hand it might not be so bad that you don't get questions from users here who are un

CTYPES structure passing

2010-06-03 Thread Peter West
Hi I'm hoping someone here can tell me what I'm doing wrong as I've spent the best part of three days reading docs and trying code. I want to port a windows DLL that controls a USB camera to Python using C types. I've happily converted a lot of the functions but am stuck with one vital function

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
On Thu, 2010-06-03 at 03:16 -0700, Pierre Quentel wrote: > I agree that it's not efficient to split the community by creating > another forum. But we can't ignore the fact that c.l.p's activity has > been decreasing in the last years : > 200042971 > 200155265 > 200256774 > 200364521

Re: Python Forum

2010-06-03 Thread Ben Finney
Adam Tauno Williams writes: > So? NNTP is the living dead. Time to let it go. The capabilities of NNTP clients are much better than email for tracking threaded discussions in multiple forums. I'll let it go when something better comes along, and not before. > Most people use this list via e-m

Re: Python Forum

2010-06-03 Thread Paul Rudin
Adam Tauno Williams writes: > Most people use this list via e-mail... Do you know this to be the case, or is that a guess? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Forum

2010-06-03 Thread Michele Simionato
On Jun 3, 12:28 pm, "Martin P. Hellwig" wrote: > On the other hand it might not be so bad that you don't get questions > from users here who are unable to use a nntp reader or news to mail service. I am unable to use a nntp reader or news to mail service. I use the Google Groups interface and I a

Re: Python Forum

2010-06-03 Thread Paul Rudin
Michele Simionato writes: > On Jun 3, 12:28 pm, "Martin P. Hellwig" > wrote: >> On the other hand it might not be so bad that you don't get questions >> from users here who are unable to use a nntp reader or news to mail service. > > I am unable to use a nntp reader or news to mail service. I us

python2.6 atexit not working with programme using threads, but python 2.5 works

2010-06-03 Thread Alan
Hi there, I got a code here to investigate and one big issue is that it uses threads and have a cleanup function (that will halt the threads) called via atexit. That all work fine with python 2.5 but when using python 2.6, if I have threading running, atexit never calls my cleanup function. If ex

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 12:46, Michele Simionato wrote: On Jun 3, 12:28 pm, "Martin P. Hellwig" wrote: On the other hand it might not be so bad that you don't get questions from users here who are unable to use a nntp reader or news to mail service. I am unable to use a nntp reader or news to mail service

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
On Thu, 2010-06-03 at 12:35 +0100, Paul Rudin wrote: > Adam Tauno Williams writes: > > Most people use this list via e-mail... > Do you know this to be the case, or is that a guess? Scan through a bunch of threads with show-headers. Watch the User-Agent value (set by the senders client). The re

Re: Python Forum

2010-06-03 Thread Tim Chase
On 06/03/2010 07:16 AM, Adam Tauno Williams wrote: Most people use this list via e-mail... Do you know this to be the case, or is that a guess? Scan through a bunch of threads with show-headers. Watch the User-Agent value (set by the senders client). The results become obvious pretty quickly

Re: Python Forum

2010-06-03 Thread Paul Rudin
Adam Tauno Williams writes: > On Thu, 2010-06-03 at 12:35 +0100, Paul Rudin wrote: >> Adam Tauno Williams writes: >> > Most people use this list via e-mail... >> Do you know this to be the case, or is that a guess? > > Scan through a bunch of threads with show-headers. Watch the User-Agent > va

Another MySQL Question

2010-06-03 Thread Victor Subervi
Hi; I have this code: options = '' our_options = [] our_options_string = '' for op in ops: options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:]) our_options.append('%s' % form.getfirst('%s' % op)) our_options_string += '%s", "' % op cursor.execute(

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
On Thu, 2010-06-03 at 13:42 +0100, Paul Rudin wrote: > Adam Tauno Williams writes: > > On Thu, 2010-06-03 at 12:35 +0100, Paul Rudin wrote: > >> Adam Tauno Williams writes: > >> > Most people use this list via e-mail... > >> Do you know this to be the case, or is that a guess > > Scan through a b

How to efficiently work with gettext PO files when making small edits to large text values

2010-06-03 Thread python
Any one using the GNU gettext utilities to internationalize their python applications? I'm looking for tips and/or tools on how to efficiently work with gettext PO files when making small edits to large msgid values. Example: We have lots of multi-sentence/multi-paragraph messages that are stored

Re: Python Forum

2010-06-03 Thread Grant Edwards
On 2010-06-03, News123 wrote: > pyDev wrote: >> Hello, >> >> I would like to let the community know that there is a new web-based >> forum for Python enthusiasts over at PythonForum.org (http:// >> pythonforum.org). Web-based forums is a preferred method by Python >> newcomers to get help in expl

Re: Python Forum

2010-06-03 Thread Grant Edwards
On 2010-06-03, Martin P. Hellwig wrote: > On 06/03/10 12:46, Michele Simionato wrote: >> On Jun 3, 12:28 pm, "Martin P. Hellwig" >> wrote: >>> On the other hand it might not be so bad that you don't get questions >>> from users here who are unable to use a nntp reader or news to mail service. >> >

Re: Python Forum

2010-06-03 Thread Grant Edwards
On 2010-06-03, Adam Tauno Williams wrote: > On Thu, 2010-06-03 at 13:42 +0100, Paul Rudin wrote: >> Adam Tauno Williams writes: >> > On Thu, 2010-06-03 at 12:35 +0100, Paul Rudin wrote: >> >> Adam Tauno Williams writes: >> >> > Most people use this list via e-mail... >> >> Do you know this to be

Re: Python Forum

2010-06-03 Thread Andreas Waldenburger
On Thu, 3 Jun 2010 03:16:03 -0700 (PDT) Pierre Quentel wrote: > So the OP's initiative should be an incentive to think on the format > of the interaction between all the range of Python users, from newbees > to gurus. We are in the 2.0 era, with social networks all over the > place using a pleasa

Re: Python Forum

2010-06-03 Thread Lie Ryan
On 06/03/10 22:50, Adam Tauno Williams wrote: > On Thu, 2010-06-03 at 13:42 +0100, Paul Rudin wrote: >> Adam Tauno Williams writes: >>> On Thu, 2010-06-03 at 12:35 +0100, Paul Rudin wrote: Adam Tauno Williams writes: > Most people use this list via e-mail... Do you know this to be t

Re: Python Forum

2010-06-03 Thread Colin J. Williams
On 03-Jun-10 09:08 AM, Grant Edwards wrote: On 2010-06-03, News123 wrote: pyDev wrote: Hello, I would like to let the community know that there is a new web-based forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). Web-based forums is a preferred method by Python n

Re: Python Forum

2010-06-03 Thread Colin J. Williams
On 03-Jun-10 09:08 AM, Grant Edwards wrote: On 2010-06-03, News123 wrote: pyDev wrote: Hello, I would like to let the community know that there is a new web-based forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). Web-based forums is a preferred method by Python n

Re: Python Forum

2010-06-03 Thread Ben Finney
Andreas Waldenburger writes: > But consolidation is the *only* way to go, really. The parallelism > between c.l.p. and python-list is great already. Now throw some sort > of Forum in the mix This already *is* a forum. Whatever it is you think is needed, it's already a forum. Can you be more spec

[no subject]

2010-06-03 Thread Amit Sethi
Hi , I wish to execute some user submitted python code and have absolutely no other way out . I saw that there used to be a module called rexec which could define which modules can be imported and which cannot however exec doesn't have that kind of feature . Please if you could tell me what would

Gift 4 U

2010-06-03 Thread ekr3d
Do you want the safety of the computer ? * Take this gift * Advanced SystemCare Free 3.3.1 http://free-ekramy.blogspot.com ** Are you introduced to the 2010 Men's Fashion fashion-ekramy.blogspot.com/2010/04/man-fashion-week-z-zegna- spring-2010.html A

Simple hack to get $500 to your home.

2010-06-03 Thread money mania
Simple hack to get $500 to your home at http://uslatest.tk Due to high security risks,i have hidden the cheque link in an image. in that website on left side below search box, click on image and enter your name and address where you want to receive your cheque.please dont tell to anyone. -- http

SOAP with fancy HTTPS requirements

2010-06-03 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I need to implement the following: sending SOAP requests and receiving SOAP responses over HTTPS with - authentication based on client-certificates _and_ basic authorization - verification of the server cert The client cert is protected

Re:

2010-06-03 Thread Shashwat Anand
I have not much idea but Online Judges like SPOJ/codechef have regular programming-contests and python is one of allowed languages. So yes, it's possible. If I guess right, are you making an Online Judge for python. On Thu, Jun 3, 2010 at 8:39 PM, Amit Sethi wrote: > Hi , > > I wish to execute so

Windows and My Documents

2010-06-03 Thread Bob Greschke
I know this must have been asked before, but today Google is not my friend. How do I do a "listdir" (or whatever I need to use) of the Desktop on a Windows machine and have "folders" like My Documents show up in the result? I'm specifically trying to get a link to VMWare Shared Folders to sho

Re: Vote to Add Python Package "pubsub" to the Python Standard Library

2010-06-03 Thread Vinay Sajip
On Jun 2, 4:09 am, Carl Banks wrote: > I think it has a pretty good chance of being accepted, too.  The > publish-subscribe pattern, if you will, seems to have been implemented > separately in many places.  The logging module in the standard library > uses something like this. Only in a very gen

Re: Python Forum

2010-06-03 Thread Monte Milanuk
Adam Tauno Williams whitemice.org> writes: > > However, whether we like it or not: > > Fewer and fewer newcomers are willing, knowledgable, aware of nntp > > So? NNTP is the living dead. Time to let it go. > True. Decent NNTP access is harder to find. Not impossible, but no longer a 'free

Re: SOAP with fancy HTTPS requirements

2010-06-03 Thread exarkun
On 03:23 pm, li...@zopyx.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I need to implement the following: sending SOAP requests and receiving SOAP responses over HTTPS with - authentication based on client-certificates _and_ basic authorization - verification of the serve

Re: Windows and My Documents

2010-06-03 Thread Tim Golden
On 03/06/2010 16:39, Bob Greschke wrote: How do I do a "listdir" (or whatever I need to use) of the Desktop on a Windows machine and have "folders" like My Documents show up in the result? I'm specifically trying to get a link to VMWare Shared Folders to show up so I can navigate to files in OSX

Re: Another MySQL Question

2010-06-03 Thread MRAB
Victor Subervi wrote: Hi; I have this code: options = '' our_options = [] our_options_string = '' for op in ops: options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:]) our_options.append('%s' % form.getfirst('%s' % op)) our_options_string += '%s", "'

How to run a python script with a configuration file at command line ?

2010-06-03 Thread steph_awk
I have been searching for quite some times without success. I have a python script that needs to start from command line and it should have a config file to fill out the detais (itis one program, and many possible configurations). something as simple as PHP would be nice %> ./PHPscript -c config

Re: How to run a python script with a configuration file at command line ?

2010-06-03 Thread Andreas Jung
optparse is your friend. -aj 2010/6/3 steph_awk > I have been searching for quite some times without success. > > I have a python script that needs to start from command line and it > should have a config file to fill out the detais (itis one program, > and many possible configurations). > > s

What's a good XSL to translate xmlrunner.py output into a test report?

2010-06-03 Thread Phlip
Hypo Nt: Here's xmlrunner.py: http://www.rittau.org/python/xmlrunner.py you attach it to your developer tests, and it emits a file called "TEST-unittest.TestSuite.xml", containing auspicious wackiness like this: That looks just like the kind of stereotypical XML that XSL was designe

Re: How to run a python script with a configuration file at command line ?

2010-06-03 Thread Jean-Michel Pichavant
Andreas Jung wrote: optparse is your friend. -aj 2010/6/3 steph_awk > I have been searching for quite some times without success. I have a python script that needs to start from command line and it should have a config file to fill out the

Re: Windows and My Documents

2010-06-03 Thread Bob Greschke
On 2010-06-03 09:57:11 -0600, Tim Golden said: On 03/06/2010 16:39, Bob Greschke wrote: How do I do a "listdir" (or whatever I need to use) of the Desktop on a Windows machine and have "folders" like My Documents show up in the result? I'm specifically trying to get a link to VMWare Shared Fo

Re: Another MySQL Question

2010-06-03 Thread Victor Subervi
On Thu, Jun 3, 2010 at 12:25 PM, MRAB wrote: > So our_options is a list containing two values, which you're putting > into a tuple: > > >>> our_options = ["first", "second"] > >>> print len(our_options) > 2 > >>> value_tuple = (our_options,) > >>> print len(value_tuple) > 1 > >>> > > In other wo

Re: How to run a python script with a configuration file at command line ?

2010-06-03 Thread steph_py
On Jun 3, 12:50 pm, Jean-Michel Pichavant wrote: > Andreas Jung wrote: > > optparse > > > is your friend. > > > -aj > > > 2010/6/3 steph_awk > > > > >     I have been searching for quite some times without success. > > >     I have a python script that needs

Re: Embedding Python in a C extension

2010-06-03 Thread kai028
Thanks for the reply. I'm looking into the Global Interpreter Lock today. On Thu, 03 Jun 2010 01:07:39 +0100, MRAB wrote: >p...@mail.python.org wrote: >> I have a problem with embedding Python into a C extension in Windows >> Vista. I have implemented a timer routine in C as an extension, which

Re: Embedding Python in a C extension

2010-06-03 Thread kai028
Thanks for the reply. I'm checking this out today. On Wed, 2 Jun 2010 22:30:37 -0700 (PDT), Carl Banks wrote: >On Jun 2, 1:46 pm, Paul Grunau wrote: >> I have a problem with embedding Python into a C extension in Windows >> Vista. I have implemented a timer routine in C as an extension, which >>

sandboxing python code

2010-06-03 Thread Amit Sethi
On Thu, Jun 3, 2010 at 9:12 PM, Shashwat Anand wrote: > I have not much idea but Online Judges like SPOJ/codechef have regular > programming-contests and python is one of allowed languages. So yes, it's I am trying to make an online test for Python . P.S Sorry ,I did not realize I sent the mail

Re: Another MySQL Question

2010-06-03 Thread MRAB
Victor Subervi wrote: Hi; I have this code: options = '' our_options = [] our_options_string = '' for op in ops: options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:]) our_options.append('%s' % form.getfirst('%s' % op)) our_options_string += '%s", "'

FIle transfer over network - with Pyro?

2010-06-03 Thread Nathan Huesken
Hi, I am writing a network application which needs from time to time do file transfer (I am writing the server as well as the client). For simple network messages, I use pyro because it is very comfortable. But I suspect, that doing a file transfer is very inefficient over pyro, am I right (the fi

Re: Another MySQL Question

2010-06-03 Thread Victor Subervi
On Thu, Jun 3, 2010 at 1:48 PM, Dennis Lee Bieber wrote: > On Thu, 3 Jun 2010 08:49:44 -0400, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:]) > > Please modernize... Python supports a .c

Re: Windows and My Documents

2010-06-03 Thread Christian Heimes
> You're asking, it seems, for the equivalent of a UNIX softlink... > Normal Windows doesn't support those (I think they are in the OS > somewhere but not made visible to the user). Actually NTFS supports hard links, soft links and junction points since Windows 2k. [1] Christian [1] http:/

problems with CSV module

2010-06-03 Thread Carlos Grohmann
Hi all, I'm using csv to read text files, and its working fine, except in two cases: - when there is only one line of text (data) in the file - when there is a blank line after the last data line this is the kind of data: 45 67 89 23 45 06 12 34 67 ... and this is the function: def getData(pa

Re: FIle transfer over network - with Pyro?

2010-06-03 Thread Dan Stromberg
On Jun 3, 10:47 am, Nathan Huesken wrote: > Hi, > > I am writing a network application which needs from time to time do > file transfer (I am writing the server as well as the client). > For simple network messages, I use pyro because it is very comfortable. > But I suspect, that doing a file tran

Re: problems with CSV module

2010-06-03 Thread Neil Cerutti
On 2010-06-03, Carlos Grohmann wrote: > Hi all, I'm using csv to read text files, and its working fine, except > in two cases: > > - when there is only one line of text (data) in the file > - when there is a blank line after the last data line > > this is the kind of data: > > 45 67 89 > 23 45 06

Re: problems with CSV module

2010-06-03 Thread Neil Cerutti
On 2010-06-03, Neil Cerutti wrote: > Do you really need to use the Sniffer? You'll probably be better > off... ...defining your own dialect based on what you know to be the file format. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with CSV module

2010-06-03 Thread Carlos Grohmann
Thanks for your prompt response, Neil. > That data doesn't appear to be csv worthy. Why not use str.split > or str.partition? Well, I should have said that this is one kind of data. The function is part of a larger app, and there is the possibility that someone uses headers in the data files, or

Re: Another MySQL Question

2010-06-03 Thread John Nagle
MRAB wrote: Victor Subervi wrote: Hi; I have this code: options = '' our_options = [] our_options_string = '' for op in ops: options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:]) our_options.append('%s' % form.getfirst('%s' % op)) our_options_string

Re: FIle transfer over network - with Pyro?

2010-06-03 Thread exarkun
On 06:58 pm, strom...@gmail.com wrote: On Jun 3, 10:47�am, Nathan Huesken wrote: Hi, I am writing a network application which needs from time to time do file transfer (I am writing the server as well as the client). For simple network messages, I use pyro because it is very comfortable. But

Re: problems with CSV module

2010-06-03 Thread Neil Cerutti
On 2010-06-03, Carlos Grohmann wrote: >> Use: >> ? ?csvfile = csv.reader(csvfile, dialect=dialect) >> dialect is a keyword argument. > > thanks for pointing that out.it stopped the errors when there s > only one data line, but it still can't get the values for that > line Is it possible your data

changing format of time duration.

2010-06-03 Thread dave
Quick question. I have to time stamps (now and now2). now = datetime.datetime.now(); now2 = datetime.datetime.now(); now2-now1 yields me a result in 0:00:00.11221 (H:MM:SS.) I wanted to know if there is a standard python method or a quick hack to add an extra zero in the beginning. So the r

Issue with xml iterparse

2010-06-03 Thread bfrederi
I am using lxml iterparse and running into a very obscure error. When I run iterparse on a file, it will occasionally return an element that has a element.text == None when the element clearly has text in it. I copy and pasted the problem xml into a python string, used StringIO to create a file-li

Re: Issue with xml iterparse

2010-06-03 Thread Chris Rebert
On Thu, Jun 3, 2010 at 1:44 PM, bfrederi wrote: > I am using lxml iterparse and running into a very obscure error. When > I run iterparse on a file, it will occasionally return an element that > has a element.text == None when the element clearly has text in it. > > I copy and pasted the problem x

An empty object with dynamic attributes (expando)

2010-06-03 Thread dmtr
How can I create an empty object with dynamic attributes? It should be something like: >>> m = object() >>> m.myattr = 1 But this doesn't work. And I have to resort to: >>> class expando(object): pass >>> m = expando() >>> m.myattr = 1 Is there a one-liner that would do the thing? -- Cheers, D

Re: FIle transfer over network - with Pyro?

2010-06-03 Thread Irmen de Jong
On 3-6-2010 19:47, Nathan Huesken wrote: Hi, I am writing a network application which needs from time to time do file transfer (I am writing the server as well as the client). For simple network messages, I use pyro because it is very comfortable. But I suspect, that doing a file transfer is ver

Re: Issue with xml iterparse

2010-06-03 Thread bfrederi
On Jun 3, 3:59 pm, Chris Rebert wrote: > On Thu, Jun 3, 2010 at 1:44 PM, bfrederi wrote: > > I am using lxml iterparse and running into a very obscure error. When > > I run iterparse on a file, it will occasionally return an element that > > has a element.text == None when the element clearly has

Re: Python Forum

2010-06-03 Thread Phlip
On Jun 2, 3:18 am, Adam Tauno Williams wrote: > +1 > > Yuck; no better way to make new users hate your product than have a web > forum - where they post questions Free of all the spam that leaks into here from the remnants of USENET!! > and never get answers... You mean like how I never ge

Re: An empty object with dynamic attributes (expando)

2010-06-03 Thread Alf P. Steinbach
* dmtr, on 03.06.2010 23:00: How can I create an empty object with dynamic attributes? It should be something like: m = object() m.myattr = 1 But this doesn't work. And I have to resort to: class expando(object): pass m = expando() m.myattr = 1 Is there a one-liner that would do the thing

Re: Python Forum

2010-06-03 Thread geremy condra
On Thu, Jun 3, 2010 at 2:23 PM, Phlip wrote: > On Jun 2, 3:18 am, Adam Tauno Williams wrote: > >> +1 >> >> Yuck; no better way to make new users hate your product than have a web >> forum - where they post questions > > Free of all the spam that leaks into here from the remnants of > USENET!!

getting MemoryError with dicts; suspect memory fragmentation

2010-06-03 Thread Emin.shopper Martinian.shopper
Dear Experts, I am getting a MemoryError when creating a dict in a long running process and suspect this is due to memory fragmentation. Any suggestions would be welcome. Full details of the problem are below. I have a long running processing which eventually dies to a MemoryError exception. When

Re: Python Forum

2010-06-03 Thread Phlip
On Jun 3, 3:20 pm, geremy condra wrote: > > You mean like how I never get answers, to my super-easy GED-level > > questions, here??! > > I agree. This proves conclusively that a web forum is the right > place for you. Ah, so you feel up to my "xsl for xmlrunner.py" question? -- http://mail.pyth

Re: Python Forum

2010-06-03 Thread geremy condra
On Thu, Jun 3, 2010 at 3:40 PM, Phlip wrote: > On Jun 3, 3:20 pm, geremy condra wrote: > >> > You mean like how I never get answers, to my super-easy GED-level >> > questions, here??! >> >> I agree. This proves conclusively that a web forum is the right >> place for you. > > Ah, so you feel up to

Re: CTYPES structure passing

2010-06-03 Thread Rhodri James
On Thu, 03 Jun 2010 11:54:13 +0100, Peter West wrote: class LUCAM_FRAME_FORMAT(Structure): __fields__ = [( "xOffset", c_ulong), # x coordinate on imager of top left corner of subwindow in pixels [snip] ( "XUnion", FRAME_FORMAT_UNION), ( "flagsX", c_ushort),

Re: Python Forum

2010-06-03 Thread Phlip
On Jun 3, 3:58 pm, geremy condra wrote: > On Thu, Jun 3, 2010 at 3:40 PM, Phlip wrote: > > On Jun 3, 3:20 pm, geremy condra wrote: > > >> > You mean like how I never get answers, to my super-easy GED-level > >> > questions, here??! > > >> I agree. This proves conclusively that a web forum is the

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-03 Thread dmtr
On Jun 3, 3:43 pm, "Emin.shopper Martinian.shopper" wrote: > Dear Experts, > > I am getting a MemoryError when creating a dict in a long running > process and suspect this is due to memory fragmentation. Any > suggestions would be welcome. Full details of the problem are below. > > I have a long r

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-03 Thread dmtr
> I have a long running processing which eventually dies to a > MemoryError exception. When it dies, it is using roughly 900 MB on a 4 > GB Windows XP machine running Python 2.5.4. If I do "import pdb; BTW have you tried the same code with the Python 2.6.5? -- Dmitry -- http://mail.python.org/ma

Re: Python Forum

2010-06-03 Thread geremy condra
On Thu, Jun 3, 2010 at 4:11 PM, Phlip wrote: > On Jun 3, 3:58 pm, geremy condra wrote: >> On Thu, Jun 3, 2010 at 3:40 PM, Phlip wrote: >> > On Jun 3, 3:20 pm, geremy condra wrote: >> >> >> > You mean like how I never get answers, to my super-easy GED-level >> >> > questions, here??! >> >> >> I

Re: Vote to Add Python Package "pubsub" to the Python Standard Library

2010-06-03 Thread Carl Banks
On Jun 3, 8:46 am, Vinay Sajip wrote: > On Jun 2, 4:09 am, Carl Banks wrote: > > > I think it has a pretty good chance of being accepted, too.  The > > publish-subscribe pattern, if you will, seems to have been implemented > > separately in many places.  The logging module in the standard library

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-03 Thread Emin.shopper Martinian.shopper
On Thu, Jun 3, 2010 at 7:41 PM, dmtr wrote: > On Jun 3, 3:43 pm, "Emin.shopper Martinian.shopper" > wrote: >> Dear Experts, >> > > Are you sure you have enough memory available? > Dict memory usage can jump x2 during re-balancing. > I'm pretty sure. When I did  p setattr(self,'q',dict([(xxx,xxx

Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread Ross
I'd like to just quickly and with a minimum of parsing (ie no screen- scraping) get a unix epoch timestamp (or another format if necessary). I thought with a quick second search on Google I'd find a URL where I could do a simple urllib2 based HTTP GET and have a timestamp returned to me. I don'

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread livibetter
I don't know what tools do you have on embedded system, but I really don't think this has to be using Python. Here is what I would do on a normal desktop using your unique way to set up time: date -s "$(curl -s -I http://example.com | grep Date | cut -d \ -f 2-)" On Jun 4, 8:05 am, Ross wro

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread Ross
No - it's not really a python specific need, it's just what I'm using just now, and can't think of where else to ask. It's also my fav test- bed, as it's so easy. Your curl example is using grep and date which I don't have available. I have no fancy libraries, just core parsing capability. I foun

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread Paul Rubin
Ross writes: > I'd like to just quickly and with a minimum of parsing (ie no screen- > scraping) get a unix epoch timestamp (or another format if necessary). I haven't used this in a while and can't promise it still works: http://www.nightsong.com/phr/python/setclock.py -- http://mail.python.

Re: How to run a python script with a configuration file at command line ?

2010-06-03 Thread Ben Finney
steph_awk writes: > I have been searching for quite some times without success. Did you try the standard library? > I have a python script that needs to start from command line and it > should have a config file to fill out the detais (itis one program, > and many possible configurations). The

Re: Python Forum

2010-06-03 Thread Ben Finney
Dennis Lee Bieber writes: > I'm tempted to offer up that a lot of things that may once have been > covered in this general group have been migrated to specific mailing > lists (which are too many for me to consider subscribing just to do > one or two posts)... Which is also where NNTP shines: it

Re: Python Forum

2010-06-03 Thread John Bokma
Phlip writes: > On Jun 3, 3:20 pm, geremy condra wrote: > >> > You mean like how I never get answers, to my super-easy GED-level >> > questions, here??! >> >> I agree. This proves conclusively that a web forum is the right >> place for you. > > Ah, so you feel up to my "xsl for xmlrunner.py" que

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-03 Thread dmtr
I'm still unconvinced that it is a memory fragmentation problem. It's very rare. Can you give more concrete example that one can actually try to execute? Like: python -c "list([list([0]*xxx)+list([1]*xxx)+list([2]*xxx) +list([3]*xxx) for xxx in range(10)])" & -- Dmitry -- http://mail.python.

Re: CTYPES structure passing

2010-06-03 Thread Bryan
Peter West wrote: > I'm hoping someone here can tell me what I'm doing wrong as I've spent > the best part of three days reading docs and trying code. Yeah, I imagine a person could re-read them over and over and not see the gotcha. Sit down, maybe prepare some comfort food, and try to to be to up

How to generate execute file that include enthought.traits.api , enthought.traits.ui.api ?

2010-06-03 Thread ray
Hi all, I code the program that using enthought.traits.api , enthought.traits.ui.api. I want to genereate execute file.I try PY2EXE,bb- freeze,cx_freeze,Pyinstaller ,but the execute files can not run successful. The attach file is my source code. My environment : 1.Python 2.6.2 2. OS platform

questions about how to parse a string and put it in a dictionary

2010-06-03 Thread joblack
I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an implementation? Greetings and thanks jb --

Re: questions about how to parse a string and put it in a dictionary

2010-06-03 Thread Benjamin Kaplan
On Thu, Jun 3, 2010 at 7:21 PM, joblack wrote: > I've got a string which (without any CR or LF) consists of > > 'attribute1=attribute_value;attribute2=attribute_value2; ...' > > and I want them to read in a dictionary so that the attribute name is > the key and the attribute value is the data. > >

Re: questions about how to parse a string and put it in a dictionary

2010-06-03 Thread MRAB
joblack wrote: I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an implementation? Greetings

Re: CTYPES structure passing

2010-06-03 Thread Bryan
Correction/addendum: I wrote: > try to to > be to upset when you find out how your three days were wasted... Of course that's, "try not to be too upset..." [...] > You're probably familiar with the Python > convention of special member names with double-underscores at each > end? Well, ctypes doe

Diff of Text

2010-06-03 Thread GZ
Hi All, I am looking for an algorithm that can compare to source code files line by line and find the minimum diff. I have looked at the difflib included in python. The problem is that it is designed to make the diff results easier for humans to read, instead of minimize the size of the output dif

great

2010-06-03 Thread joblack
Great - it works. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread livibetter
This? hwclock --utc --set --date="$(datestr="$(curl http://208.66.175.36:13/ 2>/dev/null | cut -d \ -f 2-3)" ; echo ${datestr//-//})" Only hwclock, curl, cut, and Bash. PS. I didn't know I can set the time via hwclock, learned from Paul's post, but still didn't try to see if it does work. On J

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread livibetter
I forgot to mention I redirect stderr to /dev/null, because curl returns error code 56 to me with this message "curl: (56) Failure when receiving data from the peer" On Jun 4, 11:20 am, livibetter wrote: > This? > > hwclock --utc --set --date="$(datestr="$(curlhttp://208.66.175.36:13/ > 2>/dev/n

Re: plac, the easiest command line arguments parser in the world

2010-06-03 Thread Michele Simionato
On Jun 2, 6:37 am, Michele Simionato wrote: > I would like to announce to the world the first public release of > plac: > >  http://pypi.python.org/pypi/plac The second release is out. I have added the recognition of keyword arguments, improved the formatting of the help message, and added many t

Re: questions about how to parse a string and put it in a dictionary

2010-06-03 Thread Bryan
joblack wrote: > I've got a string which (without any CR or LF) consists of > > 'attribute1=attribute_value;attribute2=attribute_value2; ...' Technically that's short of a rigorous specification, but it sure looks like a standard web "query string", the content type known as "application/x-www-for

  1   2   >