Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread Adam Tauno Williams
"Steve Holden" wrote: >On 12/23/2010 4:34 PM, Stefan Sonnenberg-Carstens wrote: >> For large datasets I always have huge question marks if one says >"xml". >> But I don't want to start a flame war. >I agree people abuse the "spirit of XML" using it to transfer gigabytes >of data, How so? I th

Re: lxml etree question

2010-12-24 Thread Adam Tauno Williams
On Fri, 2010-12-24 at 20:48 +0530, Nitin Pawar wrote: > On Fri, Dec 24, 2010 at 8:40 PM, Jim wrote: > Hello, I wonder if someone knows about lxml.etree and > namespaces? Yes, and don't. > I want to build an ElementTree where some of the sub-elements have > attributes that serial

Re: Hosting a Python based TCP server

2010-12-23 Thread Adam Tauno Williams
On Thu, 2010-12-23 at 04:40 -0800, bobicanprogram wrote: > On Dec 23, 7:01 am, Oltmans wrote: > > Hi all, > > I'm writing a very small TCP server(written in Python) and now I want > > to host it on some ISP so that it can be accessed anywhere from the > > Internet. I've never done that before so I

Re: issubclass(dict, Mapping)

2010-12-22 Thread Adam Tauno Williams
On Wed, 2010-12-22 at 14:20 +, kj wrote: > In a message (<4cf97c94$0$30003$c3e8da3$54964...@news.astraweb.com>) > on a different thread, Steven D'Aprano tells me: > >I suspect you're trying to make this more complicated than it actually > >is. You keep finding little corner cases that expose i

Re: Trying to parse a HUGE(1gb) xml file

2010-12-20 Thread Adam Tauno Williams
On Mon, 2010-12-20 at 12:29 -0800, spaceman-spiff wrote: > I need to detect them & then for each 1, i need to copy all the > content b/w the element's start & end tags & create a smaller xml > file. Yep, do that a lot; via iterparse. > 1. Can you point me to some examples/samples of using SAX, >

Re: Trying to parse a HUGE(1gb) xml file

2010-12-20 Thread Adam Tauno Williams
On Mon, 2010-12-20 at 11:34 -0800, spaceman-spiff wrote: > Hi c.l.p folks > This is a rather long post, but i wanted to include all the details & > everything i have tried so far myself, so please bear with me & read > the entire boringly long post. > I am trying to parse a ginormous ( ~ 1gb) xml f

PyUNO [Was: Read / Write OpenOffice SpreadSheet ?]

2010-12-17 Thread Adam Tauno Williams
On Fri, 2010-12-17 at 10:19 +0100, Torsten Mohr wrote: > Thanks, i read about it but as i understood it, UNO needs Python 2.3.x and > i'd like to base on something actual. I do not *believe* this is true. for instance is Python 2.6 and uses PyUNO. I

Re: class browser

2010-12-13 Thread Adam Tauno Williams
On Sun, 2010-12-12 at 05:01 -0800, rusi wrote: > On Dec 8, 11:24 pm, Adam Tauno Williams > wrote: > > On Wed, 2010-12-08 at 13:18 +0530, Rustom Mody wrote: > > > If I have a medium to large python code base to browse/study, what are > > > the class browsers avail

Re: class browser

2010-12-08 Thread Adam Tauno Williams
On Wed, 2010-12-08 at 13:18 +0530, Rustom Mody wrote: > If I have a medium to large python code base to browse/study, what are > the class browsers available? Monodevelop has good Python support which includes a working Python class browser for Python projects & solutions.

Re: Task Engine Framework?

2010-12-07 Thread Adam Tauno Williams
On Mon, 2010-12-06 at 15:11 -0800, Nate wrote: > Hello, > I'm in the process of developing a task engine / workflow module for > my Python application and I'm wondering if anyone knows of existing > code that could be used or adapted. Since I know that's far too > generic a question, let me share

Re: is id(self) constant over an object lifetime ?

2010-12-03 Thread Adam Tauno Williams
On Fri, 2010-12-03 at 14:44 +0100, Jean-Michel Pichavant wrote: > Hello fellows, > I would need a unique internal identifier to an object. Can I use the > object python id ? > class Foo: > def getUniqueIdentifier(): >return id(self) > This id needs to be unique and constant over the p

Re: SAX unicode and ascii parsing problem

2010-12-01 Thread Adam Tauno Williams
On Tue, 2010-11-30 at 12:28 -0800, goldtech wrote: > I'm trying to parse an xml file using SAX. About half-way through a > file I get this error: > Traceback (most recent call last): > File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework > \scriptutils.py", line 325, in RunScript >

Re: IMAP support

2010-11-30 Thread Adam Tauno Williams
On Tue, 2010-11-30 at 13:03 -0800, pakalk wrote: > Please, give me an example of raw query to IMAP server? I'm not certain what you mean by "raw query". > And why do you focus on "Nevermind is so ekhm... nevermind... "??

Re: do something every n seconds

2010-11-25 Thread Adam Tauno Williams
scheduler' issue your application will ever have. <http://packages.python.org/APScheduler/> -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Adam Tauno Williams
e. JSON is best for communicating simple data to stupid clients [web browsers]. JSON doesn't know about dates, it doesn't know about string vs. unicode, etc... -- Adam Tauno Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle in a POST/GET request give EOFError

2010-11-17 Thread Adam Tauno Williams
string you can base64 encode it (using the base64 module). -- Adam Tauno Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: What people are using to access this mailing list

2010-11-03 Thread Adam Tauno Williams
information [no wading through pages and pages of search-result-swill]. <http://projects.gnome.org/evolution/index.shtml> <http://www.cyrusimap.org/#imap> -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLD

Re: multiprocessing signal defect

2010-10-30 Thread Adam Skutt
On Oct 29, 10:08 am, Adam Tauno Williams wrote: > No, I don't think so.  You're asking the module to over generalize > behavior.  Reaping of the child is important, and that the child needs > to be reaped may matter to the master child (why? did something go > wrong?). A

Re: multiprocessing signal defect

2010-10-29 Thread Adam Tauno Williams
On Fri, 2010-10-29 at 07:31 -0700, Jean-Paul Calderone wrote: > On Oct 29, 10:08 am, Adam Tauno Williams > wrote: > > signal handler to do something smart in the case of a "-15" [for which > > there isn't really a thread equivalent - can you sent a SystemV

Re: multiprocessing signal defect

2010-10-29 Thread Adam Tauno Williams
On Fri, 2010-10-29 at 08:39 -0400, Neal Becker wrote: > Adam Tauno Williams wrote: > > > On Fri, 2010-10-29 at 08:12 -0400, Neal Becker wrote: > >> Seems multiprocessing doesn't behave well with signals: > >> - > >> from multiprocessing import

Re: multiprocessing signal defect

2010-10-29 Thread Adam Tauno Williams
On Fri, 2010-10-29 at 08:12 -0400, Neal Becker wrote: > Seems multiprocessing doesn't behave well with signals: > - > from multiprocessing import Pool > import time > def sleep (dummy): > time.sleep (10) > if __name__ == '__main__': > pool = Pool (processes=2) > result = po

Re: DateTime object

2010-10-29 Thread Adam Tauno Williams
On Fri, 2010-10-29 at 13:15 +0200, jf wrote: > Hi, > I've a bug in my code and I'm trying de reproduce it. > To trace the bug I print arguments, and it produces this: > {'date': } > My question is: what is: ? > I use mx.DateTime put if I print it I get: > > So what kind of object is ? In this c

Re: Pythonic way of saying 'at least one of a, b, or c is in some_list'

2010-10-29 Thread Adam Przybyla
in days_off]): >doSomething > > Is there a better pythonic idiom for this situation? ... hmmm, try this: if set(['monday', 'tuesday'])&set(days_off): dosomething Regards Adam Przybyla -- http://mail.python.org/mailman/listinfo/python-list

Re: Land Of Lisp is out

2010-10-28 Thread Adam Tauno Williams
On Thu, 2010-10-28 at 10:06 -0700, namekuseijin wrote: > On 28 out, 07:02, p...@informatimago.com (Pascal J. Bourguignon) > wrote: > > Alain Ketterlin writes: > > > Lawrence D'Oliveiro writes: > > Would it be right to say that the only Lisp still in common use is the > > Elisp built in

Print to an IPP printer (pkipplib?)

2010-10-18 Thread Adam Tauno Williams
I've found the module pkipplib which seems to work well for things like interrogating an IPP (CUPS) server. But is there a way to send a print job to an IPP print queue? [and no, the local system knows nothing about the print architecture so popenlp is not an option]. I just want to send the

Print to an IPP printer (pkipplib?)

2010-10-18 Thread Adam Tauno Williams
I've found the module pkipplib which seems to work well for things like interrogating an IPP (CUPS) server. But is there a way to send a print job to an IPP print queue? [and no, the local system knows nothing about the print architecture so popenlp is not an option]. I just want to send the

Python shelve with a file handle

2010-10-06 Thread Adam Tauno Williams
shelve has open({filename}). Is there anyway to open a shelve 'database' using a file handle? Specifically I'd like to create a shelve database via a file handle acquired from a call to SpooledTemporaryFile. -- http://mail.python.org/mailman/listinfo/python-list

Re: resource module returns just zeros

2010-10-06 Thread Adam Tauno Williams
On Tue, 2010-10-05 at 09:49 +1100, Cameron Simpson wrote: > On 04Oct2010 09:02, Adam Tauno Williams wrote: > | I'm using a call to the resource module's getrusage method. On openSUSE > | this works, on CentOS [python26-2.6.5-3.el5] it 'works' but just ret

resource module returns just zeros

2010-10-04 Thread Adam Tauno Williams
turns 0 Anyone know what condition causes this? Or is there a better / more-reliable way to check memory utilization of the current process? -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.p

Re: M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-17 Thread Adam Mercer
icular fire has been put out. Cheers Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-16 Thread Adam Mercer
ee > http://chandlerproject.org/Projects/MeTooCrypto for details on how to get > the sources. Thanks any ETA on a new release supporting OpenSSL 1.0.x? Cheers Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-15 Thread Adam Mercer
rchitecture, i.e. everything is 64 bit. The last time I build M2Crypto on this box was against SWIG-1.3.x and OpenSSL-0.9.8? So one of these (or both) has broken something... Looks like I'll have to revert each one at a time... Cheers Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-14 Thread Adam Mercer
Anyone have any ideas about this? Cheers Adam On Tue, Jul 13, 2010 at 16:18, Adam Mercer wrote: > Hi > > I'm trying to build M2Crypto on Mac OS X 10.6.4 against python2.5 > (python2.6 fails in the same way), with SWIG 2.0.0 and OpenSSL 1.0.0a > and it is failing with th

M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-13 Thread Adam Mercer
before ')' token 339 :info:build SWIG/_m2crypto_wrap.c:22582: error: expected expression before ')' token 340 :info:build SWIG/_m2crypto_wrap.c:22615: warning: passing argument 4 of 'pkcs7_sign1' makes integer from pointer without a cast 341 :info:build SWIG/_m2crypto_wrap.c:22615: error: too many arguments to function 'pkcs7_sign1' 342 :info:build SWIG/_m2crypto_wrap.c: In function '_wrap_pkcs7_verify1': 343 :info:build SWIG/_m2crypto_wrap.c:22628: error: 'STACK' undeclared (first use in this function) 344 :info:build SWIG/_m2crypto_wrap.c:22628: error: 'arg2' undeclared (first use in this function) 345 :info:build SWIG/_m2crypto_wrap.c:22628: error: expected expression before ')' token 346 :info:build SWIG/_m2crypto_wrap.c:22659: error: expected expression before ')' token 347 :info:build SWIG/_m2crypto_wrap.c:22692: warning: passing argument 3 of 'pkcs7_verify1' from incompatible pointer type 348 :info:build SWIG/_m2crypto_wrap.c:22692: warning: passing argument 4 of 'pkcs7_verify1' makes integer from pointer without a cast 349 :info:build SWIG/_m2crypto_wrap.c:22692: error: too many arguments to function 'pkcs7_verify1' 350 :info:build SWIG/_m2crypto_wrap.c: In function '_wrap_pkcs7_verify0': 351 :info:build SWIG/_m2crypto_wrap.c:22707: error: 'STACK' undeclared (first use in this function) 352 :info:build SWIG/_m2crypto_wrap.c:22707: error: 'arg2' undeclared (first use in this function) 353 :info:build SWIG/_m2crypto_wrap.c:22707: error: expected expression before ')' token 354 :info:build SWIG/_m2crypto_wrap.c:22734: error: expected expression before ')' token 355 :info:build SWIG/_m2crypto_wrap.c:22755: warning: passing argument 3 of 'pkcs7_verify0' makes integer from pointer without a cast 356 :info:build SWIG/_m2crypto_wrap.c:22755: error: too many arguments to function 'pkcs7_verify0' 357 :info:build SWIG/_m2crypto_wrap.c: In function '_wrap_pkcs7_get0_signers': 358 :info:build SWIG/_m2crypto_wrap.c:23188: error: 'STACK' undeclared (first use in this function) 359 :info:build SWIG/_m2crypto_wrap.c:23188: error: 'arg2' undeclared (first use in this function) 360 :info:build SWIG/_m2crypto_wrap.c:23188: error: expected expression before ')' token 361 :info:build SWIG/_m2crypto_wrap.c:23199: error: 'result' undeclared (first use in this function) 362 :info:build SWIG/_m2crypto_wrap.c:23211: error: expected expression before ')' token 363 :info:build SWIG/_m2crypto_wrap.c:23227: error: expected expression before ')' token 364 :info:build error: command '/usr/bin/gcc-4.2' failed with exit status 1 Anyone know a way to resolve this? Cheers Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
mentary functions if you can tolerate intermediate calculations that are more than twice as large as your double in the corner cases. Certainly, for a single calculation, this is acceptable, but at how many calculations is it no longer acceptable? Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 12:38 pm, "Zooko O'Whielacronx" wrote: > On Thu, Jul 8, 2010 at 4:58 AM, Adam Skutt wrote: > > > I can't think of any program I've ever written where the inputs are > > actually intended to be decimal.  Consider a simple video editing >

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
deal out of than is appropriate. The fact that I may not be able to complete a given calculation for an arbitrary precision is not something that can be ignored. It's the same notional problem with arbitrary-precision integers: is it better to run out of memory or overflow the calculation? The answer, of course, is a trick question. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 9:22 am, Mark Dickinson wrote: > On Jul 8, 2:00 pm, Adam Skutt wrote: > > > On Jul 8, 7:23 am, Mark Dickinson wrote:> On Jul 8, > > 11:58 am, Adam Skutt wrote: > > > > > accurately.  Moreover, in general, it's impossible to even round &g

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 7:23 am, Mark Dickinson wrote: > On Jul 8, 11:58 am, Adam Skutt wrote: > > > accurately.  Moreover, in general, it's impossible to even round > > operations involving transcendental functions to an arbitrary fixed- > > precision, you may need effectively i

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 12:53 am, "Zooko O'Whielacronx" wrote: > I don't understand. I described two different problems: problem one is > that the inputs, outputs and literals of your program might be in a > different encoding (in my experience they have most commonly been in > decimal). Problem two is that you

Re: GUIs - A Modest Proposal

2010-06-09 Thread Adam Tauno Williams
> The GUI must be small, pythonic, and cross platform. And how many times have I heard that? I develop GUIs... good luck. Come back in ten years when you have some working code. > Tkinter is aimed at the newbie and i would think that was Guido's > original vision. And it's not the worst GUI by

Re: GUIs - A Modest Proposal

2010-06-09 Thread Adam Tauno Williams
an't be me - I don't have the clout You get "clout", whatever that means, by writing code. This isn't the senate, it is Open Source. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-09 Thread Adam Tauno Williams
On Tue, 2010-06-08 at 18:49 -0700, geremy condra wrote: > On Tue, Jun 8, 2010 at 6:20 PM, Adam Tauno Williams > wrote: > > On Tue, 2010-06-08 at 18:12 -0700, geremy condra wrote: > >> > * IronPython relies on the .Net environment for everything > >> Since .Net

Re: GUIs - A Modest Proposal

2010-06-08 Thread Adam Tauno Williams
situation as it is. Witness the awesome Zeitgeist application in GNOME 3 - a GUI, developed in *gasp* Python. A real working solution that is part of a major project... H. > So keep the ideas rolling in people. We need to hear from every side > of this forum. Meanwhile everyone who disagrees

Re: GUIs - A Modest Proposal

2010-06-08 Thread Adam Tauno Williams
issue? Every, or pretty darn close, significant Python application depends on 3rd party modules/component/libraries. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-08 Thread Adam Tauno Williams
This statement is devoid of meaning. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-07 Thread Adam Tauno Williams
On Mon, 2010-06-07 at 13:19 +1000, Lie Ryan wrote: > On 06/07/10 12:18, Adam Tauno Williams wrote: > > On Mon, 2010-06-07 at 11:11 +1000, Lie Ryan wrote: > >> On 06/07/10 10:48, Adam Tauno Williams wrote: > >>> On Sun, 2010-06-06 at 17:03 -0700, AD. wrote: > &g

Re: GUIs - A Modest Proposal

2010-06-06 Thread Adam Tauno Williams
On Mon, 2010-06-07 at 11:11 +1000, Lie Ryan wrote: > On 06/07/10 10:48, Adam Tauno Williams wrote: > > On Sun, 2010-06-06 at 17:03 -0700, AD. wrote: > >> On Jun 7, 10:55 am, ant wrote: > >>> My concern is simple: I think that Python is doomed to remain a minor >

Re: GUIs - A Modest Proposal

2010-06-06 Thread Adam Tauno Williams
t try several > (as I have - I will admit I didn't try PyQt; > GUI fatigue was setting in by then). This isn't a language issue; it is a tool-chain issue. Get a better IDE. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-06 Thread Adam Tauno Williams
[Monodevelop and it's awesome Gtk# support for Mono/.NET is a good example; the tool makes the toolkit east to use - people go with the toolkit]. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: store .png file in a script

2010-06-06 Thread Adam Tauno Williams
Just base64 encode the file, store it as a string in the file, and decode it to a byte-stream when you need the image. Everything required to do that is in the standard library. >Would you please let me know that how can I >store a .png or .gif or .jpg file, in a python script? -- http://mail

Re: GUIs - A Modest Proposal

2010-06-05 Thread Adam Tauno Williams
On Sat, 2010-06-05 at 19:22 -0700, ant wrote: > I get the strong feeling that nobody is really happy with the state of > Python GUIs. > WxPython and PyGtk are both powerful, but quirky in different ways. All widget libraries are quirky - because sophisticated user interfaces are complicated. If

Re: Python Forum

2010-06-04 Thread Adam Tauno Williams
for you. > Ah, so you feel up to my "xsl for xmlrunner.py" question? I do a fair amount of xslt, but I don't have any idea what xmlrunner.py is. It isn't a GED-level question if it involves specific knowledge about a tertiary product/project. -- Adam Tauno Williams

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

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 c

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
t. > 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 pleasant interface, I suppose that is a mat

Re: Python Forum

2010-06-03 Thread Adam Tauno Williams
e Mono project; which provides both a "web forum" and a mail list interface. <http://lists.ximian.com/mailman/listinfo/mono-list> <http://go-mono.com/forums/> It works very well; and everyone [except the 3 or 4 NNTP hold outs] are happy. -- Adam Tauno Williams LPIC-1, Nove

Re: Python Forum

2010-06-02 Thread Adam Tauno Williams
; in exploring the world of Python and programming > > overall. The main goal of PythonForum.org is to popularize Python by > > welcoming all newcomers. > Newcomers have always been welcomed here. And yet another forum *where > the helpful experts won't post nor correc

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Adam Tauno Williams
On Tue, 2010-06-01 at 10:55 -0600, Michael Torrie wrote: > On 06/01/2010 05:01 AM, Adam Tauno Williams wrote: > > Yes, we install Python 2.6 on CentOS and run a production app on it - no > > problems. > > rpm -Uvh > > http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Adam Tauno Williams
supposing that if anyone wanted to do this, the EPEL > folks would be happy to let that person be the package maintainer. rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-4.ius.el5.noarch.rpm yum -y install python26 python26-setuptools -- Adam Tauno Williams LPIC-

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Adam Tauno Williams
l.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-4.ius.el5.noarch.rpm yum -y install python26 python26-setuptools <http://sourceforge.net/apps/trac/coils/wiki/ProvisioningCentOS5> -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> Ope

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Adam Tauno Williams
On Fri, 2010-05-28 at 15:41 +0100, Martin P. Hellwig wrote: > On 05/28/10 13:17, Adam Tauno Williams wrote: > > > You should be able to point it any any file-like object. But, again, > > why? > > If you have the data in the process why send it to stdout and redirect &g

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Adam Tauno Williams
On Thu, 2010-05-27 at 08:36 -0700, Tim Arnold wrote: > On May 26, 4:52 pm, Adam Tauno Williams > wrote: > > On Wed, 2010-05-26 at 11:47 -0700, Tim Arnold wrote: > > > Hi, > > > I'm using multiprocessing's BaseManager to create a server on one > >

Re: multiprocessing and accessing server's stdout

2010-05-26 Thread Adam Tauno Williams
chanism to communicate between the client and the server if you need feedback. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation

2010-05-26 Thread Adam Tauno Williams
noDevelop Highlight text, right-click, click "Indent Selection" in context menu. Or any decent IDE should provide the same kind of thing. <http://monodevelop.com/> -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Pos

Re: to prevent reveres engineering for Python

2010-05-25 Thread Adam Tauno Williams
On Wed, 2010-05-26 at 05:40 +1000, Lie Ryan wrote: > On 05/26/10 01:09, Adam Tauno Williams wrote: > > On Tue, 2010-05-25 at 18:49 +0500, Sandy Ydnas wrote: > >> Agree, reveres engineering is crucial issuer for programming > >> language > >> but every executa

Re: to prevent reveres engineering for Python

2010-05-25 Thread Adam Tauno Williams
dongle or application to perform the key management. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: where are the program that are written in python?

2010-05-22 Thread Adam Tauno Williams
th it. But since the framework is essentially general purpose - why not publish the code? I think of my Open Source code as "commercial". -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: Just To Be Sure...MySQL

2010-05-22 Thread Adam Tauno Williams
tring formatting for SQL commands unless you +1 And they are hideous code. Use an ORM: <http://freshmeat.net/projects/sqlalchemy> > carefully quote and validate the strings. Otherwise your SQL application > is vulnerable to SQL injection attacks. SQL injections are one o

Re: creating addon system

2010-05-21 Thread Adam Tauno Williams
("from strip import %s as _x"%striper["striper"]) > string = _x.start(string) This is how I chose to do it. Just walking a list of bundles and discover the available classes [as plugins]. <http://coils.hg.sourceforge.net/hgweb/coils/coils/file/b3538e9fafb9/src/coils

Re: Reading data from a Microsoft Access 2003 database

2010-05-21 Thread Adam Tauno Williams
MS calls. Yes, just like a DB-API provider, except that the 'translation' happens in the ODBC driver. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: where are the program that are written in python?

2010-05-21 Thread Adam Tauno Williams
the 'packaging' mechanism is less end-user friendly than .NET. I personally would not choose to create an end-user application in Python; but it has become my first choice for server-side development. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: intervall of about 1 second for xmlrpc calls?

2010-05-21 Thread Adam Tauno Williams
, port), > ExtendedXMLRPCRequestHandler) > self.server.register_function(self.is_even, "is_even") > self.server.register_function(self.stop, "stop_server") > (...) > I would also change all 'localhost' occurences in the code to ip > '

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
On Thu, 2010-05-20 at 22:46 +0200, News123 wrote: > Hi Adam, > Adam Tauno Williams wrote: > > On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote: > >>> What's wrong? > >> Obviously there's a problem with "localhost". When using the IP of

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
ls back to 127.0.0.1. Make sure IPv6 is properly configured/enabled and try the script again. -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading data from a Microsoft Access 2003 database

2010-05-19 Thread Adam Tauno Williams
> problem, and although there are some references to this problem in the > archives of this group, they are mainly very old and I wonder if there > is anything more recent that members could suggest to me? > Python would be my language of choice, however if someone has any > other sugges

Re: Reading data from a Microsoft Access 2003 database

2010-05-19 Thread Adam Tauno Williams
y read a few > > columns of data from some tables. > > this worked like a charm for me: > http://code.activestate.com/recipes/528868-extraction-and-manipulation-class-for-microsoft-ac/ The OP: "I use Ubuntu 64 bit" Does something that contains "import win32com.clien

Re: Classes and threading

2010-05-19 Thread Adam W.
On May 19, 4:30 am, Gregory Ewing wrote: > Or if you do need to override it for some reason, you > need to accept the extra args and pass them on: > >    class nThread(threading.Thread): > >        def __init__(self, *args, **kwds): >            threading.Thread.__init__(self, *args, **kwds) >    

Re: Classes and threading

2010-05-19 Thread Adam W.
On May 19, 12:04 am, Erik Max Francis wrote: > Adam W. wrote: > > I thought I knew how classes worked, but this code sample is making my > > second guess myself: > > > import threading > > > class nThread(threading.Thread): > >     def __init__(self): >

Classes and threading

2010-05-18 Thread Adam W.
(args=('fruit'),name='charlie') pants.start() Traceback (most recent call last): File "C:\Users\Adam\Desktop\PyTiVo\task_master.py", line 13, in pants = nThread(args=('fruit'),name='charlie') TypeError: __init__() got an unexpected keywor

RE: Multi-Threading in Python

2010-05-18 Thread Adam Tauno Williams
]. IMO, it is hard to > screw > > up as you don't get any shared-state for free. > > > > > This has probably been brought up already, so if it has, thanks > anyway > > > > -- > > Adam Tauno Williams LPIC-1, Novell CLA > &g

Re: Multi-Threading in Python

2010-05-18 Thread Adam Tauno Williams
sing separate processes]. IMO, it is hard to screw up as you don't get any shared-state for free. > This has probably been brought up already, so if it has, thanks anyway -- Adam Tauno Williams LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix

Re: subprocess and gvfs-mount

2010-05-18 Thread Adam Tauno Williams
"Run in > terminal") ... there is no interaction with the user. Which is normal [there is a run-in-terminal check box somewhere?]. If your users are running it in GNOME then you should implement a GUI (PyGTK) for the user interaction [prompting for the password]. Or better use the GN

Re: python application question

2010-05-17 Thread Adam Tauno Williams
On Mon, 2010-05-17 at 06:20 -0700, a wrote: > if i want to plot it i have to use something like matplotlib? but > this doesn't come with the standard installation. so if i want > someone else to use this application, do they have to install > matplotlib themselves or is there a better way? Use P

Re: Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
On Sun, 2010-05-16 at 02:37 +0200, Martin v. Loewis wrote: > > ??? The namespaces are embedded in the document. Personally I find it > > odd I have to tell xpath about the namespace of the document it is a > > $*&@(*& method of. > How so? Why do you say it's a "method", and why do you say "of"? >

Re: Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
On Sat, 2010-05-15 at 23:37 +0200, Martin v. Loewis wrote: > > BTW, I'm still not sure I understand your problem. Could you provide > > some more details? > Wouldn't it be easier if you told the OP how to access the prefix :) > mappings in lxml etree, or, if this was actually not possible, admitt

Re: Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
sure I understand your problem. Could you provide some > more details? This is an action in a workflow action (business process modeling). It has an input message of an XML document and a parameter of an xpath; it invokes a subordinate action [think: foreach] for each node resulting from the expre

Re: Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
On Sat, 2010-05-15 at 22:58 +0200, Stefan Behnel wrote: > Adam Tauno Williams, 15.05.2010 22:40: > > On Sat, 2010-05-15 at 22:29 +0200, Stefan Behnel wrote: > >> Adam Tauno Williams, 15.05.2010 20:37: > >>> Say I have an XML document that begins with: > &g

Re: Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
On Sat, 2010-05-15 at 22:29 +0200, Stefan Behnel wrote: > Adam Tauno Williams, 15.05.2010 20:37: > > Say I have an XML document that begins with: > > > > http://www.dsml.org/DSML";> > > How can one access the namespaces define in this node? I've done

Reading XML namespaces

2010-05-15 Thread Adam Tauno Williams
Say I have an XML document that begins with: http://www.dsml.org/DSML";> ... How can one access the namespaces define in this node? I've done a fair amount of XML in Python, but haven't been able to uncover the call to enumerate the namespaces. Primarily I am using etree f

Re: Puzzled by code pages

2010-05-15 Thread Adam Tauno Williams
On Sat, 2010-05-15 at 20:30 +1000, Lie Ryan wrote: > On 05/15/10 10:27, Adam Tauno Williams wrote: > > I'm trying to process OpenStep plist files in Python. I have a parser > > which works, but only for strict ASCII. However plist files may contain > > accented char

Re: Puzzled by code pages

2010-05-14 Thread Adam Tauno Williams
On Fri, 2010-05-14 at 20:27 -0400, Adam Tauno Williams wrote: > I'm trying to process OpenStep plist files in Python. I have a parser > which works, but only for strict ASCII. However plist files may contain > accented characters - equivalent to ISO-8859-2 (I believe). For examp

Puzzled by code pages

2010-05-14 Thread Adam Tauno Williams
I'm trying to process OpenStep plist files in Python. I have a parser which works, but only for strict ASCII. However plist files may contain accented characters - equivalent to ISO-8859-2 (I believe). For example I read in the line: >>> handle = open('file.txt', 'rb') >>> data = handle.read()

Re: parsing XML

2010-05-14 Thread Adam Tauno Williams
x27;file', 'rb') doc = etree.parse(handle) handle.close() players = [ ] for player in doc.xpath('/team/player'): players.append({ 'name': player.xpath('./@name')[0], 'age': player.xpath('./@age')[0],

Re: when should I explicitly close a file?

2010-04-23 Thread Adam Tauno Williams
On Fri, 2010-04-23 at 16:29 +1200, Lawrence D'Oliveiro wrote: > In message , Chris > Rebert wrote: > > On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote: > >> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote: > >>> Since in python nothing is guaranteed about implicit file close .

Re: when should I explicitly close a file?

2010-04-22 Thread Adam Tauno Williams
On Thu, 2010-04-22 at 12:53 +1200, Lawrence D'Oliveiro wrote: > In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote: > > Since in python nothing is guaranteed about implicit file close ... > It is guaranteed that objects with a reference count of zero will be > disposed. In my experiments, t

Re: Write web apps in Python?

2010-04-21 Thread Adam Tauno Williams
On Wed, 2010-04-21 at 10:28 +0200, Bruno Desthuilliers wrote: > Bryan a écrit : > > > > I think I see what you mean > > Err... > > > -- correct me if I'm wrong: > > You are, sorry !-) > > > You want to > > keep complex application data structures around between requests. > > Nope. I want to

Re: Write web apps in Python?

2010-04-20 Thread Adam Tauno Williams
On Tue, 2010-04-20 at 17:05 +0200, Bruno Desthuilliers wrote: > Adam Tauno Williams a écrit : > > On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote: > >> Gilles Ganault a écrit : > >>> On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers > >>&

Re: Write web apps in Python?

2010-04-20 Thread Adam Tauno Williams
On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote: > Gilles Ganault a écrit : > > On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers > > wrote: > >> The PHP execution model (mostly based on CGI FWIW) tends to be a bit > >> unpractical for non-trivial applications since you have to

Re: python admin abuse complaint

2010-02-06 Thread Ron Adam
Xah Lee wrote: For anyone reading this thread and interested in my opinions, i have written many essays related to this and netiquette. Many of which detail other similar incidences that i personally experienced, such as freenode's irc ban in #emacs channel. If you are interested, they can be

<    1   2   3   4   5   6   7   8   9   10   >