Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ nikos.gr...@gmail.com writes: How can i update the databse to only contain the existing filenames without losing the previous stored data? Basically you need to keep a list (or better, a set) containing all current filenames that you are going to insert, and finally do another

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 6 Μαρτίου 2013 10:19:06 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: Νίκος Γκρ33κ nikos.gr...@gmail.com writes: How can i update the databse to only contain the existing filenames without losing the previous stored data? Basically you need to keep a list (or better, a

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Roland Koebler
Hi, On Tue, Mar 05, 2013 at 09:39:19AM -0800, Νίκος Γκρ33κ wrote: But i did, I just tried this: # open html template if htmlpage.endswith('.html'): f = open( /home/nikos/public_html/ + htmlpage ) htmldata = f.read() counter =

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ nikos.gr...@gmail.com writes: Thank you very much for making things clear to me!! You're welcome, even more if you spend 1 second to trim your answers removing unneeded citation :-) But there is a slight problem when iam trying to run the code iam presenting this error ehre

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Νίκος Γκρ33κ
Its about the following line of code: current_fullpaths.add( os.path.join(root, files) ) that presents the following error: type 'exceptions.AttributeError': 'list' object has no attribute 'startswith' args = ('list' object has no attribute 'startswith',) message = 'list' object

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Νίκος Γκρ33κ
Perhaps because my filenames is in greek letters that thsi error is presented but i'am not sure. Maybe we can join root+files and store it to the set() someway differenyl -- http://mail.python.org/mailman/listinfo/python-list

Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Wong Wah Meng-R32813
Hello there, I am using python 2.7.1 built on HP-11.23 a Itanium 64 bit box. I discovered following behavior whereby the python process doesn't seem to release memory utilized even after a variable is set to None, and deleted. I use glance tool to monitor the memory utilized by this process.

Re: book advice

2013-03-06 Thread rusi
On Mar 2, 1:59 am, leonardo selmi l.se...@icloud.com wrote: hi is there anyone can suggest me a good book to learn python? i read many but there is always something unclear or examples which give me errors. The following written assuming you are as new to programming generally as to python

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Bryan Devaney
On Wednesday, March 6, 2013 9:43:34 AM UTC, Νίκος Γκρ33κ wrote: Perhaps because my filenames is in greek letters that thsi error is presented but i'am not sure. Maybe we can join root+files and store it to the set() someway differenyl well, the error refers to the line if

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ nikos.gr...@gmail.com writes: Its about the following line of code: current_fullpaths.add( os.path.join(root, files) ) I'm sorry, typo on my part. That should have been fullpath, not file (and neither files as you wrongly reported back!): # Compute a set of current fullpaths

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Bryan Devaney
On Wednesday, March 6, 2013 10:11:12 AM UTC, Wong Wah Meng-R32813 wrote: Hello there, I am using python 2.7.1 built on HP-11.23 a Itanium 64 bit box. I discovered following behavior whereby the python process doesn't seem to release memory utilized even after a variable is set to

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Terry Reedy
On 3/6/2013 5:11 AM, Wong Wah Meng-R32813 wrote: Hello there, I am using python 2.7.1 built on HP-11.23 a Itanium 64 bit box. I discovered following behavior whereby the python process doesn't seem to release memory utilized even after a variable is set to None, and deleted. I use glance tool

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Mark Lawrence
On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: I'am using this snipper to read a current directory and insert all filenames into a databse and then display them. But what happens when files are get removed form the directory? The inserted records into databse remain. How can i update the databse to

RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Wong Wah Meng-R32813
Apologies as after I have left the group for a while I have forgotten how not to post a question on top of another question. Very sorry and appreciate your replies. I tried explicitly calling gc.collect() and didn't manage to see the memory footprint reduced. I probably haven't left the

RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Wong Wah Meng-R32813
Thanks for youre reply. I built python 2.7.1 binary myself on the HP box and I wasn't aware there is any configuration or setup that I need to modify in order to activate or engage the garbage collection (or even setting the memory size used). Probably you are right it leaves it to the OS

Re: Difference in RE between 3.2 and 3.3 (or Aaron Swartz memorial)

2013-03-06 Thread Matej Cepl
On 2013-02-26, 16:25 GMT, Terry Reedy wrote: On 2/21/2013 4:22 PM, Matej Cepl wrote: as my method to commemorate Aaron Swartz, I have decided to port his html2text to work fully with the latest python 3.3. After some time dealing with various bugs, I have now in my repo

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Dave Angel
On 03/06/2013 05:25 AM, Bryan Devaney wrote: On Wednesday, March 6, 2013 10:11:12 AM UTC, Wong Wah Meng-R32813 wrote: Hello there, I am using python 2.7.1 built on HP-11.23 a Itanium 64 bit box. I discovered following behavior whereby the python process doesn't seem to release memory

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Dave Angel
On 03/06/2013 07:31 AM, Wong Wah Meng-R32813 wrote: Apologies as after I have left the group for a while I have forgotten how not to post a question on top of another question. Very sorry and appreciate your replies. I tried explicitly calling gc.collect() and didn't manage to see the memory

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Dave Angel
On 03/06/2013 05:27 AM, Lele Gaifax wrote: Νίκος Γκρ33κ nikos.gr...@gmail.com writes: Its about the following line of code: current_fullpaths.add( os.path.join(root, files) ) I'm sorry, typo on my part. That should have been fullpath, not file (and neither files as you wrongly reported

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Chris Angelico
On Wed, Mar 6, 2013 at 10:52 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: blah blah blah blah blah blah blah blah blah You were told yesterday at least twice that os.walk returns a tuple but you still insist on refusing to take any notice of our

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Michael Ross
On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: I'am using this snipper to read a current directory and insert all filenames into a databse and then display them. But what happens when files are get removed form the

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread Roy Smith
In article c2184b42-41be-4930-9501-361296df7...@googlegroups.com, fa...@squashclub.org wrote: Instead of: 1.8e-04 I need: 1.8e-004 So two zeros before the 4, instead of the default 1. Just out of curiosity, what's the use case here? --

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Lele Gaifax
Dave Angel da...@davea.name writes: # Compute a set of current fullpaths current_fullpaths = set() for root, dirs, files in os.walk(path): for fullpath in files: 'fullpath' is a rather misleading name to use, since the 'files' list contains only the terminal node of the file

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread jmfauth
On 6 mar, 15:03, Roy Smith r...@panix.com wrote: In article c2184b42-41be-4930-9501-361296df7...@googlegroups.com,  fa...@squashclub.org wrote: Instead of: 1.8e-04 I need: 1.8e-004 So two zeros before the 4, instead of the default 1. Just out of curiosity, what's the use case

Creating an object that can track when its attributes are modified

2013-03-06 Thread Ben Sizer
I am trying to make an object that can track when its attributes have been assigned new values, and which can rollback to previous values where necessary. I have the following code which I believe works, but would like to know if there are simpler ways to achieve this goal, or if there are any

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread nagia . retsina
Τη Τετάρτη, 6 Μαρτίου 2013 4:04:26 μ.μ. UTC+2, ο χρήστης Michael Ross έγραψε: On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: I'am using this snipper to read a current directory and insert all

Re: Creating an object that can track when its attributes are modified

2013-03-06 Thread Ben Sizer
On Wednesday, 6 March 2013 16:22:56 UTC, Chris Angelico wrote: Effectively, you would need to have a subclass of list/dict/tuple/whatever that can respond to the change. This is certainly something I'd be interested in having, but I guess that would be fragile since the user would have the

Detecting the end of the program using bdb

2013-03-06 Thread Alexandre Zani
Hello all, I am attempting to write a remote debugger using bdb. One problem I am running into is that if I call self.set_next when on the last line of my program, I see this line printed: Exception AttributeError: 'NoneType' object has no attribute 'path' in function _remove at 0x7f97639b4668

Re: Creating an object that can track when its attributes are modified

2013-03-06 Thread Lele Gaifax
Ben Sizer kylo...@gmail.com writes: I also believe that this won't catch modification to existing attributes as opposed to assignments: eg. if one of the attributes is a list and I append to it, this system won't notice. Is that something I can rectify easily? It's really up to how far you

Re: Creating an object that can track when its attributes are modified

2013-03-06 Thread Chris Angelico
On Thu, Mar 7, 2013 at 3:56 AM, Ben Sizer kylo...@gmail.com wrote: On Wednesday, 6 March 2013 16:22:56 UTC, Chris Angelico wrote: Effectively, you would need to have a subclass of list/dict/tuple/whatever that can respond to the change. This is certainly something I'd be interested in

Getting started with Python: The ultimate guide with Tips, Tools and Resources

2013-03-06 Thread Manish
Getting started with Python: Tips, Tools and Resources http://lurnq.com/lesson/getting-started-with-python-tips-tools-and-resources/ This is a lesson I published on LurnQ which acts like a beginners guide. I have included various Books, MOOCs, Video Tutorials, Interactive tutorials, exercises

draw a line if the color of points of beginning and end are différent from white

2013-03-06 Thread olsr . kamal
how can i draw a line if the point of the begining and the end if those points are différent from the white in other exepretion how can i get the color of two points of the begining and the end? please help me -- http://mail.python.org/mailman/listinfo/python-list

Any logger created before calling logging.config.dictCOnfig is not configured

2013-03-06 Thread W. Matthew Wilson
It seems like that any logger I create BEFORE calling logging.config.dictConfig does not get configured. Meanwhile, if I configure the logger like I always have, by just setting handlers on root, everything works fine, including the loggers that were created BEFORE I configure logging. I make a

Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Jason Hsu
I'm currently in the process of learning Ruby on Rails. I'm going through the Rails for Zombies tutorial, and I'm seeing the power of Rails. I still need to get a Ruby on Rails site up and running for the world to see. (My first serious RoR site will profile mutual funds from a value

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread mar...@python.net
My questions: 1. Why is Ruby on Rails much more popular than Django? AFAIK Rails got a slightly longer head start than Django. And it has been said that RoR's first killer app was a screencast. A little marketing can go a long way. Since then Django has caught up a bit with RoR in terms

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread Russ P.
One possibility is to form the string as usual, split on the e, format each part separately, then rejoin with an e. On Tuesday, March 5, 2013 12:09:10 PM UTC-8, fa...@squashclub.org wrote: Instead of: 1.8e-04 I need: 1.8e-004 So two zeros before the 4, instead of the

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Tim Johnson
* mar...@python.net mar...@python.net [130306 09:31]: My questions: 1. Why is Ruby on Rails much more popular than Django? If you already know/work with Python than I would go the Django route. RoR and Django are not that much different nowadays as far as methodologies. The main

Re: draw a line if the color of points of beginning and end are différent from white

2013-03-06 Thread Mark Lawrence
On 06/03/2013 17:46, olsr.ka...@gmail.com wrote: how can i draw a line if the point of the begining and the end if those points are différent from the white in other exepretion how can i get the color of two points of the begining and the end? please help me Please tell us what

Introducing Islam to Non--Muslims

2013-03-06 Thread BV BV
Introducing Islam to Non--Muslims Shaikh Yusuf Estes Explains the basics of Islam including the five pillars of Islam to Non-Muslims. http://www.youtube.com/v/gBlCnpUkobE?rel=0 thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: draw a line if the color of points of beginning and end are différent from white

2013-03-06 Thread F.R.
On 03/06/2013 06:46 PM, olsr.ka...@gmail.com wrote: how can i draw a line if the point of the begining and the end if those points are différent from the white in other exepretion how can i get the color of two points of the begining and the end? please help me This should get you

Re: Creating an object that can track when its attributes are modified

2013-03-06 Thread 88888 Dihedral
Ben Sizer於 2013年3月7日星期四UTC+8上午12時56分09秒寫道: On Wednesday, 6 March 2013 16:22:56 UTC, Chris Angelico wrote: Effectively, you would need to have a subclass of list/dict/tuple/whatever that can respond to the change. This is certainly something I'd be interested in having, but I

debugging with idle

2013-03-06 Thread Dirk Zabel
Hi, I am trying to debug a script using the idle debug control. I want to see the current source line which is executed, so I select the Source checkbox. If I step through the program, the editor window with the source is popping up, but the current source line is not marked. Only If I

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 6 Μαρτίου 2013 2:06:33 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε: check_output is available as of Python 2.7 I guess you are still on version 2.6 ? I can access each of these from my jailed shell user account without issue, and especially i try /usr/bin/python3

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Steven D'Aprano
On Wed, 06 Mar 2013 10:11:12 +, Wong Wah Meng-R32813 wrote: Hello there, I am using python 2.7.1 built on HP-11.23 a Itanium 64 bit box. I discovered following behavior whereby the python process doesn't seem to release memory utilized even after a variable is set to None, and

Insert comma in number?

2013-03-06 Thread eli m
I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Terry Reedy
On 3/6/2013 2:48 PM, rh wrote: I've tried twice to register with the bug tracker -- including just before sending this post. Both times I got something like this: Subject: Failed issue tracker submission From: Python tracker roundup-ad...@psf.upfronthosting.co.za Date: Wed, 06

Re: Insert comma in number?

2013-03-06 Thread ian douglas
On 03/06/2013 03:39 PM, eli m wrote: I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 pip install humanize import humanize

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Steven D'Aprano
On Wed, 06 Mar 2013 10:03:14 -0800, Jason Hsu wrote: My questions: 1. Why is Ruby on Rails much more popular than Django? 2. Why is there a much stronger demand for Ruby on Rails developers than Django/Python developers? Fashion. Demand for technology is usually driven more by copying

Re: Insert comma in number?

2013-03-06 Thread Chris Rebert
On Wed, Mar 6, 2013 at 3:39 PM, eli m techgeek...@gmail.com wrote: I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 Use the ,

Re: debugging with idle

2013-03-06 Thread Terry Reedy
On 3/6/2013 5:30 PM, Dirk Zabel wrote: Hi, I am trying to debug a script using the idle debug control. I want to see the current source line which is executed, so I select the Source checkbox. If I step through the program, the editor window with the source is popping up, but the current source

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Michael Ross
On Thu, 07 Mar 2013 00:18:44 +0100, Νίκος Γκρ33κ nikos.gr...@gmail.com wrote: Τη Τετάρτη, 6 Μαρτίου 2013 2:06:33 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε: check_output is available as of Python 2.7 I guess you are still on version 2.6 ? I can access each of these from my jailed shell

Re: Creating an object that can track when its attributes are modified

2013-03-06 Thread Ben Sizer
On Thursday, 7 March 2013 00:07:02 UTC, Steven D'Aprano wrote: On Wed, 06 Mar 2013 08:56:09 -0800, Ben Sizer wrote: I need to be able to perform complex operations on the object that may modify several properties, and then gather the properties at the end as an efficient way to see what

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 5:50:35 PM UTC-6, Terry Reedy wrote: If you find a bug in this documentation or would like to propose an improvement, please send an e-mail to d...@python.org describing the bug and where you found it. If you have a suggestion how to fix it, include that as

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread alex23
On Mar 7, 9:58 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Neither. I'd be rather tempted to try doing it in CherryPy. But then, what do I know, I'm just as much a follow of fashion as the next guy. All of the cool kids are using Pyramid these days. --

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread alex23
On Mar 7, 10:47 am, Rick Johnson rantingrickjohn...@gmail.com wrote: That's great Terry, but how will the next person find the link? Why do you have such a low opinion of others that you think they're unable to look up Reporting Bugs in the _documentation_? --

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Chris Kaynor
I actually just tried that, and the results weren't very good. Using the doc's search feature, the Reporting Bugs (and the About these documents) page was significantly down the page (about 2/3 of the way) - not the most obvious result in the pile. All the other searches I could think of either

Re: Insert comma in number?

2013-03-06 Thread Terry Reedy
On 3/6/2013 7:07 PM, Chris Rebert wrote: On Wed, Mar 6, 2013 at 3:39 PM, eli m techgeek...@gmail.com wrote: I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 7:06:56 PM UTC-6, alex23 wrote: Why do you have such a low opinion of others that you think they're unable to look up Reporting Bugs in the _documentation_? I don't have a low opinion of anybody here. However the fact that this community needs an entry level path

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Terry Reedy
On 3/6/2013 7:47 PM, Rick Johnson wrote: On Wednesday, March 6, 2013 5:50:35 PM UTC-6, Terry Reedy wrote: If you find a bug in this documentation or would like to propose an improvement, please send an e-mail to d...@python.org describing the bug and where you found it. If you have a

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Michael Ross
On Thu, 07 Mar 2013 02:28:10 +0100, Chris Kaynor ckay...@zindagigames.com wrote: I actually just tried that, and the results weren't very good. Using the doc's search feature, the Reporting Bugs (and the About these documents) page was significantly down the page (about 2/3 of the way) -

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Albert Hopkins
On Wed, Mar 6, 2013, at 02:16 PM, Tim Johnson wrote: I had problems getting django to work on my hostmonster account which is shared hosting and supports fast_cgi but not wsgi. I put that effort on hold for now, as it was just RD for me, but I would welcome you to take a look at

Re: why can not parse the web in almost same xpath expression?

2013-03-06 Thread Piet van Oostrum
python mailtoman...@163.com writes: import urllib import lxml.html down='http://v.163.com/special/visualizingdata/' file=urllib.urlopen(down).read() root=lxml.html.document_fromstring(file) urllist=root.xpath('//div[@class=down s-fc3 f-fl]//a') for url in

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread alex23
On Mar 7, 11:31 am, Rick Johnson rantingrickjohn...@gmail.com wrote: I don't have a low opinion of anybody here. However the fact that this community needs an entry level path for bug/grievance reports is *glaringly* obvious. Please explain how finding your vanity list would be easier than

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 7:52:59 PM UTC-6, Terry Reedy wrote: How much longer are we going to treat the symptoms We would VERY MUCH like a system to make it easier for readers to report doc bugs and developers to fix them. No one yet has come up with both a reasonable idea and

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Chris Angelico
On Thu, Mar 7, 2013 at 12:31 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: We need to know where the bottle necks are when learning the language, and since we are experienced, we lack the noob insight to even see the problems. I'll bet $100 you hated writing self as the first argument

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Tim Johnson
* Albert Hopkins mar...@letterboxes.org [130306 17:14]: On Wed, Mar 6, 2013, at 02:16 PM, Tim Johnson wrote: I had problems getting django to work on my hostmonster account which is shared hosting and supports fast_cgi but not wsgi. I put that effort on hold for now, as it was

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread rusi
On Mar 6, 11:03 pm, Jason Hsu jhsu802...@gmail.com wrote: I'm currently in the process of learning Ruby on Rails.  I'm going through the Rails for Zombies tutorial, and I'm seeing the power of Rails. I still need to get a Ruby on Rails site up and running for the world to see.  (My first

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 8:28:42 PM UTC-6, alex23 wrote: On Mar 7, 11:31 am, Rick Johnson rantingrickjohn...@gmail.com wrote: I don't have a low opinion of anybody here. However the fact that this community needs an entry level path for bug/grievance reports is *glaringly* obvious.

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread alex23
On Mar 7, 12:57 pm, Rick Johnson rantingrickjohn...@gmail.com wrote: GvR DOES NOT need to mention my name. All i am asking is that he show some support for the general *idea* of lowering the bar for bug/grievance reporting. Or at least start by admitting we have a problem. Your obsession with

Interesting list() un-optimization

2013-03-06 Thread Roy Smith
I stumbled upon an interesting bit of trivia concerning lists and list comprehensions today. We use mongoengine as a database model layer. A mongoengine query returns an iterable object called a QuerySet. The obvious way to create a list of the query results would be: my_objects =

Re: Interesting list() un-optimization

2013-03-06 Thread Dave Angel
On 03/06/2013 10:20 PM, Roy Smith wrote: I stumbled upon an interesting bit of trivia concerning lists and list comprehensions today. We use mongoengine as a database model layer. A mongoengine query returns an iterable object called a QuerySet. The obvious way to create a list of the query

Re: Do you feel bad because of the Python docs?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 9:12:37 PM UTC-6, alex23 wrote: Your obsession with Guido is tiring. And your false accusations that i am somehow obsessed with GvR have BEEN tiring for quite some time! I am neither passionate for or prejudice against the man. I simple ask that he live up to his

Re: Interesting list() un-optimization

2013-03-06 Thread Tim Chase
On 2013-03-06 22:20, Roy Smith wrote: I stumbled upon an interesting bit of trivia concerning lists and list comprehensions today. I agree with Dave Angel that this is interesting. A little testing shows that this can be rewritten as my_objects = list(iter(my_query_set)) which seems to

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread rusi
On Mar 6, 11:03 pm, Jason Hsu jhsu802...@gmail.com wrote: I'm currently in the process of learning Ruby on Rails.  I'm going through the Rails for Zombies tutorial, and I'm seeing the power of Rails. I still need to get a Ruby on Rails site up and running for the world to see.  (My first

Re: listbox binding..what is the current selection?

2013-03-06 Thread Rex Macey
Thanks. I have spent time with the docs, at least with the Python v3.3 and tkinter v8.5 (pdf). I wish they had more examples. My approach is to browse the docs, try a program, fail, read the docs, try again. When I can't figure it out, I post. I appreciate the help. On Tuesday, March

Re: Python SUDS issue

2013-03-06 Thread VGNU Linux
Hi Guys, Not aware what import here is and what it will do. But going through some google search result page found that there is something called doctor in suds. so tried changing code and it did fix the issue. suds.TypeNotFound: Type not found: '(GetAccountBalanceFaultResponse,

Re: listbox binding..what is the current selection?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 10:38:22 PM UTC-6, Rex Macey wrote: I have spent time with the docs, at least with the Python v3.3 and tkinter v8.5 (pdf). Could you post links to the documents you are reading please? Actually when i said read the docs i did not mean the offical Python docs on

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Rick Johnson
On Wednesday, March 6, 2013 8:58:12 PM UTC-6, rusi wrote: Where there is choice there is no freedom [snip link] Python-for-web offered so much choice -- zope, django, turbogears, cherrypy, web.py etc etc -- that the newbie was completely drowned. With Ruby there is only one choice to make

Unhelpful traceback

2013-03-06 Thread John Nagle
Here's a traceback that's not helping: Traceback (most recent call last): File InfoCompaniesHouse.py, line 255, in module main() File InfoCompaniesHouse.py, line 251, in main loader.dofile(infile) # load this file File InfoCompaniesHouse.py, line 213, in dofile

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 7 Μαρτίου 2013 2:25:09 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε: Either run /usr/bin/python3 /cgi-bin/metrites.py on the shell or better look in your webserver error log. Guess: In Python 3 print is a function. So print something will not work. You need to

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Νίκος Γκρ33κ
The whole try stement is as follows to have the compete idea: try: cur.execute( '''SELECT url, hits FROM counters ORDER BY hits DESC''' ) data = cur.fetchall() for row in data: (url, hits) = row

RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Wong Wah Meng-R32813
Python does not guarantee to return memory to the operating system. Whether it does or not depends on the OS, but as a general rule, you should expect that it will not. for i in range(10L): ... str=str+%s%(i,) You should never build large strings in that way. It risks being

Re: Unhelpful traceback

2013-03-06 Thread Andrew Berg
On 2013.03.07 00:33, John Nagle wrote: This is wierd, becuase for fields in reader isn't directly doing a decode. That's further down somewhere, and the backtrace didn't tell me where. Looking at the csv module docs,the reader object iterates over the csvfile argument (which can be any

Re: Unhelpful traceback

2013-03-06 Thread Chris Rebert
On Wed, Mar 6, 2013 at 10:33 PM, John Nagle na...@animats.com wrote: Here's a traceback that's not helping: snip UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 14: ordinal not in range(128) snip The program is converting some .CSV files that come packaged in .ZIP

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-06 Thread Chris Angelico
On Thu, Mar 7, 2013 at 5:33 PM, Wong Wah Meng-R32813 r32...@freescale.com wrote: [] The example is written for illustration purpose. Thanks for pointing out a better way of achieving the same result. Yes it seems so that the OS thinks the piece allocated to Python should not be taken back

Re: Python SUDS issue

2013-03-06 Thread Dieter Maurer
VGNU Linux wrote at 2013-3-7 10:07 +0530: Not aware what import here is and what it will do. XML-schema has an import facility to modularize schema descriptions. It is very similar to the import facilities you know from Python (and a lot of other languages) -- and has very similar purpose. ...

Re: Interesting list() un-optimization

2013-03-06 Thread Kev Dwyer
Roy Smith wrote: I stumbled upon an interesting bit of trivia concerning lists and list comprehensions today. We use mongoengine as a database model layer. A mongoengine query returns an iterable object called a QuerySet. The obvious way to create a list of the query results would be:

Re: Insert comma in number?

2013-03-06 Thread Peter Otten
eli m wrote: I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 Last not least there's the option to employ locale-aware formatting:

[issue17366] os.chdir win32

2013-03-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The backslash \ has a special meaning in strings: \n is the new line character, and \t is the tab character: http://docs.python.org/2/reference/lexical_analysis.html#string-literals Try to print the string! You could use \\, or raw strings rlike this.

[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2013-03-06 Thread Piotr Dobrogost
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15244 ___ ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread John Szakmeister
New submission from John Szakmeister: I discovered this issue while trying to track down why our upcoming release for Nose 1.3.0 was deadlocking under Ubuntu 12.04 with Python 3.3. It turns out that the read() was being interrupted leaving data in the subprocess's output buffers, which

[issue16754] Incorrect shared library extension on linux

2013-03-06 Thread Bohuslav Slavek Kabrda
Changes by Bohuslav Slavek Kabrda bkab...@redhat.com: -- nosy: +bkabrda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16754 ___ ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: The change in your patch is in a Windows-only section -- a few lines before the chunk you can see _winapi.GetExitCodeProcess(). Since read() on Windows never fails with EINTR there is no need for _eintr_retry_call(). If you are using Linux then there must

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: BTW, on threads are only used on Windows. On Unix select() or poll() is used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17367 ___

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
STINNER Victor added the comment: I attached a patch that I wrote for Wyplay: py_setallocators.patch. The patch adds two functions: PyAPI_FUNC(int) Py_GetAllocators( char api, void* (**malloc_p) (size_t), void* (**realloc_p) (void*, size_t), void (**free_p) (void*) );

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3329 ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread John Szakmeister
John Szakmeister added the comment: Good grief... how did I miss that. The problem has been flaky for me to induce. I'll take a closer look at the correct section. Thank you Richard. -- ___ Python tracker rep...@bugs.python.org

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-06 Thread Christian Heimes
Christian Heimes added the comment: Gregory, thanks. :) By the way CPython's list type does more than log(N) resize ops: $ ./listresize.py 10 100 1000 1 10 10 list.append() do 4 resize ops. 100 list.append() do 11 resize ops. 1000 list.append() do 28 resize ops. 1 list.append() do

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
STINNER Victor added the comment: To be exhaustive, another patch should be developed to replace all calls for malloc/realloc/free by PyMem_Malloc/PyMem_Realloc/PyMem_Free. PyObject_Malloc() is still using mmap() or malloc() internally for example. Other examples of functions calling

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Some customizable memory allocators I know have an extra parameter void *opaque that is passed to all functions: - in zlib: zalloc and zfree: http://www.zlib.net/manual.html#Usage - same thing for bz2. - lzma's ISzAlloc:

  1   2   >