Fwd: fails to call python from jython for types, functools, csv modules

2010-05-12 Thread Joax Spec
Hello I'm very new to python/jython, and trying yo *call a program from jython*, which works very good in python. I got some issues which resolve as I expose here, but I think these are unsatisfactory solutions. If you want to reply please do it to my address. thanks, Jx PD. both are great projec

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 10:48 pm, Lawrence D'Oliveiro wrote: > In message , Ed Keith > wrote: > > > ... but to claim that putting more restrictions on someone give them more > > freedom is pure Orwellian double speak. > > What about the freedom to take away other people’s freedom? The freedom to take away oth

Use of cmp() (was Re: Limitation of os.walk)

2010-05-12 Thread Aahz
[nitpicking one specific point] In article , Steven D'Aprano wrote: > >On the other hand a cmp function is specific to sorting, and nothing >but sorting. Not quite. cmp() is useful any time you have an expensive comparison operation and you need to take three different codepaths depending on t

Re: win32com sql update problem

2010-05-12 Thread Tim Roberts
Mark Carter wrote: > >Consider the following snippet of code: > >import win32com.client > >DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=M:\\Finance\\camel\ >\camel.mdb;' >conn.Open(DSN) >cursor = conn.Execute("UPDATE tblInvoice SET InvComments='Python' >WHERE InvBillingPeriod = 'April 2010'

Re: Picking a license

2010-05-12 Thread Lawrence D'Oliveiro
In message , Ed Keith wrote: > ... but to claim that putting more restrictions on someone give them more > freedom is pure Orwellian double speak. What about the freedom to take away other people’s freedom? What tuple of speak would that be? -- http://mail.python.org/mailman/listinfo/python-li

Re: Limitation of os.walk

2010-05-12 Thread Steven D'Aprano
On Wed, 12 May 2010 19:04:47 +, kj wrote: > In Terry Reedy > writes: > >>On 5/11/2010 3:49 PM, kj wrote: >>> PS: I never understood why os.walk does not support hooks for key >>> events during such a tree traversal. > >>Either 1) it is intentionally simple, with the expectation that people

Re: buffer objects (C-API)

2010-05-12 Thread Carl Banks
On May 12, 7:33 pm, moerchendiser2k3 wrote: > Hi at all, > > is it possible that a buffer object deallocates the memory when the > object is destroyed? I want to wrap the buffer object around some > memory. Or is there any chance that the buffer object copies the > memory so it will be responsible

Re: Limitation of os.walk

2010-05-12 Thread Terry Reedy
On 5/12/2010 2:52 PM, kj wrote: In Tim Chase writes: 05/11/2010 09:07 PM, Terry Reedy wrote: If os.walk were rewritten, it should be as an iterator (generator). Directory entry and exit functions could still be added as params. It *is* an iterator/generator. However, I suspect you mean t

Re: open(False) in python3

2010-05-12 Thread Terry Reedy
On 5/12/2010 7:07 PM, Jan Kaliszewski wrote: Terry Reedy dixit (2010-05-12, 14:26): On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina: open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together.

buffer objects (C-API)

2010-05-12 Thread moerchendiser2k3
Hi at all, is it possible that a buffer object deallocates the memory when the object is destroyed? I want to wrap the buffer object around some memory. Or is there any chance that the buffer object copies the memory so it will be responsible when it will be destroyed? Thanks in advance, bye. mo

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Jess
Cheap Chanel Watches for sale at: http://www.luxuryowner.net/ Chanel Watches collection: http://www.luxuryowner.net/replica-chanel-watches.html Chanel J12 Automatic Watches: http://www.luxuryowner.net/Chanel-J12-Automatic-Watches.html Chanel J12 Quartz Watches: http://www.luxuryowner.net/Chan

Re: How to test whether bit is set within a flag with Python ?

2010-05-12 Thread Jess
Cheap Chanel Watches for sale at: http://www.luxuryowner.net/ Chanel Watches collection: http://www.luxuryowner.net/replica-chanel-watches.html Chanel J12 Automatic Watches: http://www.luxuryowner.net/Chanel-J12-Automatic-Watches.html Chanel J12 Quartz Watches: http://www.luxuryowner.net/Chan

Re: documentation bug? (format spec mini language)

2010-05-12 Thread Alan G Isaac
On 5/11/2010 5:05 PM, Terry Reedy wrote: http://bugs.python.org/issue8691 Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a functional programming language?

2010-05-12 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > On Tue, 11 May 2010 23:13:10 +1200, Lawrence D'Oliveiro wrote: > >>> But the beauty is that Python is multi-paradigm ... >> >> The trouble with “multi-paradigm” is that it offends the zealots on >> all sides. > > Is that how you view people who like languages to exh

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 6:15 pm, Paul Boddie wrote: > On 12 Mai, 20:29, Patrick Maupin wrote: > > > > > But nobody's whining about the strings attached to the software.  Just > > pointing out why they sometimes won't use a particular piece of > > software, and pointing out that some other people (e.g. random

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 5:41 pm, Paul Boddie wrote: > > Ahh, well done.  You've sucked me into a meaningless side debate.  If > > I'm not distributing readline, then legally the license distribution > > terms don't apply to me.  End of story.  (Morally, now we might get > > into how trivial it is or isn't.) >

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 11 Mai, 14:12, Ed Keith wrote: > --- On Mon, 5/10/10, Ben Finney wrote: > > > So I object to muddying the issue by misrepresenting the source of that > > force. Whatever force there is in copyright comes from law, not any free > > software license. > > You are the one muddying the waters. It d

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 12 Mai, 20:29, Patrick Maupin wrote: > > But nobody's whining about the strings attached to the software.  Just > pointing out why they sometimes won't use a particular piece of > software, and pointing out that some other people (e.g. random Ubuntu > users) might not understand the full cost o

Re: open(False) in python3

2010-05-12 Thread Jan Kaliszewski
Terry Reedy dixit (2010-05-12, 14:26): > On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: > >2010/5/12 Gabriel Genellina: > >>open() in Python 3 does a lot of things; it's like a mix of codecs.open() + > >>builtin open() + os.fdopen() from 2.x all merged together. It does different > >>things dependi

Re: How to test whether bit is set within a flag with Python ?

2010-05-12 Thread Mensanator
On May 12, 1:40 pm, MRAB wrote: > robert somerville wrote: > > I am trying to determine how to test whether variors bits are set within > > a byte (or larger flag) , the python 'and' and 'or' do not seem to be > > doing what i want .. does anybody have some sample code showing how to > > do it ??

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 12 Mai, 21:02, Patrick Maupin wrote: > On May 12, 1:00 pm, Paul Boddie wrote: [Quoting himself...] > > "Not least because people are only obliged to make their work > > available under a GPL-compatible licence so that people who are using > > the combined work may redistribute it under > > t

Re: Limitation of os.walk

2010-05-12 Thread Patrick Maupin
On May 12, 2:04 pm, kj wrote: > It seems that a similar "simplicity argument" was invoked > to strip the cmp option from sort in Python 3.  G.  Simplicity > is great, but when the drive for it starts causing useful functionality > to be thrown out, then it is going too far.  Yes, I know that i

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Phlip
On May 12, 3:03 pm, "Joel Koltner" wrote: > Pretty much, yeah... Realistically, we're probably talking less than a minute > each time, so objectively it's not really a big deal -- it's just different > than what I'm used to so I'm noticing it more. :-) > > I guess what I'm realizing here is that

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
"John Nagle" wrote in message news:4beb15c5$0$1634$742ec...@news.sonic.net... Having actually used LISP systems with "edit and continue", it's a good thing that Python doesn't have it. It encourages a "patch" mentality, and the resulting code is usually disappointing. Hey, a lot of people

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
"Phlip" wrote in message news:c014ae9f-99d8-4857-a3f7-e6ac16e45...@e34g2000pra.googlegroups.com... Are you implying, after an edit, you need to start a program again, then enter several user inputs, to navigate back to the place where you hit the syntax error? (WxWidgets noted - props!) Pretty

fails to call python from jython for types, functools, csv modules

2010-05-12 Thread Joax Spec
Hello I'm very new to python/jython, and trying yo *call a program from jython*, which works very good in python. I got some issues which resolve as I expose here, but I think these are unsatisfactory solutions. If you want to reply please do it to my address. thanks, Jx PD. both are great projec

RE: Do any debuggers support "edit and continue?"

2010-05-12 Thread Sandy Sandy
maybe ipython? http://showmedo.com/videos/video?name=120&fromSeriesID=100 > From: zapwiredashgro...@yahoo.com > Subject: Do any debuggers support "edit and continue?" > Date: Wed, 12 May 2010 10:42:31 -0700 > To: python-list@python.org > > Just curious... in Microsoft's Visual Studio (a

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread John Nagle
Joel Koltner wrote: Just curious... in Microsoft's Visual Studio (and I would presume some other tools), for many languages (both interpreted and compiled!) there's an "edit and conitnue" option that, when you hit a breakpoint, allows you to modify a line of code before it's actually executed.

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Phlip
On May 12, 1:38 pm, "Joel Koltner" wrote: > Well, sure, that is the current fix... but an "edit and continue" feature > would make for a much faster fix. :-) Are you implying, after an edit, you need to start a program again, then enter several user inputs, to navigate back to the place where yo

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
"Phlip" wrote in message news:75c050d2-365e-4b08-8716-884ed5473...@k25g2000prh.googlegroups.com... On May 12, 12:44 pm, "Joel Koltner" wrote: Are you implying that you then run the code, and - after a handful of higher-level calls - control flow gets down to the lines you just typed, and the r

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Phlip
On May 12, 12:44 pm, "Joel Koltner" wrote: > I find myself making mistakes in typing the name of classes and/or methods > when I'm first getting started with them (there are some thousands of them > after all, and even of commonly used classes/methods you're probably talking > upwards of a hundre

Re: open(False) in python3

2010-05-12 Thread Martin v. Loewis
geremy condra wrote: > On Wed, May 12, 2010 at 1:36 AM, Stefan Behnel wrote: >> Johan Förberg, 12.05.2010 10:05: >>> On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: >>> so open(False) is the same as open(0), and 0 is the file descriptor associated to standard input. The prog

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
"Phlip" wrote in message news:d580dece-bd42-4753-a0c6-783ce69b5...@m31g2000pre.googlegroups.com... People who need "edit and continue" probably need developer tests instead. You typically edit the test a little, run all the code, edit the code a little, run all the code, and integrate whenever t

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Phlip
On May 12, 10:42 am, "Joel Koltner" wrote: > Does any Python debugger support this feature? I have worked for >3 years by now in Python and have never once debugged. People who need "edit and continue" probably need developer tests instead. You typically edit the test a little, run all the code

python list digest

2010-05-12 Thread Biyana, D. (Dugmore)
Hi All! I have a huge file and I want to extract subtext starting with "{1:" and ending with "-}" inclusive. This subtext recurs in many places in the file and I want the resultant to be in some output file. Any suggestions about the best way forward. Nedbank Limited Reg No

Re: plot debugging problem

2010-05-12 Thread Matteo Landi
On Tue, May 11, 2010 at 8:59 PM, Sandy Sandy wrote: > > 1 > > remember to include the list, > > what does it mean?? I mean that you are leaving out the mlist from your answers. Instead of press _reply_, look for a _reply-to-all_ button. > > 2 > > do you mean > > Pseudo Color Plots > > in > > htt

Re: Picking a license

2010-05-12 Thread Ed Keith
--- On Mon, 5/10/10, Ben Finney wrote: > So I object to muddying the issue by misrepresenting the > source of that > force. Whatever force there is in copyright comes from law, > not any free > software license. You are the one muddying the waters. It does not mater whether you break my kneeca

Queue.Queue() AttributeError exception

2010-05-12 Thread 钟炳勇
I have a multi-thread program work with Queue.Queue(), sometimes put request to the work queue, but throw an exception as below traceback information, it will always throw the exception until restart program, cound please have any experience, your help will be greatly appreciated! File "/usr/

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Lie Ryan
On 05/13/10 03:42, Joel Koltner wrote: > Just curious... in Microsoft's Visual Studio (and I would presume some > other tools), for many languages (both interpreted and compiled!) > there's an "edit and conitnue" option that, when you hit a breakpoint, > allows you to modify a line of code before i

Re: Limitation of os.walk

2010-05-12 Thread kj
In Terry Reedy writes: >On 5/11/2010 3:49 PM, kj wrote: >> PS: I never understood why os.walk does not support hooks for key >> events during such a tree traversal. >Either 1) it is intentionally simple, with the expectation that people >would write there own code for more complicated uses or

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 1:00 pm, Paul Boddie wrote: > On 12 Mai, 16:10, Patrick Maupin wrote: > > > On May 12, 7:10 am, Paul Boddie wrote: > > > What the licence asks you to do and what the author of the licence > > > wants you to do are two separate things. > > > But the whole context was about what RMS wan

Re: How to test whether bit is set within a flag with Python ?

2010-05-12 Thread cjw
On 12-May-10 14:40 PM, MRAB wrote: robert somerville wrote: I am trying to determine how to test whether variors bits are set within a byte (or larger flag) , the python 'and' and 'or' do not seem to be doing what i want .. does anybody have some sample code showing how to do it ?? e.g. (in "C"

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
"Terry Reedy" wrote in message news:mailman.119.1273690025.32709.python-l...@python.org... CPython compiles Python code (a sequence of statements) to its private bytecode (a sequence of codes and operands) and then interprets the bytecode. So 'edit and continue' would have to recompile the stat

Re: Picking a license

2010-05-12 Thread Lie Ryan
On 05/13/10 00:53, Patrick Maupin wrote: > On May 12, 2:19 am, Lie Ryan wrote: >> On 05/12/10 06:50, Patrick Maupin wrote: >> >> >> >>> On May 11, 5:34 am, Paul Boddie wrote: On 10 Mai, 20:36, Patrick Maupin wrote: > The fact is, I know the man would force me to pay for the chocolate,

Re: Limitation of os.walk

2010-05-12 Thread kj
In Tim Chase writes: > 05/11/2010 09:07 PM, Terry Reedy wrote: >> If os.walk were rewritten, it should be as an iterator (generator). >> Directory entry and exit functions could still be added as params. >It *is* an iterator/generator. However, I suspect you mean that >it should slurp the dirs

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Terry Reedy
On 5/12/2010 1:42 PM, Joel Koltner wrote: Just curious... in Microsoft's Visual Studio (and I would presume some other tools), for many languages (both interpreted and compiled!) there's an "edit and conitnue" option that, when you hit a breakpoint, allows you to modify a line of code before it's

Re: Do any debuggers support "edit and continue?"

2010-05-12 Thread Stef Mientki
On 12-05-2010 19:42, Joel Koltner wrote: > Just curious... in Microsoft's Visual Studio (and I would presume some > other tools), for many languages (both interpreted and compiled!) > there's an "edit and conitnue" option that, when you hit a breakpoint, > allows you to modify a line of code before

Re: How to test whether bit is set within a flag with Python ?

2010-05-12 Thread MRAB
robert somerville wrote: I am trying to determine how to test whether variors bits are set within a byte (or larger flag) , the python 'and' and 'or' do not seem to be doing what i want .. does anybody have some sample code showing how to do it ?? e.g. (in "C") unsigned char a = 6; is 3rd b

Re: open(False) in python3

2010-05-12 Thread Dave Angel
Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina : open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together. It does different things depending on the type and quantity of its arguments, and even returns objects

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 12:17 pm, Paul Boddie wrote: > On 12 Mai, 16:45, Patrick Maupin wrote: > > > On May 12, 7:43 am, Paul Boddie wrote: > > > Thus, "owned my soul" joins "holy war" and "Bin Laden" on the list. > > > That rhetorical toolbox is looking pretty empty at this point. > > > Not emptier than you

Re: open(False) in python3

2010-05-12 Thread Terry Reedy
On 5/12/2010 1:26 PM, Giampaolo Rodolà wrote: 2010/5/12 Gabriel Genellina: open() in Python 3 does a lot of things; it's like a mix of codecs.open() + builtin open() + os.fdopen() from 2.x all merged together. It does different things depending on the type and quantity of its arguments, and even

Re: How to? epydoc --top=README

2010-05-12 Thread Phlip
On May 10, 1:29 pm, Phlip wrote: > Pythonistas: > > I have a question to epydoc-devel, but it might be languishing: > > http://sourceforge.net/mailarchive/forum.php?thread_name=l2n860c114f1... > > How do you populate the index.html output with your (insanely clever) > contents of your README file?

How to test whether bit is set within a flag with Python ?

2010-05-12 Thread robert somerville
I am trying to determine how to test whether variors bits are set within a byte (or larger flag) , the python 'and' and 'or' do not seem to be doing what i want .. does anybody have some sample code showing how to do it ?? e.g. (in "C") unsigned char a = 6; is 3rd bit set ?? a & 4 =, true in t

Re: open(False) in python3

2010-05-12 Thread Kushal Kumaran
On Wed, May 12, 2010 at 10:56 PM, Giampaolo Rodolà wrote: > 2010/5/12 Gabriel Genellina : >> open() in Python 3 does a lot of things; it's like a mix of codecs.open() + >> builtin open() + os.fdopen() from 2.x all merged together. It does different >> things depending on the type and quantity of i

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 12 Mai, 16:10, Patrick Maupin wrote: > On May 12, 7:10 am, Paul Boddie wrote: > > What the licence asks you to do and what the author of the licence > > wants you to do are two separate things. > > But the whole context was about what RMS wanted me to do and you > disagreed! What RMS as an ac

RE: Do any debuggers support "edit and continue?"

2010-05-12 Thread Sandy Sandy
good question I also looking for debugging tools like Matlab in Python do you know how to stop in breakpoint investigate the variables by using graphics in figures and continue the mutter is: during debugging the debug processes stacks when fig is created for example, in code import random

Do any debuggers support "edit and continue?"

2010-05-12 Thread Joel Koltner
Just curious... in Microsoft's Visual Studio (and I would presume some other tools), for many languages (both interpreted and compiled!) there's an "edit and conitnue" option that, when you hit a breakpoint, allows you to modify a line of code before it's actually executed. Does any Python deb

Re: open(False) in python3

2010-05-12 Thread Giampaolo Rodolà
2010/5/12 Gabriel Genellina : > open() in Python 3 does a lot of things; it's like a mix of codecs.open() + > builtin open() + os.fdopen() from 2.x all merged together. It does different > things depending on the type and quantity of its arguments, and even returns > objects of different types. > >

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 12 Mai, 16:45, Patrick Maupin wrote: > On May 12, 7:43 am, Paul Boddie wrote: > > Thus, "owned my soul" joins "holy war" and "Bin Laden" on the list. > > That rhetorical toolbox is looking pretty empty at this point. > > Not emptier than you analogy toolbox.  This is really a pretty stupid > a

Re: Why the inconsistent of those two base64 methods?

2010-05-12 Thread Mensanator
On May 12, 4:20 am, Maarten wrote: > On May 12, 6:04 am, Leo Jay wrote: > > > I'd like to encode a string in base64, but I found a inconsistent of > > two methods: > > > >>> 'aaa'.encode('base64') > > 'YWFh\n' > > >>> import base64 > > >>> base64.b64encode('aaa') > > 'YWFh' > > > as you can see,

Re: open(False) in python3

2010-05-12 Thread geremy condra
On Wed, May 12, 2010 at 1:36 AM, Stefan Behnel wrote: > Johan Förberg, 12.05.2010 10:05: >> >> On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: >> >>> so open(False) is the same as open(0), and 0 is the file descriptor >>> associated to standard input. The program isn't hung, it's just

Re: Extract all words that begin with x

2010-05-12 Thread Terry Reedy
On 5/12/2010 11:33 AM, Aahz wrote: also, what if the OP intended "words that begin with x" with x a string (as opposed to a single character) ? word[:len(x)] == x will work in that case. But that's now going to be slower. ;-) (Unless one makes the obvious optimization to hoist len(x)

Re: Extract all words that begin with x

2010-05-12 Thread Stefan Behnel
Aahz, 12.05.2010 17:33: Stefan Behnel wrote: superpollo, 11.05.2010 17:03: Aahz ha scritto: In article, Terry Reedy wrote: On 5/10/2010 5:35 AM, James Mills wrote: On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: Have I missed something, or wouldn't this work just as well: list_of_str

Re: Extract all words that begin with x

2010-05-12 Thread Aahz
In article , Stefan Behnel wrote: >superpollo, 11.05.2010 17:03: >> Aahz ha scritto: >>> In article , >>> Terry Reedy wrote: On 5/10/2010 5:35 AM, James Mills wrote: > On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: >> Have I missed something, or wouldn't this work just as well: >

Re: How to add callbacks that is the same function with different argument in Tkinter python26?

2010-05-12 Thread Dave Angel
Jean-Michel Pichavant wrote: chen zeguang wrote: code is in the end. I want to print different number when pressing different button. Yet the program outputs 8 no matter which button is pressed. I guess it's because the callback function is not established untill the button is pressed, and i ha

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 2:19 am, Lie Ryan wrote: > On 05/12/10 06:50, Patrick Maupin wrote: > > > > > On May 11, 5:34 am, Paul Boddie wrote: > >> On 10 Mai, 20:36, Patrick Maupin wrote: > >>>  The fact is, I know the man would force me to pay for the chocolate, so > >>> in > >>> some cases that enters into

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-12 Thread Michel Claveau - MVP
Hi! If you are under Vista, or Windows 7, have you unactivate UAC, before the update? @+ MCI -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 7:43 am, Paul Boddie wrote: > On 11 Mai, 22:50, Patrick Maupin wrote: > > > On May 11, 5:34 am, Paul Boddie wrote: > > > > Yes, *if* you took it. He isn't forcing you to take it, though, is he? > > > No,  but he said a lot of words that I didn't immediately understand > > about what i

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 7:26 am, Paul Boddie wrote: > On 11 Mai, 23:02, Patrick Maupin wrote: > > Huh? Permissive licenses offer much better certainty for someone > > attempting a creative mash-up.  Different versions of the Apache > > license don't conflict with each other.  If I use an MIT-licensed > > comp

Need help using callables and setup in timeit.Timer

2010-05-12 Thread Matthew Wilson
I want to time some code that depends on some setup. The setup code looks a little like this: >>> b = range(1, 1001) And the code I want to time looks vaguely like this: >>> sorted(b) Except my code uses a different function than sorted. But that ain't important right now. Anyhow, I

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 11, 10:06 pm, Lie Ryan wrote: > The point is, GPL (and OWL) is for programmers who just don't care about > the legal stuffs and would want to spend more time writing code than > writing license. Absolutely. When I wrote "permissive license" I was not trying to imply that everybody should

Re: Picking a license

2010-05-12 Thread Patrick Maupin
On May 12, 7:10 am, Paul Boddie wrote: > On 11 Mai, 22:39, Patrick Maupin wrote: > > > > > OK.  Now I'm REALLY confused.  I said "Certainly RMS > > carefully lays out that the LGPL should be used sparingly in his "Why > > you shouldn't use the Lesser GPL for your next library" post.  (Hint: > > h

Re: How to add callbacks that is the same function with different argument in Tkinter python26?

2010-05-12 Thread Jean-Michel Pichavant
chen zeguang wrote: code is in the end. I want to print different number when pressing different button. Yet the program outputs 8 no matter which button is pressed. I guess it's because the callback function is not established untill the button is pressed, and i has already reached to 8. then

How to add callbacks that is the same function with different argument in Tkinter python26?

2010-05-12 Thread chen zeguang
code is in the end. I want to print different number when pressing different button. Yet the program outputs 8 no matter which button is pressed. I guess it's because the callback function is not established untill the button is pressed, and i has already reached to 8. then How to add callbacks th

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 11 Mai, 22:50, Patrick Maupin wrote: > On May 11, 5:34 am, Paul Boddie wrote: > > > Yes, *if* you took it. He isn't forcing you to take it, though, is he? > > No,  but he said a lot of words that I didn't immediately understand > about what it meant to be free and that it was free, and then af

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 11 Mai, 23:02, Patrick Maupin wrote: > > Huh? Permissive licenses offer much better certainty for someone > attempting a creative mash-up.  Different versions of the Apache > license don't conflict with each other.  If I use an MIT-licensed > component, it doesn't attempt to make me offer my wh

Re: Picking a license

2010-05-12 Thread Paul Boddie
On 11 Mai, 22:39, Patrick Maupin wrote: > > OK.  Now I'm REALLY confused.  I said "Certainly RMS > carefully lays out that the LGPL should be used sparingly in his "Why > you shouldn't use the Lesser GPL for your next library" post.  (Hint: > he's not suggesting a permissive license instead.)" > >

Re: Iterating over dict and removing some elements

2010-05-12 Thread Adi Eyal
> -- Forwarded message -- > From: Bryan > To: python-l...@python.org > Date: Tue, 11 May 2010 23:59:29 -0700 (PDT) > Subject: Re: Iterating over dict and removing some elements > Terry Reedy wrote: > [...] >> for k in [k for k in d if d[k] == 'two']: >>          d.pop(k) > > We hav

Re:[SOLVED] encoding issue (cp720)

2010-05-12 Thread M. Bashir Al-Noimi
Hi Lie, On 12/05/2010 12:14 م, Lie Ryan wrote: On 05/12/10 18:43, M. Bashir Al-Noimi wrote: Hi All, I'm still a newbie in Python (I started learn it yesterday) and I faced a huge problem cuz python always crashes because of encoding issue! Fatal Python error: Py_Initialize: can't

Re: strange interaction between open and cwd

2010-05-12 Thread Albert van der Horst
In article , Grant Edwards wrote: > >Still, at the time, it _seemed_ like a good way to share a directory >of source code amongst multiple projects. I don't remember why >symlinks wouldn't accomplish the task -- something to do with RCS... Must be deep. I use RCS in combination with symlinks a

Re: encoding issue (cp720)

2010-05-12 Thread Lie Ryan
On 05/12/10 18:43, M. Bashir Al-Noimi wrote: > Hi All, > > I'm still a newbie in Python (I started learn it yesterday) and I faced > a huge problem cuz python always crashes because of encoding issue! > >> Fatal Python error: Py_Initialize: can't initialize sys standard streams >> LookupError: u

Re: Why the inconsistent of those two base64 methods?

2010-05-12 Thread Maarten
On May 12, 6:04 am, Leo Jay wrote: > I'd like to encode a string in base64, but I found a inconsistent of > two methods: > > >>> 'aaa'.encode('base64') > 'YWFh\n' > >>> import base64 > >>> base64.b64encode('aaa') > 'YWFh' > > as you can see, the result of > 'aaa'.encode('base64') > has a '\n' at t

client to upload big files via https and get progress info

2010-05-12 Thread News123
Hi, I'd like to perform huge file uploads via https. I'd like to make sure, - that I can obtain upload progress info (sometimes the nw is very slow) - that (if the file exceeds a certain size) I don't have to read the entire file into RAM. I found Active states recipe 146306, which constructs t

Re: Extract all words that begin with x

2010-05-12 Thread superpollo
Stefan Behnel ha scritto: superpollo, 11.05.2010 17:03: Aahz ha scritto: In article , Terry Reedy wrote: On 5/10/2010 5:35 AM, James Mills wrote: On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: Have I missed something, or wouldn't this work just as well: list_of_strings = ['2', 'awes',

Re: Extract all words that begin with x

2010-05-12 Thread Stefan Behnel
superpollo, 11.05.2010 17:03: Aahz ha scritto: In article , Terry Reedy wrote: On 5/10/2010 5:35 AM, James Mills wrote: On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: Have I missed something, or wouldn't this work just as well: list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas

Re: open(False) in python3

2010-05-12 Thread Christian Heimes
Johan Förberg every: That's interesting. Are there any more numbered pseudofiles? I suppose its mainly an excellent way to confuse people when you open(0).read(), but it would be interesting to know. All opened files (and on Unix even network sockets, epoll queues, inotify handlers etc) have a

Re: open(False) in python3

2010-05-12 Thread Stefan Behnel
Johan Förberg, 12.05.2010 10:05: On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: so open(False) is the same as open(0), and 0 is the file descriptor associated to standard input. The program isn't hung, it's just waiting for you to type some text That's interesting. Are there any

Re: virtualenvwrapper for Windows (Powershell)

2010-05-12 Thread Lawrence D'Oliveiro
In message , Guillermo wrote: > On May 12, 4:31 am, Lawrence D'Oliveiro > wrote: > >> In message >> <973ca0fa-4a2f-4e3b-91b9-e38917885...@d27g2000yqc.googlegroups.com>, >> >> Guillermo wrote: >> > On May 11, 7:43 am, Lawrence D'Oliveiro >> > wrote: >> >> >> In message >> >> <22cf35af-44d1-43fe-

Re: Extract all words that begin with x

2010-05-12 Thread Stefan Behnel
Bryan, 12.05.2010 08:55: Now back to the arguably-interesting issue of speed in the particular problem here: 'Superpollo' had suggested another variant, which I appended to my timeit targets, resulting in: [s for s in strs if s.startswith('a')] took: 5.68393977159 [s for s in strs if s[:1] ==

Re: how to import a module for global use in a library package ?

2010-05-12 Thread Jean-Michel Pichavant
Terry Reedy wrote: On 5/11/2010 8:04 AM, Auré Gourrier wrote: I might make one submodule for imports and then do 'from rootlib.util import importmod as m' in the template. But I have no need now for such. Terry Jan Reedy We did that, and we so regret it. After 5 years of intensive dev on tha

Re: virtualenvwrapper for Windows (Powershell)

2010-05-12 Thread Guillermo
On May 12, 4:31 am, Lawrence D'Oliveiro wrote: > In message > <973ca0fa-4a2f-4e3b-91b9-e38917885...@d27g2000yqc.googlegroups.com>, > > Guillermo wrote: > > On May 11, 7:43 am, Lawrence D'Oliveiro > > wrote: > > >> In message > >> <22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com>

Re: open(False) in python3

2010-05-12 Thread Johan Förberg
On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: > so open(False) is the same as open(0), and 0 is the file descriptor > associated to standard input. The program isn't hung, it's just waiting > for you to type some text That's interesting. Are there any more numbered pseudofiles? I s

Re: Is Python a functional programming language?

2010-05-12 Thread Alia Khouri
Paul Rubin: > I like learnyouahaskell.com if you want to get some exposure to Haskell, > probably the archetypal functional language these days.  I've been > fooling with it on and off for the past couple years.  I'm still not > convinced that it's that good a vehicle for practical general purpose

encoding issue (cp720)

2010-05-12 Thread M. Bashir Al-Noimi
Hi All, I'm still a newbie in Python (I started learn it yesterday) and I faced a huge problem cuz python always crashes because of encoding issue! Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: cp720 so I filed a bug report

Re: HTTP Post Request

2010-05-12 Thread kak...@gmail.com
On May 12, 6:13 am, Kushal Kumaran wrote: > On Tue, May 11, 2010 at 3:59 PM, kak...@gmail.com wrote: > > On May 11, 10:56 am, "kak...@gmail.com" wrote: > >> On May 11, 5:06 am, Kushal Kumaran > >> wrote: > > >> > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com > >> > wrote: > >> > > On May

Re: Iterating over dict and removing some elements

2010-05-12 Thread Bryan
Rebelo wrote: > i am wondering why not like this: > >  >>> d = {1: 'one', 2: 'two', 3: 'three'} >  >>> for k,v in d.items(): > ...     if k==1: > ...          del d[k] > ... >  >>> d > {2: 'two', 3: 'three'} >  >>> Mostly because there's no reason to get 'v' if you're not going to use it. That may

Re: accessing superclass methods from subclass

2010-05-12 Thread Bruno Desthuilliers
Chris Rebert a écrit : (snip) Here is how I would rewrite your example: class Shape(object): def __init__(self, x=0, y=0): self.x = x self.y = y @property def location(self): return (self.x, self.y) @location.setter def location(self, val): se

Re: Python-list Digest, Vol 80, Issue 108

2010-05-12 Thread varahalu 2400
please dont send mails From: "python-list-requ...@python.org" To: python-list@python.org Sent: Wed, 12 May, 2010 12:00:02 AM Subject: Python-list Digest, Vol 80, Issue 108 Note: Forwarded message is attached. Send Python-list mailing list submissions to p

Re: Picking a license

2010-05-12 Thread Lie Ryan
On 05/12/10 06:50, Patrick Maupin wrote: > On May 11, 5:34 am, Paul Boddie wrote: >> On 10 Mai, 20:36, Patrick Maupin wrote: >>> The fact is, I know the man would force me to pay for the chocolate, so in >>> some cases that enters into the equation and keeps me from wanting the >>> chocolate. >>

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-12 Thread Werner F. Bruhin
On 11/05/2010 23:13, Martin v. Loewis wrote: When will it install into system32? When you install "for all users". Did the upgrade inform you that it was an upgrade, or did it warn you that you would overwrite the previous installation? It warned me that there is a previous

  1   2   >