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:

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

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: 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 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 unless the process >

Re: Unhelpful traceback

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

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 iter

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: 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: 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 >

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 main() File "InfoCompaniesHouse.py", line 251, in main loader.dofile(infile) # load this file File "InfoCompaniesHouse.py", line 213, in dofile

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

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: 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, http://www.paybac

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 5,

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

2013-03-06 Thread rusi
On Mar 6, 11:03 pm, Jason Hsu 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 serious RoR site w

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 th

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 hi

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

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 = list

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

2013-03-06 Thread alex23
On Mar 7, 12:57 pm, Rick Johnson 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 Guido is tiring. Open so

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 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 fin

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

2013-03-06 Thread rusi
On Mar 6, 11:03 pm, Jason Hsu 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 serious RoR site w

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

2013-03-06 Thread Tim Johnson
* Albert Hopkins [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 just R&D for m

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 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 to each method. > But now

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 alex23
On Mar 7, 11:31 am, Rick Johnson 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 reading the Python doc's tabl

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

2013-03-06 Thread Piet van Oostrum
python 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 urllist: >

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 R&D for me, but > I would welcome you to take a look at

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 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) - not the most obviou

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 suggestion

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: 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 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,0

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 eithe

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

2013-03-06 Thread alex23
On Mar 7, 10:47 am, Rick Johnson 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_? -- http://mail.python.org/mailman/listinfo/python-list

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

2013-03-06 Thread alex23
On Mar 7, 9:58 am, Steven D'Aprano 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. -- http://mail.python.org/mailman/listinfo/python-list

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 w

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 se

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κ 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 user account without

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: Insert comma in number?

2013-03-06 Thread Chris Rebert
On Wed, Mar 6, 2013 at 3: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 Use the "," (i.e. comma) format(

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 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 my_int

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 Date: Wed, 06 Mar 2013 00:56:44 + An unexpec

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: 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 >

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 ni...@superhost.

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 activ

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

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 go

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 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 pack

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

2013-03-06 Thread Tim Johnson
* 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 difference

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 t

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

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 investor'

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 l

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

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 wh

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 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 having, but I

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

2013-03-06 Thread Lele Gaifax
Ben Sizer 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 wanna go: a sim

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 ignored But I don't see any way o

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 t

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 > > wrote: > > > > > On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: > > >> I'am using this snipper to read a current directory and insert all > > >> filenames into

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 b

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread jmfauth
On 6 mar, 15:03, Roy Smith wrote: > In article , > >  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? -- >>> from vecmat6 import * >>> from s

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

2013-03-06 Thread Lele Gaifax
Dave Angel 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 name.

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread Roy Smith
In article , 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? -- http://mail.python.org/mailman/listinfo/python-list

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 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 directory? The inserted

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 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 replies when it

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κ 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!): # Compu

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: 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 utili

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 >> https://github

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 itself

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 proces

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 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: 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

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

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ 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 current_fu

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: book advice

2013-03-06 Thread rusi
On Mar 2, 1:59 am, leonardo selmi 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 specifically.

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: 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

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: : 'list' object has no attribute 'startswith' args = ("'list' object has no attribute 'startswith'",) message = "'list' object has no attribute 'startswith'"

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

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ 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 you can see its outp

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 Νίκος Γκρ33κ
Τη Τετάρτη, 6 Μαρτίου 2013 10:19:06 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > Νίκος Γκρ33κ 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) conta

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

2013-03-06 Thread Lele Gaifax
Νίκος Γκρ33κ 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 "inverse" loop where