Re: running Python2 Python3 parallel concurrent

2011-04-04 Thread rusi
On Mar 31, 6:05 am, harrismh777 wrote: > Greetings, > >      The purpose of this communique is to document a process for > installing python2.7.1 in parallel with python3.2 on a concurrent > desktop with independent idle and python path structure. Not sure if this is relevant... python-mode (emac

Jobs

2011-04-04 Thread Mukunda Lohani
If you want to get the innovative information on the Job & job Market, please click on this website: www.111jobs.blogspot.com This website is based on the job technique and idea. -- http://mail.python.org/mailman/listinfo/python-list

News

2011-04-04 Thread Mukunda Lohani
For getting the effective information on the News, please click on this website: www.ml97712.blogspot.com This website will provide you the knowledge about the best news. -- http://mail.python.org/mailman/listinfo/python-list

Thinking and Analysis based on Marxism & Literature

2011-04-04 Thread Mukunda Lohani
For getting good knowledge about Marxism and Literature, Marx & his Opinions to sharpen thinking analytically, don't forget to click on the website given below:- www.analyzethink.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Fun python 3.2 one-liner

2011-04-04 Thread Giacomo Boffi
Chris Angelico writes: >> def f(x,n,w): return x if n==1 else\ >>    (lambda x0=f(x[::2],n/2,w[::2]),\ >>            x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\ >>                                      zip(*[(x0[k]+w[k]*x1[k],\ >>                                             x0[k]-w[k]*x1[k

Re: Testing for performance regressions

2011-04-04 Thread Steven D'Aprano
On Mon, 04 Apr 2011 20:59:52 -0700, geremy condra wrote: > On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano > wrote: >> * The disclaimers about timing code snippets that can be found in the >> timeit module apply. If possible, use timeit rather than roll-you-own >> timers. > > Huh. In looking in

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Terry Reedy
On 4/4/2011 9:16 PM, harrismh777 wrote: Another item that would be nice as an IDLE enhancement would be a menu option that applies the fixers (either direction depending on version 2.7 <--> 3.2) right in the IDE. Entries that could not be fixed could be flagged for manual update. I have had th

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Paddy
On Tuesday, April 5, 2011 2:16:07 AM UTC+1, harrismh777 wrote: > Steven D'Aprano wrote: > > I prefer to consider Python 2.7 and Python 3.x as different dialects of > > the same language. There are a very few handful of incompatibilities, > > most of which can be automatically resolved by the 2to3 f

Re: Testing for performance regressions

2011-04-04 Thread Paddy
In an extended case when you try and capture how a function works over a range of inputs, you might want to not assume some relationship between input size and time, as this mnight limit your ability to change algorithms and still have acceptable performance. I.e. instead of this: input_range

Re: Testing for performance regressions

2011-04-04 Thread geremy condra
On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano wrote: > I'm writing some tests to check for performance regressions (i.e. you > change a function, and it becomes much slower) and I was hoping for some > guidelines or hints. > > This is what I have come up with so far: > > > * The disclaimers abou

Re: Testing for performance regressions

2011-04-04 Thread Dan Stromberg
On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > I'm writing some tests to check for performance regressions (i.e. you > change a function, and it becomes much slower) and I was hoping for some > guidelines or hints. > > This is what I have come up w

Re: TypeError: iterable argument required

2011-04-04 Thread eryksun ()
On Monday, April 4, 2011 9:40:33 AM UTC-4, Νικόλαος Κούρας wrote: In one of your messages you wrote the following: > cursor.execute( '''INSERT INTO users(mail, comment) VALUES(%s, > %s)''', (mail, comment) ) > except MySQLdb.Error: > print ( "Error %d: %s" % (e.args[0], e.args[1]) ) Is this a ty

Testing for performance regressions

2011-04-04 Thread Steven D'Aprano
I'm writing some tests to check for performance regressions (i.e. you change a function, and it becomes much slower) and I was hoping for some guidelines or hints. This is what I have come up with so far: * The disclaimers about timing code snippets that can be found in the timeit module appl

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread harrismh777
Steven D'Aprano wrote: I prefer to consider Python 2.7 and Python 3.x as different dialects of the same language. There are a very few handful of incompatibilities, most of which can be automatically resolved by the 2to3 fixers. Yes, I am actually finding this to be consistent with my experienc

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 9:03 PM, Dan Stromberg wrote: > On Mon, Apr 4, 2011 at 4:34 PM, Philip Semanchuk wrote: > >> So if you're going to use multiprocessing, you're going to use pickle, and >> you need pickleable objects. >> > > http://docs.python.org/library/multiprocessing.html#sharing-state-be

Re: PyThreadState_Swap crash

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 9:08 AM, Wiktor Adamski wrote: > I have 2 threads in C code using python 2.5.2. First thread creates > new interpreter (i need several interpreters but those 2 threads use > only one) like that: > > PyEval_AcquireLock(); > threadState = Py_NewInterpreter(); > PyThreadState_Swa

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Dan Stromberg
On Mon, Apr 4, 2011 at 4:34 PM, Philip Semanchuk wrote: > So if you're going to use multiprocessing, you're going to use pickle, and > you need pickleable objects. > http://docs.python.org/library/multiprocessing.html#sharing-state-between-processes -- http://mail.python.org/mailman/listinfo/pyt

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Steven D'Aprano
On Tue, 05 Apr 2011 07:41:37 +1000, Chris Angelico wrote: > On Tue, Apr 5, 2011 at 7:10 AM, rantingrick > wrote: >> olks who have vast libraries of Python code that have been rendered >> useless because a few elites have spent too much time lamenting >> minutia. > > How is the code "rendered use

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Robert Kern
On 4/4/11 3:20 PM, John Ladasky wrote: Hi folks, I'm developing some custom neural network code. I'm using Python 2.6, Numpy 1.5, and Ubuntu Linux 10.10. I have an AMD 1090T six-core CPU, and I want to take full advantage of it. I love to hear my CPU fan running, and watch my results come bac

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 4:20 PM, John Ladasky wrote: > I have been playing with multiprocessing for a while now, and I have > some familiarity with Pool. Apparently, arguments passed to a Pool > subprocess must be able to be pickled. Hi John, multiprocessing's use of pickle is not limited to Pool.

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Steven D'Aprano
On Mon, 04 Apr 2011 17:09:07 -0500, harrismh777 wrote: > Python(3) is a new language. It has many of the same characteristics > of Python2, but will be more consistent, cleaner, leaner, more robust... > and certainly loved more universally by more people the world over for > centuries to come.

Re: Fun python 3.2 one-liner

2011-04-04 Thread Emile van Sebille
On 4/4/2011 3:16 PM Gregory Ewing said... Chris Angelico wrote: (Remind me how it is that Python code is more readable than line noise or Perl code?) Crazy thought: I wonder if Perl programmers have "multi line Perl" competitions where they laugh their heads off at how readable the code is, a

Re: Fun python 3.2 one-liner

2011-04-04 Thread Chris Angelico
On Tue, Apr 5, 2011 at 8:16 AM, Gregory Ewing wrote: > Chris Angelico wrote: > > Crazy thought: I wonder if Perl programmers have "multi > line Perl" competitions where they laugh their heads off > at how readable the code is, and how nobody in their > right mind would ever write Perl code that wa

Toronto PyCamp 2011

2011-04-04 Thread Chris Calloway
The University of Toronto Department of Physics brings PyCamp to Toronto on Monday, June 27 through Thursday, June 30, 2011. Register today at http://trizpug.org/boot-camp/torpy11/ For beginners, this ultra-low-cost Python Boot Camp makes you productive so you can get your work done quickly. P

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Chris Angelico
On Tue, Apr 5, 2011 at 8:16 AM, rantingrick wrote: >> and (b) in any place where it's not, >> it's going to be about one command to install a python2? > > Oh thanks Chris for revealing the simplicity of 2 to 3 code porting. > And might ask where you will begin to volunteer your expertise to the >

Re: Fun python 3.2 one-liner

2011-04-04 Thread Gregory Ewing
Chris Angelico wrote: (Remind me how it is that Python code is more readable than line noise or Perl code?) Crazy thought: I wonder if Perl programmers have "multi line Perl" competitions where they laugh their heads off at how readable the code is, and how nobody in their right mind would eve

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread rantingrick
On Apr 4, 4:41 pm, Chris Angelico wrote: > How is the code "rendered useless" when (a) Python 2.7 is still the > default Python in many places, That's the point. We are going to see Python2.x around for a very long time. A *very* long time Chris. Sadly if this conversion was planned a wee bit bet

Re: Python CPU

2011-04-04 Thread Gregory Ewing
Paul Rubin wrote: Vector processors are back, they just call them GPGPU's now. Also present to some extent in the CPU, with MMX, Altivec, etc. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Dan Stromberg
On Mon, Apr 4, 2011 at 1:20 PM, John Ladasky wrote: > When should one pickle and copy? When to implement an object in > shared memory? Why is pickling apparently such a non-trivial process > anyway? And, given that multi-core CPU's are apparently here to stay, > should it be so difficult to ma

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread harrismh777
rantingrick wrote: Yes and whilst that was a brilliant display of bombastic arrogance your statements miss the point completely. And what about the large steaming pile of elephant dung in the room your nose seems to be unable to smell? As we all know Python has experienced an explosion of u

Re: Python CPU

2011-04-04 Thread Gregory Ewing
geremy condra wrote: I'd be interested in seeing the performance impact of this, although I wonder if it'd be feasible. A project I have in the back of my mind goes something like this: 1) Design an instruction set for a Python machine and a microcode architecture to support it 2) Write a si

Re: Determining version of OpenSSL

2011-04-04 Thread Adam Mercer
On Mon, Apr 4, 2011 at 16:44, Martin v. Loewis wrote: >> is there a way that this can be done in python2.4? It's annoying but I >> need to support python2.4 for a while yet :-( > > ldd /usr/lib/python2.4/lib-dynload/_ssl.so > [...] >        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x7f6a5

Re: Python CPU

2011-04-04 Thread Gregory Ewing
Terry Reedy wrote: So a small extension to array with .map, .filter, .reduce, and a wrapper class would be more useful than I thought. Also useful would be some functions for doing elementwise operations between arrays. Sometimes you'd like to just do a bit of vector arithmetic, and pulling in

Re: Fun python 3.2 one-liner

2011-04-04 Thread Chris Angelico
On Tue, Apr 5, 2011 at 6:09 AM, gb wrote: > harrismh777 writes: > >> Seriously, these little one liners teach me more about the python >> language in less time than [...] > > def f(x,n,w): return x if n==1 else\ >    (lambda x0=f(x[::2],n/2,w[::2]),\ >            x1=f(x[1::2],n/2,w[::2]): reduce(

Re: Determining version of OpenSSL

2011-04-04 Thread Martin v. Loewis
> import ssl > ssl.OPENSSL_VERSION > > is there a way that this can be done in python2.4? It's annoying but I > need to support python2.4 for a while yet :-( ldd /usr/lib/python2.4/lib-dynload/_ssl.so [...] libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x7f6a5a9b7000) [...] HTH, Marti

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Chris Angelico
On Tue, Apr 5, 2011 at 7:10 AM, rantingrick wrote: > olks who have vast libraries of Python > code that have been rendered useless because a few elites have spent > too much time lamenting minutia. How is the code "rendered useless" when (a) Python 2.7 is still the default Python in many places,

Re: proposal to allow to set the delimiter in str.format to something other than curly bracket

2011-04-04 Thread Alia Khouri
Peter Otten wrote: > You could automatically convert from a custom format like that in your > original post... Here's a class wrapping your functionality: import re class Template(object): '''uses double brackets e.g [[ob.attr]] as delims to get around curly bracket ({}) collisions

Re: tkSimpleDialog.Dialog.ok calls Cancel

2011-04-04 Thread rantingrick
On Apr 4, 2:06 pm, Matt H wrote: > I am subclassing tkSimpleDialog.Dialog as a (sqlite) database front- > end. This parent dialog opens a number of child dialogs to propagate > sub-tables (like sub-forms in OOo). These subforms write their input > into the database (INSERT...) > > The parent dialo

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread rantingrick
On Apr 2, 5:13 am, Steven D'Aprano wrote: > "Should I use the list, list2, sortable_list, sortable_list2, > sortable_lost3, [note spelling, which we're stuck with forever], > heterogeneous_list, heterogeneous_list_without_stooge_sort, new_list, > fancy_list, fancy_list2, fancy_list_with_extra_oom

Re: proposal to allow to set the delimiter in str.format to something other than curly bracket

2011-04-04 Thread Alia Khouri
Peter Otten wrote: > You could automatically convert from a custom format like that in your > original post: > > import re > > _lookup = { >     "[[": "{", >     "]]": "}", >     "{": "{{", >     "}": "}}", > > } > > def _substitute(m): >     return _lookup[m.group()] > > def custom_format(template

Determining version of OpenSSL

2011-04-04 Thread Adam Mercer
Hi I'm trying to determine the version of OpenSSL that a given python is compiled against, with python2.7 I can do this with: import ssl ssl.OPENSSL_VERSION is there a way that this can be done in python2.4? It's annoying but I need to support python2.4 for a while yet :-( Cheers Adam -- http

Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread John Ladasky
Hi folks, I'm developing some custom neural network code. I'm using Python 2.6, Numpy 1.5, and Ubuntu Linux 10.10. I have an AMD 1090T six-core CPU, and I want to take full advantage of it. I love to hear my CPU fan running, and watch my results come back faster. When I'm training a neural net

Re: Python CPU

2011-04-04 Thread Paul Rubin
John Nagle writes: > That sort of thing was popular in the era of the early > Cray machines. Once superscalar CPUs were developed, > the overhead on tight inner loops went down, and several > iterations of a loop could be in the pipeline at one time, Vector processors are back, they just cal

Re: running Python2 Python3 parallel concurrent

2011-04-04 Thread harrismh777
John Roth wrote: You might want to look at PEP 394, which is tentatively scheduled for Python 3.3 and the next maintenance release of 2.7. As far as I can tell, this pretty much solves the problem for Unixoid and MacOS systems. Thanks John. I finally read PEP 394 and 397. Yes, these handle the

Re: Fun python 3.2 one-liner

2011-04-04 Thread gb
harrismh777 writes: > Seriously, these little one liners teach me more about the python > language in less time than [...] def f(x,n,w): return x if n==1 else\ (lambda x0=f(x[::2],n/2,w[::2]),\ x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\

Re: Python CPU

2011-04-04 Thread John Nagle
On 4/4/2011 12:47 AM, Gregory Ewing wrote: John Nagle wrote: A tagged machine might make Python faster. You could have unboxed ints and floats, yet still allow values of other types, with the hardware tagging helping with dispatch. But it probably wouldn't help all that much. It didn't in the L

Re: XML header with lxml

2011-04-04 Thread Chroma Key
On 2011-04-04 18:54:40 +0200, Jabba Laci said: I want to construct an XML file with lxml but I don't find how to add the '' header. from lxml import etree as ET html = ET.Element("html") print ET.tostring(html) Add the "xml_declaration=True" as an argument of etree.tostring(). -- C-K -- ht

Re: integer multiplication

2011-04-04 Thread casevh
On Apr 4, 9:41 am, Terry Reedy wrote: > On 4/4/2011 1:51 AM, Paul Rubin wrote: > > > I didn't realize Python used Karatsuba.  The main issue is probably that > > Python uses a straightforward portable C implementation that's not > > terribly efficient, > > but relatively easy for a couple of peopl

Re: TypeError: iterable argument required

2011-04-04 Thread Νικόλαος Κούρας
On 4 Απρ, 17:38, Mel wrote: > Íéêüëáïò Êïýñáò wrote: > >> > iam getting the following error which i dont understand > > >> > ** > >> > 163         # insert guest comments into database if form was > >> > submitted > >> >   164         if

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Terry Reedy
O fix exactly, and there is always worry that permanance enhancements may have unforseen side effects. I will let Raymond make the call on this. /permanance/performance/, /unforseen/unforeseen/ -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: [pyplot] using f1=figure(1)

2011-04-04 Thread Giacomo Boffi
"eryksun ()" writes: > figure(fig1.number) > plot(...) that's already much better than figure(1);...;figure(2);... > Alternatively, you can use the plot methods of a particular axes: > > fig1 = figure() > ax1 = axes() > fig2 = figure() > ax2 = axes() > > ax1.plot(...

tkSimpleDialog.Dialog.ok calls Cancel

2011-04-04 Thread Matt H
I am subclassing tkSimpleDialog.Dialog as a (sqlite) database front- end. This parent dialog opens a number of child dialogs to propagate sub-tables (like sub-forms in OOo). These subforms write their input into the database (INSERT...) The parent dialog then either commits or rolls-back transacti

Re: integer multiplication

2011-04-04 Thread Terry Reedy
On 4/4/2011 1:20 PM, geremy condra wrote: On Mon, Apr 4, 2011 at 9:41 AM, Terry Reedy wrote: (I believe that retaining two implementations internally was considered but rejected. Could be wrong.) There are two implementations, grade school multiplication and karatsuba, which kicks in after

Re: Python CPU

2011-04-04 Thread Terry Reedy
On 4/4/2011 1:14 PM, Terry Reedy wrote: On 4/4/2011 5:23 AM, Paul Rubin wrote: Gregory Ewing writes: What might help more is having bytecodes that operate on arrays of unboxed types -- numpy acceleration in hardware. That is an interesting idea as an array or functools module patch. Basically

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Terry Reedy
On 4/4/2011 9:35 AM, Lie Ryan wrote: On 04/04/11 19:34, Antoon Pardon wrote: On Fri, Apr 01, 2011 at 10:21:33PM -0400, Terry Reedy wrote: rewriting cmp_to_key in C is underway http://bugs.python.org/issue11707 Nice to know! Any chance this wil get into 2.7.x? Python 2.7 still have list.so

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Terry Reedy
On 4/4/2011 5:34 AM, Antoon Pardon wrote: On Fri, Apr 01, 2011 at 10:21:33PM -0400, Terry Reedy wrote: rewriting cmp_to_key in C is underway http://bugs.python.org/issue11707 Nice to know! Any chance this wil get into 2.7.x? I posted the question to the issue. -- Terry Jan Reedy -- http:

Re: integer multiplication

2011-04-04 Thread geremy condra
On Mon, Apr 4, 2011 at 9:41 AM, Terry Reedy wrote: > On 4/4/2011 1:51 AM, Paul Rubin wrote: > >> I didn't realize Python used Karatsuba.  The main issue is probably that >> Python uses a straightforward portable C implementation that's not >> terribly efficient, > > but relatively easy for a coupl

Re: Python CPU

2011-04-04 Thread Terry Reedy
On 4/4/2011 5:23 AM, Paul Rubin wrote: Gregory Ewing writes: What might help more is having bytecodes that operate on arrays of unboxed types -- numpy acceleration in hardware. That is an interesting idea as an array or functools module patch. Basically a way to map or fold arbitrary function

XML header with lxml

2011-04-04 Thread Jabba Laci
Hi, I want to construct an XML file with lxml but I don't find how to add the '' header. from lxml import etree as ET html = ET.Element("html") print ET.tostring(html) simply prints Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list

Re: integer multiplication

2011-04-04 Thread Terry Reedy
On 4/4/2011 1:51 AM, Paul Rubin wrote: I didn't realize Python used Karatsuba. The main issue is probably that Python uses a straightforward portable C implementation that's not terribly efficient, but relatively easy for a couple of people to maintain. For (C)Python 3, which no longer has a

Re: Python CPU

2011-04-04 Thread geremy condra
On Mon, Apr 4, 2011 at 12:47 AM, Gregory Ewing wrote: > John Nagle wrote: > >>    A tagged machine might make Python faster.  You could have >> unboxed ints and floats, yet still allow values of other types, >> with the hardware tagging helping with dispatch.   But it probably >> wouldn't help all

Re: Newbie -> NameError: getopt

2011-04-04 Thread R. Tyler Croy
On Mon, 04 Apr 2011 05:14:46 -0700, Mustafa Cayci wrote: > Hello, > > I followed several postings in Google and came up with the beginning of > the following code: > During the execution, I am getting > > Problem invoking WLST - Traceback (innermost last): > File "/home/oracle/wlsuserconfigfil

Re: proposal to allow to set the delimiter in str.format to something other than curly bracket

2011-04-04 Thread Peter Otten
Alia Khouri wrote: > Terry Reedy wrote: > >> Just double the brackets, just as one doubles '\\' to get '\' in a >> string. >> >> >>> "class {0}Model {{ public bool IsModel(){{ returntrue; >> ".format('My') >> >> 'class MyModel { public bool IsModel(){ returntrue; } }' >> > > Indeed, I tried

Re: better way to do this in python

2011-04-04 Thread nn
On Apr 3, 8:06 am, Mag Gam wrote: > Thanks for the responses. > > Basically, I have a large file with this format, > > Date INFO username command srcipaddress filename > > I would like to do statistics on: > total number of usernames and who they are > username and commands > username and filename

Re: proposal to allow to set the delimiter in str.format to something other than curly bracket

2011-04-04 Thread Alia Khouri
Terry Reedy wrote: > Just double the brackets, just as one doubles '\\' to get '\' in a string. > >  >>> "class {0}Model {{ public bool IsModel(){{ returntrue; ".format('My') > > 'class MyModel { public bool IsModel(){ returntrue; } }' > Indeed, I tried that, but it means I have to double bra

Pydev 2.0 Released

2011-04-04 Thread Fabio Zadrozny
Hi All, PyDev 2.0 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: === Major - * TDD actions on Ctrl+1 * Improved code coverage support See video at: http://pydev.org/video_pydev_20.html

Re: string to path problem

2011-04-04 Thread ecu_jon
On Apr 4, 5:06 am, Kushal Kumaran wrote: > On Mon, Apr 4, 2011 at 9:48 AM, ecu_jon wrote: > > On Apr 4, 12:17 am, Chris Rebert wrote: > >> On Sun, Apr 3, 2011 at 8:30 PM, ecu_jon wrote: > >> > i am writing a basic backup program for my school. so they wanted the > >> > possibility to be able to

Re: TypeError: iterable argument required

2011-04-04 Thread Mel
Νικόλαος Κούρας wrote: >> > iam getting the following error which i dont understand >> >> > ** >> > 163         # insert guest comments into database if form was >> > submitted >> >   164         if "@" in mail and comment not in ("Σχολιά

Re: TypeError: iterable argument required

2011-04-04 Thread Peter Otten
Νικόλαος Κούρας wrote: >> if "@" in mail and comment not in INVALID_COMMENTS: > In my original question can you explain to me what the meaning of the > following error is? > > > mail = None, comment = None > TypeError: iterable argument required > arg

Re: using python to post data to a form

2011-04-04 Thread Littlefield, Tyler
>Sending POST data can be done as follows (I'm changing bar=foo to Thanks for this, and the links. On 4/4/2011 12:24 AM, Chris Rebert wrote: On Sun, Apr 3, 2011 at 10:36 PM, Littlefield, Tyler wrote: Hello: I have some data that needs to be fed through a html form to get validated and processe

Re: TypeError: iterable argument required

2011-04-04 Thread Νικόλαος Κούρας
On 3 Απρ, 17:01, "eryksun ()" wrote: > On Saturday, April 2, 2011 12:26:18 PM UTC-4, Νικόλαος Κούρας wrote: > > Hello, after inserting this line if "@" in mail and comment not in > > ("Σχολιάστε ή ρωτήστε με σχετικά", ""): > > > iam getting the following error which i dont understand > > > ***

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Lie Ryan
On 04/04/11 19:34, Antoon Pardon wrote: > On Fri, Apr 01, 2011 at 10:21:33PM -0400, Terry Reedy wrote: >> >> rewriting cmp_to_key in C is underway >> >> http://bugs.python.org/issue11707 >> > Nice to know! Any chance this wil get into 2.7.x? Python 2.7 still have list.sort(cmp=...)/sorted(cmp=...)

PyThreadState_Swap crash

2011-04-04 Thread Wiktor Adamski
I have 2 threads in C code using python 2.5.2. First thread creates new interpreter (i need several interpreters but those 2 threads use only one) like that: PyEval_AcquireLock(); threadState = Py_NewInterpreter(); PyThreadState_Swap(threadState); // calling python API PyThreadState_Swap(NULL);

Newbie -> NameError: getopt

2011-04-04 Thread Mustafa Cayci
Hello, I followed several postings in Google and came up with the beginning of the following code: During the execution, I am getting Problem invoking WLST - Traceback (innermost last): File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 80, in ? File "/home/oracle/wlsus

Re: using python to post data to a form

2011-04-04 Thread Corey Richardson
On 04/04/2011 01:36 AM, Littlefield, Tyler wrote: > Hello: > I have some data that needs to be fed through a html form to get > validated and processed and the like. How can I use python to send data > through that form, given a specific url? the form says it uses post, but > I"m not really sure

Re: Guido rethinking removal of cmp from sort method

2011-04-04 Thread Antoon Pardon
On Fri, Apr 01, 2011 at 10:21:33PM -0400, Terry Reedy wrote: > > rewriting cmp_to_key in C is underway > > http://bugs.python.org/issue11707 > Nice to know! Any chance this wil get into 2.7.x? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-04 Thread Paul Rubin
Gregory Ewing writes: > What might help more is having bytecodes that operate on > arrays of unboxed types -- numpy acceleration in hardware. That is an interesting idea as an array or functools module patch. Basically a way to map or fold arbitrary functions over arrays, with a few obvious optim

Re: string to path problem

2011-04-04 Thread Kushal Kumaran
On Mon, Apr 4, 2011 at 9:48 AM, ecu_jon wrote: > On Apr 4, 12:17 am, Chris Rebert wrote: >> On Sun, Apr 3, 2011 at 8:30 PM, ecu_jon wrote: >> > i am writing a basic backup program for my school. so they wanted the >> > possibility to be able to set source/destination from a config file. >> > my

Have a nice day.

2011-04-04 Thread Ashraf Ali
Hello friends. What are you looking for. You can find everything what you want. just visit: www.hothitsbollywood.blogspot.com www.aishwaryaraismile.blogspot.com www.bollywoodhotpik.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-04 Thread Gregory Ewing
John Nagle wrote: A tagged machine might make Python faster. You could have unboxed ints and floats, yet still allow values of other types, with the hardware tagging helping with dispatch. But it probably wouldn't help all that much. It didn't in the LISP machines. What might help more

Re: Python CPU

2011-04-04 Thread Gregory Ewing
Paul Rubin wrote: You can order 144-core Forth chips right now, http://greenarrays.com/home/products/index.html They are asynchronous cores running at around 700 mhz, so you get an astounding amount of raw compute power per watt and per dollar. But for me at least, it's not that easy to fi