Call Java Code from python

2010-08-18 Thread Bidda Gowda
Hi, I have a project coming up where i have to integrate our existing Python based web application with Java Programs. Basically i should be able to call Java programs which comes in the form of jars. Whats the best way to call these jars from python ? I looked at jpype and tried with small

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread John Nagle
On 8/17/2010 11:20 AM, Standish P wrote: On Aug 17, 1:17 am, torb...@diku.dk (Torben Ægidius Mogensen) wrote: Standish Pstnd...@gmail.com writes: [Q] How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ? Because a stack has push and pop, it is able to

Re: Call Java Code from python

2010-08-18 Thread Stefan Schwarzer
Hi Bidda, On 2010-08-18 09:19, Bidda Gowda wrote: I have a project coming up where i have to integrate our existing Python based web application with Java Programs. Basically i should be able to call Java programs which comes in the form of jars. Whats the best way to call these jars from

use of gtk in a nautilus extension

2010-08-18 Thread Nils
Hi, I am having some trouble opening a simple message/dialog to the user from a natilus extension.. I have written a simple nautilus extension using python. It adds one MenuItem to the context menu. for testing I wanted to open a simple dialog when the user clicks this menuitem. (The code can be

Re: 79 chars or more?

2010-08-18 Thread Lie Ryan
On 08/17/10 12:59, AK wrote: On 08/16/2010 10:42 PM, James Mills wrote: On Tue, Aug 17, 2010 at 12:35 PM, AKandrei@gmail.com wrote: As monitors are getting bigger, is there a general change in opinion on the 79 chars limit in source files? I've experimented with 98 characters per line

Re: 79 chars or more?

2010-08-18 Thread Lawrence D'Oliveiro
In message i4e4o6$gc...@localhost.localdomain, Martin Gregorie wrote: 1) ssh terminal windows generally come up as 24 x 80 My terminal windows come up by default at something like 40 lines by 100 characters. 2) at 24 x 80 I can get more ssh terminal windows on the desktop with minimal

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Nick Keighley
On 17 Aug, 18:34, Standish P stnd...@gmail.com wrote: On Aug 16, 11:09 am, Elizabeth D Rather erat...@forth.com wrote: On 8/15/10 10:33 PM, Standish P wrote: If Forth is a general processing language based on stack, is it possible to convert any and all algorithms to stack based ones and

Re: Python Developer - HFT Trading firm - Chicago, IL

2010-08-18 Thread Matteo Landi
Hi Rich, I think it's better for you to post the message here ( http://www.python.org/community/jobs/ ). Regards, On Tue, Aug 17, 2010 at 6:07 PM, Rich Moss moss.r...@gmail.com wrote: Python developer needed for math/trading applications and research at leading HFT firm. The person we are

Re: 79 chars or more?

2010-08-18 Thread Jean-Michel Pichavant
D'Arcy J.M. Cain wrote: On Tue, 17 Aug 2010 16:28:02 +0200 Stefan Schwarzer sschwar...@sschwarzer.net wrote: I'd probably reformat this to self.expiration_date = translate_date( find(response, 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y') or even

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Nick Keighley
On 17 Aug, 21:37, Elizabeth D Rather erat...@forth.com wrote: On 8/17/10 10:19 AM, Standish P wrote On Aug 17, 12:32 pm, John Passanitijohn.passan...@gmail.com  wrote: It is true that the other languages such as F/PS also have borrowed lists from lisp in the name of nested-dictionaries and

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Nik Gr
Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε: On 17Aug2010 20:15, Νίκοςnikos.the.gr...@gmail.com wrote: | === | cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = | '%s' ORDER BY date DESC ''' % (page) ) | === |

Re: 79 chars or more?

2010-08-18 Thread Stefan Schwarzer
Hi Lie, On 2010-08-18 12:02, Lie Ryan wrote: On 08/17/10 12:59, AK wrote: On 08/16/2010 10:42 PM, James Mills wrote: My personal opinion (despite monitors being wider) is the horizontal scrolling isn't worth it. Stick to a 80-char width. But.. why horizontal scrolling, isn't autowrap much

Re: Working with PDFs?

2010-08-18 Thread Anssi Saari
jyoun...@kc.rr.com writes: - Pull out text from each PDF page (to search for specific words) - Combine separate pdf documents into one document - Add bookmarks (with destination settings) PDF Shuffler is a Python app which does PDF merging and splitting very well. I don't think it does

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Cameron Simpson
On 18Aug2010 12:07, Nik Gr nikos.the.gr...@gmail.com wrote: | Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε: | On 17Aug2010 20:15, Νίκοςnikos.the.gr...@gmail.com wrote: | | === | | cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = | | '%s'

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread spinoza1111
On Aug 18, 1:21 am, Standish P stnd...@gmail.com wrote: Garbage collection doesn't use a stack. It uses a heap, which is in the abstract a collection of memory blocks of different lengths, divided into two lists, generally represented as linked lists: 1.  A list of blocks that are free

Re: 79 chars or more?

2010-08-18 Thread BartC
Roy Smith r...@panix.com wrote in message news:roy-319e47.09055017082...@news.panix.com... In article i4deqq$4e...@lust.ihug.co.nz, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.2212.1282012525.1673.python-l...@python.org, AK wrote: As monitors are

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Tim Chase
On 08/18/10 04:50, Cameron Simpson wrote: (nikos,) is a single element tuple. [nikos] is a single element list. [nikos,] is also a single element list, just written like the tuple. You don't see the [nikos,] form very often because [nikos] is not ambiguous. I most frequently see/use the

Re: 79 chars or more?

2010-08-18 Thread Lawrence D'Oliveiro
In message 4c6a9c72.4040...@sschwarzer.net, Stefan Schwarzer wrote: self.expiration_date = translate_date( find(response, 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y') Might I suggest (guessing at the argument keywords here) :

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread News123
On 08/17/2010 11:44 PM, Baba wrote: On Aug 16, 6:28 pm, cbr...@cbrownsystems.com cbr...@cbrownsystems.com wrote: First, suppose d = gcd(x, y, z); then for some x', y', z' we have that x = d*x', y = d*y', z = d*z'; and so for any a, b, c: could you explain the notation? what is

Python 2.7 support for PyWin32

2010-08-18 Thread paulo.jpi...@gmail.com
Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: 79 chars or more?

2010-08-18 Thread Roy Smith
In article qkoao.53872$gq5.12...@hurricane, BartC ba...@freeuk.com wrote: Remember, the old hardcopy terminals used to produce 132-character-wide listings. Those of you who think old hardcopy terminals did 132 wide obviously don't remember the ASR-33 :-) ASR33s I think might have

Re: 79 chars or more?

2010-08-18 Thread Roy Smith
In article 4c6b9...@dnews.tpgi.com.au, Lie Ryan lie.1...@gmail.com wrote: On 08/17/10 12:59, AK wrote: On 08/16/2010 10:42 PM, James Mills wrote: On Tue, Aug 17, 2010 at 12:35 PM, AKandrei@gmail.com wrote: As monitors are getting bigger, is there a general change in opinion on the

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Mark Lawrence
On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It was created on 2009-07-08!!! See:-

when 'myArray * 'myObject' is not equal to 'myObject' * 'myArray'

2010-08-18 Thread Duim
Although I'm sure somewhere this issue is discussed in this (great) group, I didn't know the proper search words for it (although I tried). I'm using python (2.6) scientifically mostly, and created a simple class to store time series (my 'Signal' class). I need this class to have a possibility to

error Compile libxml2 from python 2.6.4

2010-08-18 Thread Mauricio Martinez Garcia
Hi!. Have the next error on install libxml2. python/bin/python setup.py install failed to find headers for libxml2: update includes_dir This my version of python == /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python/bin/python Python 2.6.5 (r265:79063,

Re: 79 chars or more?

2010-08-18 Thread BartC
Roy Smith r...@panix.com wrote in message news:roy-181632.07571818082...@news.panix.com... In article qkoao.53872$gq5.12...@hurricane, BartC ba...@freeuk.com wrote: Remember, the old hardcopy terminals used to produce 132-character-wide listings. Those of you who think old hardcopy

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Nan
On Aug 17, 8:14 pm, Albert Hopkins mar...@letterboxes.org wrote: On Tue, 2010-08-17 at 12:55 -0700, Nan wrote: Hi folks -- I have a Python script running under Apache/mod_wsgi that needs to reload Apache configs as part of its operation.  The script continues to execute after the

Re: 79 chars or more?

2010-08-18 Thread AK
On 08/18/2010 05:11 AM, Stefan Schwarzer wrote: Hi Lie, On 2010-08-18 12:02, Lie Ryan wrote: On 08/17/10 12:59, AK wrote: On 08/16/2010 10:42 PM, James Mills wrote: My personal opinion (despite monitors being wider) is the horizontal scrolling isn't worth it. Stick to a 80-char width.

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Frederic Rentsch
On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote: On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote: How about [obj for obj in dataList if obj.number == 100] That should create a list of all objects whose .number is 100. No need to cycle through a loop. What

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Tim Golden
On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It already does and has done for a while: http://sourceforge.net/projects/pywin32/files/

Re: 79 chars or more?

2010-08-18 Thread D'Arcy J.M. Cain
On Wed, 18 Aug 2010 23:18:06 +1200 Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: Might I suggest (guessing at the argument keywords here) : self.expiration_date = translate_date \ ( TheText = find(response, 'MPNExpirationDate').text, ToFormat

Re: 79 chars or more?

2010-08-18 Thread D'Arcy J.M. Cain
On Wed, 18 Aug 2010 10:57:00 +0200 Jean-Michel Pichavant jeanmic...@sequans.com wrote: D'Arcy J.M. Cain wrote: You can extend this if there are complicated sub-calls. Probably overkill for this example but here is the idea. self.expiration_date = translate_date(

Required Buy Palm Jumeirah aprt AND Springs villa, 050-8320722

2010-08-18 Thread PETER WONG F H (+971 50 8320722)
Dear I have a client who is looking to buy apartment and Villa : 1. the palm jumeirah 3 bed + maid room sea view only (any building) 2. springs type 3E 3. springs type 3M 4. springs type 4E Please send me your direct availabilities, or call me, viewing tomorrow, thank you!

Re: Python 2.7 support for PyWin32

2010-08-18 Thread paulo.jpi...@gmail.com
Thanks for the heads up. My error was to only look for the green download button. There you still get 2.6 as default download. -- Paulo On Aug 18, 4:28 pm, Tim Golden m...@timgolden.me.uk wrote: On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Albert Hopkins
On Wed, 2010-08-18 at 06:58 -0700, Nan wrote: Ah, I'd been told that there would be no conflict, and that this was just reloading the configuration, not restarting Apache. I do need the web app to instruct Apache to reload because just before this it's creating new VirtualHosts that need to

Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello I am generating a PDF in web2py but its ignoring my line breaks. randname = random.randrange(1, 10001) styles = getSampleStyleSheet() title = My Title doc = SimpleDocTemplate(primer.pdf) story = [] story.append(Paragraph(strftime(%a, %d %b %Y

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello I am generating a PDF in web2py but its ignoring my line breaks. randname = random.randrange(1, 10001) styles = getSampleStyleSheet() title = My Title doc = SimpleDocTemplate(primer.pdf) story = []

Using re.sub with %s

2010-08-18 Thread Brandon Harris
Having trouble using %s with re.sub test = '/my/word/whats/wrong' re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) return is /my/@0/whats/wrong however if I cast a value with letters as opposed to numbers re.sub('(/)word(/)', r'\1\%s\2'%'gosh', test) return is /my/gosh/whats/wrong Any help

Re: 79 chars or more?

2010-08-18 Thread Neil Cerutti
On 2010-08-18, D'Arcy J.M. Cain da...@druid.net wrote: The other thing that jumps out at me is having the input format different than the output format. In any case you need a better date input function. There's no reason in this day and age to force users into a particular input form. You

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 17, 2:44 pm, Baba raoul...@gmail.com wrote: On Aug 16, 6:28 pm, cbr...@cbrownsystems.com cbr...@cbrownsystems.com wrote: First, suppose d = gcd(x, y, z); then for some x', y', z' we have that x = d*x', y = d*y', z = d*z'; and so for any a, b, c:    could you explain the notation?

Re: Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello yes This line doesn't seem to want to accept a list for some strange reason story.append(Paragraph(str(result_list), para)) *cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread Baba
Hi Chas Thanks for that and i agree on your last remark :) re the number of required consecutive passes required: The number of required consecutive passes is equal to the smallest number because after that you can get any amount of nuggets by just adding the smallest nugget pack to some other

Re: Using re.sub with %s

2010-08-18 Thread Thomas Jollans
On Wednesday 18 August 2010, it occurred to Brandon Harris to exclaim: Having trouble using %s with re.sub test = '/my/word/whats/wrong' re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) return is /my/@0/whats/wrong This has nothing to do with %, of course: re.sub('(/)word(/)',

expression in an if statement

2010-08-18 Thread ernest
Hi, In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? Thanks in advance. Ernest -- http://mail.python.org/mailman/listinfo/python-list

Re: expression in an if statement

2010-08-18 Thread Peter Otten
ernest wrote: In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? a = abc b = def _set = set def set(x): ... print computing set(%r) % x ... return _set(x) ... if set(a).union(b) == set(a): pass ... computing set('abc') computing set('abc') So

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 18, 10:52 am, Baba raoul...@gmail.com wrote: Hi Chas Thanks for that and i agree on your last remark :) re the number of required consecutive passes required: The number of required consecutive passes is equal to the smallest number because after that you can get any amount of

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Alex McDonald
On 18 Aug, 11:09, spinoza spinoza1...@yahoo.com wrote: On Aug 18, 1:21 am, Standish P stnd...@gmail.com wrote: This you might want to take this to the Forth people because they are marketing their language as a cure for all that plagues programming today. No, they're not. That I

Re: Using re.sub with %s

2010-08-18 Thread MRAB
Thomas Jollans wrote: On Wednesday 18 August 2010, it occurred to Brandon Harris to exclaim: Having trouble using %s with re.sub test = '/my/word/whats/wrong' re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) return is /my/@0/whats/wrong This has nothing to do with %, of course:

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread John Posner
On 8/18/2010 1:38 PM, cbr...@cbrownsystems.com wrote: To go the other way, if d = 1, then there exists integers (not neccessarily positive) such that a*x + b*y + c*z = 1 That fact is non-trivial, although the proof isn't *too* hard [1]. I found it interesting to demonstrate the simpler

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello yes This line doesn't seem to want to accept a list for some strange reason story.append(Paragraph(str(result_list), para)) From the documentation it appears that you need to pass a string. You're just passing the result of str(result_list), which isn't giving you

Re: Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello ty for the fast replies This is the string I am using for the PDF I was able to create new lines using the HTML br tag which is what I wanted a method to create new lines search_str=Position: (%d) - Keyword: (%s) - Domain (%s) br /br / % (idx+1, target_keyword, session.target_domain)

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Terry Reedy
On 8/18/2010 8:33 AM, Mark Lawrence wrote: On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It was created on 2009-07-08!!! See:-

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello ty for the fast replies This is the string I am using for the PDF I was able to create new lines using the HTML br tag which is what I wanted a method to create new lines search_str=Position: (%d) - Keyword: (%s) - Domain (%s) br /br / % (idx+1, target_keyword,

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Elizabeth D Rather
On 8/18/10 12:09 AM, spinoza wrote: On Aug 18, 1:21 am, Standish Pstnd...@gmail.com wrote: Garbage collection doesn't use a stack. It uses a heap, which is in the abstract a collection of memory blocks of different lengths, divided into two lists, generally represented as linked lists:

Re: scipy / stats : quantiles using sample weights from survey data

2010-08-18 Thread Aahz
In article 94bb6313-1b09-4eeb-9969-07d76048a...@m35g2000prn.googlegroups.com, Christopher Barrington-Leigh christophe...@gmail.com wrote: There is a function scipy.stats.mstats.mquantiles that returns quantiles for a vector of data. But my data should not be uniformly weighted in an estimate of

Re: assigning variables from list data

2010-08-18 Thread Aahz
In article mailman.1627.1281018398.1673.python-l...@python.org, Chris Hare ch...@labr.net wrote: cursor.execute('select * from net where NetNumber 0') Unless your table is guaranteed to never change layout, I suggest that instead listing fields is a Good Idea: cursor.execute('select

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 18, 11:50 am, John Posner jjpos...@optimum.net wrote: On 8/18/2010 1:38 PM, cbr...@cbrownsystems.com wrote: To go the other way, if d = 1, then there exists integers (not neccessarily positive) such that a*x + b*y + c*z = 1 That fact is non-trivial, although the proof isn't *too*

Re: when 'myArray * 'myObject' is not equal to 'myObject' * 'myArray'

2010-08-18 Thread Nobody
On Wed, 18 Aug 2010 05:56:27 -0700, Duim wrote: Although I'm sure somewhere this issue is discussed in this (great) group, I didn't know the proper search words for it (although I tried). I'm using python (2.6) scientifically mostly, and created a simple class to store time series (my

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Nan
On Aug 18, 12:37 pm, Albert Hopkins mar...@letterboxes.org wrote: On Wed, 2010-08-18 at 06:58 -0700, Nan wrote: Ah, I'd been told that there would be no conflict, and that this was just reloading the configuration, not restarting Apache. I do need the web app to instruct Apache to reload

q.join() is probably the wrong method for you

2010-08-18 Thread Raymond Hettinger
The join() method is all about waiting for all the tasks to be done. If you don't care whether the tasks have actually finished, you can periodically poll the unfinished task count: stop = time() + timeout while q.unfinished_tasks and time() stop: sleep(1) This loop will exist either

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Paul Rubin
Elizabeth D Rather erat...@forth.com writes: Processors seldom could multitask, so it wasn't recognized that the stack could be a performance bottleneck Lol. Forth supported multitasking on every processor it was implemented on in the 70's, with blazing speed compared to competitive

Re: Python why questions

2010-08-18 Thread AK
On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, D'Arcy J.M. Cainda...@druid.net wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old? Zero based counting is perfectly natural. You're confusing

Re: Python why questions

2010-08-18 Thread AK
On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, D'Arcy J.M. Cainda...@druid.net wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old? Zero based counting is perfectly natural. You're confusing

Re: expression in an if statement

2010-08-18 Thread John Nagle
On 8/18/2010 11:24 AM, ernest wrote: Hi, In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? CPython does. Shed Skin might optimize. Don't know about Iron Python. John Nagle --

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread John Nagle
On 8/18/2010 1:32 PM, Paul Rubin wrote: Elizabeth D Rathererat...@forth.com writes: Processors seldom could multitask, so it wasn't recognized that the stack could be a performance bottleneck Lol. Forth supported multitasking on every processor it was implemented on in the 70's, with blazing

Re: Python why questions

2010-08-18 Thread Russ P.
On Aug 18, 2:01 pm, AK andrei@gmail.com wrote: On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, D'Arcy J.M. Cainda...@druid.net  wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old?  Zero

Re: Python why questions

2010-08-18 Thread Mark Lawrence
On 18/08/2010 22:47, Russ P. wrote: On Aug 18, 2:01 pm, AKandrei@gmail.com wrote: On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, D'Arcy J.M. Cainda...@druid.netwrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more

Re: exception handling with sqlite db errors

2010-08-18 Thread CM
On Aug 12, 3:31 pm, a...@pythoncraft.com (Aahz) wrote: In article 2a47b306-45d1-474a-9f8e-5b71eba62...@p11g2000prf.googlegroups.com, CM cmpyt...@gmail.com wrote: Maybe it's not much of an issue, but I think it would be a shame if occasional hangs/crashes could be caused by these (rare?)

Re: expression in an if statement

2010-08-18 Thread Thomas Jollans
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim: On 8/18/2010 11:24 AM, ernest wrote: Hi, In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? CPython does. Shed Skin might optimize. Don't know about Iron Python. I doubt

Re: Unsupported Format Character '' (0x26)

2010-08-18 Thread Andrew Evans
nvm I got it by adding s and d respectively after each value eg %(query)s thank you all On Wed, Aug 18, 2010 at 4:35 PM, Andrew Evans randra...@gmail.com wrote: I get an error message Unsupported Format Character '' (0x26) I narrowed it down to these two variables any idea how to fix it?

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Standish P
On Aug 18, 12:30 pm, Elizabeth D Rather erat...@forth.com wrote: On 8/18/10 12:09 AM, spinoza wrote: On Aug 18, 1:21 am, Standish Pstnd...@gmail.com  wrote: Garbage collection doesn't use a stack. It uses a heap, which is in the abstract a collection of memory blocks of different

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Standish P
On Aug 17, 6:38 pm, John Passaniti john.passan...@gmail.com wrote: You asked if Forth borrowed lists from Lisp.  It did not.  In Lisp, lists are constructed with pair of pointers called a cons cell. That is the most primitive component that makes up a list.  Forth has no such thing; in Forth,

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Keith Thompson
Standish P stnd...@gmail.com writes: On Aug 18, 12:30 pm, Elizabeth D Rather erat...@forth.com wrote: [...] Mostly it had a snowball's chance because it was never picked up by the CS gurus who, AFAIK, never really took a serious look at it. Its quite possible that the criticism is unfair, but

How to see intermediate fail results from unittest as tests are running?

2010-08-18 Thread Margie Roginski
Hi, I am using unittest in a fairly basic way, where I have a single file that simply defines a class that inherits from unittest.TestCase and then within that class I have a bunch of methods that start with test. Within that file, at the bottom I have: if __name__ == __main__:

Re: Python why questions

2010-08-18 Thread Dan Sommers
On Wed, 18 Aug 2010 16:56:22 -0400, AK wrote: Contrast this with _one_ example that was repeated in this thread of there being ground floor, 1st floor, 2nd, and so on. However! Consider that ground floor is kind of different from the other floors. It's the floor that's not built up over

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Steven D'Aprano
On Wed, 18 Aug 2010 16:03:58 +0200, Frederic Rentsch wrote: On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote: On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote: How about [obj for obj in dataList if obj.number == 100] That should create a list of all objects whose

Re: Python why questions

2010-08-18 Thread Steven D'Aprano
On Wed, 18 Aug 2010 14:47:08 -0700, Russ P. wrote: Is the top team in the league the number 1 team -- or the number 0 team? I have yet to hear anyone call the best team the number 0 team! Why is the top team the one with the lowest number? Unfortunately, we're stuck with this goofy

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Elizabeth D Rather
On 8/18/10 2:23 PM, Standish P wrote: On Aug 17, 6:38 pm, John Passanitijohn.passan...@gmail.com wrote: You asked if Forth borrowed lists from Lisp. It did not. In Lisp, lists are constructed with pair of pointers called a cons cell. That is the most primitive component that makes up a

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Tim Chase
On 08/18/10 21:47, Steven D'Aprano wrote: Frankly, I think the OP doesn't really know what he wants, other than premature optimization. It's amazing how popular that is :) You see, the trick to prematurely optimizing is to have a good algorithm for prematurely optimizing...the real question

Re: expression in an if statement

2010-08-18 Thread Daniel Kluev
On Thu, Aug 19, 2010 at 9:12 AM, Thomas Jollans tho...@jollybox.de wrote: I doubt any actual Python implementation optimizes this -- how could it? The object set is clearly being called twice, and it happens to be called with the object a as a sole argument twice. What if set has side

Re: Python why questions

2010-08-18 Thread Russ P.
On Aug 18, 7:58 pm, Steven D'Aprano steve-REMOVE- t...@cybersource.com.au wrote: On Wed, 18 Aug 2010 14:47:08 -0700, Russ P. wrote: Is the top team in the league the number 1 team -- or the number 0 team? I have yet to hear anyone call the best team the number 0 team! Why is the top team

Simple hack to get $5000 to your Paypal account

2010-08-18 Thread Hot sex
Simple hack to get $5000 to your Paypal account At http://simplelivevideos.tk i have hidden the Paypal Form link in an image. in that website on Right Side below search box, click on image and enter your name and Paypal ID. -- http://mail.python.org/mailman/listinfo/python-list

[issue9598] untabify.py fails on files that contain non-ascii characters

2010-08-18 Thread Popa Claudiu
Popa Claudiu pcmantic...@gmail.com added the comment: Hello. As it seems, untabify.py opens the file using the builtin function open, making the call error-prone when encountering non-ascii character. The proper handling should be done by using open from codecs library, specifying the encoding

[issue9631] Python 2.7 installation issue for Linux Red Hat 4.1

2010-08-18 Thread Prakash Palanivel
Prakash Palanivel spprakash...@gmail.com added the comment: After complete the installation the below error message was displayed.Kindly check and revert. ./python -E ./setup.py install \ --prefix=/usr/local/python-2.7 \ --install-scripts=/usr/local/python-2.7/bin \

[issue5215] change value of local variable in debug

2010-08-18 Thread Markus Pröller
Markus Pröller mproel...@googlemail.com added the comment: Hello, I changed pdb.py to the file I added in the attachment (I just used the given patch pdb_cache_f_locals.patch) Then I created the following file: import pdb def function_1(number): stack_1 = number function_2(stack_1)

[issue5215] change value of local variable in debug

2010-08-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Ah, the patch is buggy; it was corrected with r71019 which indeed fixes up and down. You could try to apply this change to your local copy. Also consider upgrading to 2.7, where everything works as expected... --

[issue9631] Python 2.7 installation issue for Linux Red Hat 4.1

2010-08-18 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: What file system is this on? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9631 ___ ___

[issue9631] Python 2.7 installation issue for Linux Red Hat 4.1

2010-08-18 Thread Prakash Palanivel
Prakash Palanivel spprakash...@gmail.com added the comment: After Installed the following error was through: PYTHONPATH=/usr/local/Python-2.7/lib/python2.7 \ ./python -Wi -tt /usr/local/Python-2.7/lib/python2.7/compileall.py \ -d /usr/local/Python-2.7/lib/python2.7 -f \

[issue672656] securing pydoc server

2010-08-18 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: This looks weird, a security issue with a low priority??? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue672656

[issue9631] Python 2.7 installation issue for Linux Red Hat 4.1

2010-08-18 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: spprakash, do the following, in your python2.7 checkout (or download): do make distclean ./configure make make install If there is any failure in make/make install of the above steps, please paste that error message and also provide the

[issue5215] change value of local variable in debug

2010-08-18 Thread Markus Pröller
Markus Pröller mproel...@googlemail.com added the comment: Okay, thanks for giving me the correct patch, but I still face the following problem (with the same code snippet): c:\tst_pdb.py(14)function_3() - print stack_3 (Pdb) l 9 function_3(stack_2) 10 11 def

[issue9433] regrtest.py -j 2 doesn't work on Windows: remove close_fds=True on Windows

2010-08-18 Thread Tim Golden
Tim Golden m...@timgolden.me.uk added the comment: I can confirm that the patched regrtest runs ok on WinXP. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9433 ___

[issue8622] Add PYTHONFSENCODING environment variable

2010-08-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: Here you have a patch. It adds tests in test_sys. The tests are skipped on a non-ascii Python executable path because of #8611 (see #9425).

[issue5215] change value of local variable in debug

2010-08-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Right, this last problem still exists with 2.7 or 3.1. Please open a new tracker item for it, and let's close this one. -- ___ Python tracker rep...@bugs.python.org

[issue8622] Add PYTHONFSENCODING environment variable

2010-08-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The command line -h explanation is missing from the patch. done The documentation should mention that the env var is only read once; subsequent changes to the env var are not seen by Python I copied the PYTHONIOENCODING doc

[issue9632] Remove sys.setfilesystemencoding()

2010-08-18 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: sys.setfilesystemencoding() function is dangerous because it introduces a lot of inconsistencies: this function is unable to reencode all filenames in all objects (eg. Python is unable to find filenames in user objects or 3rd

[issue9632] Remove sys.setfilesystemencoding()

2010-08-18 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- keywords: +patch nosy: +Arfrever, lemburg, pitrou Added file: http://bugs.python.org/file18565/remove_sys_setfilesystemencoding.patch ___ Python tracker rep...@bugs.python.org

[issue8622] Add PYTHONFSENCODING environment variable

2010-08-18 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18562/pythonfsencoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8622 ___

[issue8622] Add PYTHONFSENCODING environment variable

2010-08-18 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: To remove sys.setfilesystemencoding(), ... I will open a new issue done, issue #9632 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8622

[issue9633] pdb go stack up/down

2010-08-18 Thread Markus Pröller
New submission from Markus Pröller mproel...@googlemail.com: Hello, with python 2.7 I encounter the following problem: I have created the following sample script: import pdb def function_1(number): stack_1 = number function_2(stack_1) def function_2(number): stack_2 = number

  1   2   3   >