[pygtk] ANNOUNCE: PyGObject 2.15.3

2008-09-01 Thread Johan Dahlin
I am pleased to announce version 2.15.3 of the Python bindings for GObject. The new release is available from ftp.gnome.org as and its mirrors as soon as its synced correctly: http://download.gnome.org/sources/pygobject/2.15/ What's new since PyGObject 2.15.2? - Beginning of

Roundup Issue Tracker version 1.4.6 released

2008-09-01 Thread Richard Jones
I'm proud to release version 1.4.6 of Roundup. 1.4.6 is a bugfix release: - Fix bug introduced in 1.4.5 in RDBMS full-text indexing - Make URL matching code less matchy If you're upgrading from an older version of Roundup you *must* follow the Software Upgrade guidelines given in the

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Terry Reedy
Tim Roberts wrote: josh logan [EMAIL PROTECTED] wrote: I am using Python 3.0b2. I have an XML file that has the unicode character '\u012b' in it, which, when parsed, causes a UnicodeEncodeError: 'charmap' codec can't encode character '\u012b' in position 26: character maps to undefined This

Processes in Linux from Python

2008-09-01 Thread Johny
To get a number of the http processes running on my Linux( Debia box) I use ps -ef | grep [h]ttpd | wc -l But If I want to use to get a number of the http processes from my Python program I must use a popen command e.g. popen2.popen3('ps -ef | grep [h]ttpd | wc -l') that is I must call an

Re: Processes in Linux from Python

2008-09-01 Thread Diez B. Roggisch
Johny schrieb: To get a number of the http processes running on my Linux( Debia box) I use ps -ef | grep [h]ttpd | wc -l But If I want to use to get a number of the http processes from my Python program I must use a popen command e.g. popen2.popen3('ps -ef | grep [h]ttpd | wc -l') that is I

Using NLTK in Java

2008-09-01 Thread hussainsaiger
I am trying to convert a python module (that contains the use of NLTK.Corpus) by jythonc. It is not able to include nltk dependencies within the java class it creates. So when i use this class in java, it fails to recognize nltk. Can anyone please let me know how should i use nltk in python/jython

Re: Using NLTK in Java

2008-09-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I am trying to convert a python module (that contains the use of NLTK.Corpus) by jythonc. It is not able to include nltk dependencies within the java class it creates. So when i use this class in java, it fails to recognize nltk. Can anyone please let me know how

Inquiry regarding the name of subprocess.Popen class

2008-09-01 Thread Jeremy Banks
Hi. I wondered if anyone knew the rationale behind the naming of the Popen class in the subprocess module. Popen sounds like the a suitable name for a function that created a subprocess, but the object itself is a subprocess, not a popen. It seems that it would be more accurate to just name

file-Grid-file

2008-09-01 Thread Michaeli Yair
Hi all, I imported a comma seperated data to PyGridTableBase which is a abstract Grid, I parse and display the information. After update i want to save it back to the comma seperated file, eith the same filename. any suggestions how to do that ? do you know any reference to this subject ? YM

Re: Command lime code

2008-09-01 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, I'll take I wild guess: By command lime code you did not refer to the algorithmic domination of citrus fruit, but rather to that window with the tiny blinking cursor and loads of text in white on black. Also by 'chdir' you probably mean

Re: (in memory) database

2008-09-01 Thread Roel Schroeven
Roel Schroeven schreef: Cameron Laird schreef: I now suspect that my 2.5 packaging has something to do with 64-bit builds; all my 32-bit Ubuntu servers have Python 2.5.2, while the 64-bit ones are at Python 2.5. Strange: my 64-bit Ubuntu 8.04 has Python 2.5.2, with working sqlite: (mine is

how to find position of dictionary values

2008-09-01 Thread lee
hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']} if user is enters the 3rd item of key phno, ie dfsdf in my dict, how can i find it is

Unable to clear Entry subwidget of Tix Combo Box

2008-09-01 Thread dudeja . rajat
Hi, In my combo box taken from Tix, how can I clear the entry subwidget? My case is like this: I have a check button which when made un-ticked should clear the entry from combo box (i. anything selected in combo box previously) I used the following commands: subEntry =

Re: how to find position of dictionary values

2008-09-01 Thread Alexandru Palade
lookfor = 'dfsdf' for item, value in kev.items(): if lookfor in value: print item print value.index(lookfor) break # assuming you only want one result You can also skip the 'if' verification in which case you need to catch ValueError

Know if a object member is a method

2008-09-01 Thread Luca
Hi all. I think this is a newbie question... what is the best method to know if a property of an object is a function? I'm thinking something as if type(obj.methodName)==??? Can someone help me? -- -- luca -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 1:21 pm, Alexandru Palade [EMAIL PROTECTED] wrote: lookfor = 'dfsdf' for item, value in kev.items(): if lookfor in value: print item print value.index(lookfor) break # assuming you only want one result You can also skip

Re: how to find position of dictionary values

2008-09-01 Thread Bruno Desthuilliers
lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']} if user is enters the 3rd item of key phno, ie dfsdf in my dict, how

Re: The Importance of Terminology's Quality

2008-09-01 Thread Robert Maas, http://tinyurl.com/uh3t
From: [EMAIL PROTECTED] (Rob Warnock) In the LGP-30, they used hex addresses, sort of[1], but the opcodes (all 16 of them) had single-letter mnemonics chosen so that the low 4 bits of the character codes *were* the correct nibble for the opcode! ;-} That's a fascinating design constraint!

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg',

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg',

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg',

Re: Know if a object member is a method

2008-09-01 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Luca, use type(something).__name__ , e.g. def x(): pass class C: pass c = C() type(x).__name__ == 'function' True type(C).__name__ == 'classobj' True type(c).__name__ == 'instance' True On Sep 1, 2008, at 10:43 AM,

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg', 'dsgsdg',

Re: how to find position of dictionary values

2008-09-01 Thread Bruno Desthuilliers
lee a écrit : hi, thank u your solution is exactly wat i wanted :) I'm afraid it's not what you actually *need*, cf my other post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Know if a object member is a method

2008-09-01 Thread Steven D'Aprano
On Mon, 01 Sep 2008 10:43:25 +0200, Luca wrote: Hi all. I think this is a newbie question... what is the best method to know if a property of an object is a function? I'm thinking something as if type(obj.methodName)==??? Can someone help me? That's not quite as easy as you might

Re: Know if a object member is a method

2008-09-01 Thread Steven D'Aprano
On Mon, 01 Sep 2008 10:52:10 +0200, Manuel Ebert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Luca, use type(something).__name__ , e.g. def x(): pass class C: pass c = C() type(x).__name__ == 'function' True type(C).__name__ ==

Re: how to find position of dictionary values

2008-09-01 Thread Diez B. Roggisch
lee wrote: On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'], 'address': ['sdg',

Re: Know if a object member is a method

2008-09-01 Thread Luca
On Mon, Sep 1, 2008 at 11:35 AM, Steven D'Aprano [EMAIL PROTECTED] wrote: That's relatively fragile, since such names aren't reserved in any way. It's easy to fool a name comparison check with an accidental name collision: class function(object): # not a reserved name ... pass ... x =

list + dictionary searching

2008-09-01 Thread Manoj
Hello All, I am very new to python. Any help will be highly appreciated. Thanks I have a list of dictionaries: a = [{'username': u'John Wang', 'user_utilization': 1.0, 'month': 9, 'user_id': 4, 'year': 2008}, {'username': u'John Wang', 'user_utilization': 1.0, 'month': 10, 'user_id': 4, 'year':

Re: Processes in Linux from Python

2008-09-01 Thread Christian Heimes
Johny wrote: Is it possible to get a number of the http processes running on Linux directly from Python ? The Python core has no direct API for the job. However you can use the virtual /proc/ file system for the job. Or check out my enumprocess package.

Re: Using NLTK in Java

2008-09-01 Thread hussainsaiger
On 1 Sep, 11:55, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: I am trying to convert a python module (that contains the use of NLTK.Corpus) by jythonc. It is not able to include nltk dependencies within the java class it creates. So when i use this class in java, it

Re: Processes in Linux from Python

2008-09-01 Thread Wojtek Walczak
On Sun, 31 Aug 2008 23:25:56 -0700 (PDT), Johny wrote: To get a number of the http processes running on my Linux( Debia box) I use ps -ef | grep [h]ttpd | wc -l ... So my question is: Is it possible to get a number of the http processes running on Linux directly from Python ? Yes, it is.

Re: list + dictionary searching

2008-09-01 Thread Bruno Desthuilliers
Manoj a écrit : Hello All, I am very new to python. Any help will be highly appreciated. Thanks I have a list of dictionaries: a = [{'username': u'John Wang', 'user_utilization': 1.0, 'month': 9, 'user_id': 4, 'year': 2008}, {'username': u'John Wang', 'user_utilization': 1.0, 'month': 10,

Re: (in memory) database

2008-09-01 Thread Bruno Desthuilliers
mark a écrit : Hi there, I need to extract data from text files (~4 GB) on this data some operations are performed like avg, max, min, group etc. The result is formated and written in some other text files (some KB). I currently think about database tools might be suitable for this. I would

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 2:37 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: lee wrote: On Sep 1, 1:45 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: lee a écrit : hi, i have a dictionary as follows : kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg', 'sgsd', 'sdfsdf',

Re: list + dictionary searching

2008-09-01 Thread Wojtek Walczak
On Mon, 1 Sep 2008 03:14:22 -0700 (PDT), Manoj wrote: I would like to : search dictionaries within this list create a new list with dictionaries which gives 1 dictionary for every user with month_year as a key and utilization for that month as a value Please give your thoughts Reading

Re: The Importance of Terminology's Quality

2008-09-01 Thread Rob Warnock
Robert Maas, [EMAIL PROTECTED] wrote: +--- | From: [EMAIL PROTECTED] (Rob Warnock) | In the LGP-30, they used hex addresses, sort of[1], but the | opcodes (all 16 of them) had single-letter mnemonics chosen so that | the low 4 bits of the character codes *were* the correct nibble

Re: how to find position of dictionary values

2008-09-01 Thread Wojtek Walczak
On Mon, 1 Sep 2008 03:51:13 -0700 (PDT), lee wrote: i am soory for that keystrokes. can anyone tell me how can i change the value of key. suppose i have a dictionary kev = {'kabir': ['[EMAIL PROTECTED]', '1234', 'missuri'], 'shri': ['[EMAIL PROTECTED]', '23423', 'india'], 'marsa': ['[EMAIL

Retrieving http headers from HTTPConnection object

2008-09-01 Thread jorma kala
Hi, when using httplib for http requests, like for example: conn = httplib.HTTPConnection(www.python.org) conn.request(GET, /index.html) Is it possible to retrieve the complete http request in string form : GET /index.html HTTP/1.1 Host: www.python.org User-Agent: ... Accept: ...

Re: Retrieving http headers from HTTPConnection object

2008-09-01 Thread Marco Bizzarri
On Mon, Sep 1, 2008 at 1:06 PM, jorma kala [EMAIL PROTECTED] wrote: Hi, when using httplib for http requests, like for example: conn = httplib.HTTPConnection(www.python.org) conn.request(GET, /index.html) Is it possible to retrieve the complete http request in string form : GET

Best way for add new path when embedding python into C

2008-09-01 Thread Pau Freixes
Hi list, I have a little question about whats' the best way for add - no replace - new path into python c embedding environment for this situation. I'm using PyObject_CallObject(pfunc, pArgs); for call one function of some module loaded with PyImport_Import function. PyImport_Import function

Re: Using NLTK in Java

2008-09-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On 1 Sep, 11:55, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: I am trying to convert a python module (that contains the use of NLTK.Corpus) by jythonc. It is not able to include nltk dependencies within the java class it creates. So when i

Re: how to find position of dictionary values

2008-09-01 Thread lee
On Sep 1, 3:59 pm, Wojtek Walczak [EMAIL PROTECTED] wrote: On Mon, 1 Sep 2008 03:51:13 -0700 (PDT), lee wrote: i am soory for that keystrokes. can anyone tell me how can i change the value of key. suppose i have a dictionary kev = {'kabir': ['[EMAIL PROTECTED]', '1234', 'missuri'],

Re: Best way for add new path when embedding python into C

2008-09-01 Thread Christian Heimes
Pau Freixes wrote: The best way for add new path before call PyImport_Import is adding new string item into sys path object ? The same way you'd add a path in Python: PyObject *sys_path; PyObject *path; sys_path = PySys_GetObject(path); if (sys_path == NULL) return NULL; path =

Re: how to find position of dictionary values

2008-09-01 Thread Bruno Desthuilliers
lee a écrit : On Sep 1, 2:37 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: lee wrote: (snip) i agree with u, my data strusture is not efficient. but all the records,viz...name,phno, email,address are all generated at runtime , when the user enters them. so how can i design my datastructure

Re: Know if a object member is a method

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 11:45:36 +0200, Luca wrote: But not so easy to fool a type check: type(x) == new.function False Of course that's not bullet-proof either. I leave it as an exercise to discover how you might break that piece of code. Ok, so... What is the best way to do this? The

Re: Know if a object member is a method

2008-09-01 Thread Tino Wildenhain
Luca wrote: On Mon, Sep 1, 2008 at 11:35 AM, Steven D'Aprano [EMAIL PROTECTED] wrote: ... But not so easy to fool a type check: type(x) == new.function False Of course that's not bullet-proof either. I leave it as an exercise to discover how you might break that piece of code. Ok, so...

Re: Know if a object member is a method

2008-09-01 Thread Steven D'Aprano
On Mon, 01 Sep 2008 11:45:36 +0200, Luca asked about recognizing methods: What is the best way to do this? The most pythonic? That depends on why you are doing it, and what you want to do with the information once you've found it. If you are experimenting in the interactive interpreter, the

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437. Why does Python using cp437 even when the default encoding is utf-8? On WinXP sys.getdefaultencoding() 'utf-8' s='\u012b' s Traceback (most recent call last): File stdin, line 1, in module

about computer tips inonline click here

2008-09-01 Thread raju
http://www.moneymaking4.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

click here more tips in online about software

2008-09-01 Thread raju
http://www.moneymaking4.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

get paid on free offers

2008-09-01 Thread raju
http://www.moneymaking4.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

click heremore dollar

2008-09-01 Thread raju
http://www.moneymaking4.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Know if a object member is a method

2008-09-01 Thread Luca
On Mon, Sep 1, 2008 at 2:18 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: If your aim is to write something like a debugger, profiler, or some other application that needs to inspect arbitrary objects and work out what they do, then you probably should be using: isinstance(obj.methodName,

Re: Know if a object member is a method

2008-09-01 Thread Fredrik Lundh
Luca wrote: Yes, this helps a lot. In facts I need to do something like a language parser. a *parser* that works on object structures created by executing a Python program? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: __stack_chk_fail_local

2008-09-01 Thread gianluca massei
thanks for the help, maybe the solution will be useful: in various Linux distributions are starting to ship with a version of the GNU C compiler which incorporates an extension which implements protection for stack-smashing. In that case the Makefile has to modified with CFLAGS =

How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread sniipe
Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string 'Łukasz': ${urllib.unquote(c.user.firstName).encode('latin-1')[0:1]} and I received this information: type

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread josh logan
On Sep 1, 8:19 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437.  Why does Python using cp437 even when the default encoding is utf-8? On WinXP   sys.getdefaultencoding() 'utf-8'   s='\u012b'  

Re: How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread Marco Bizzarri
2008/9/1 [EMAIL PROTECTED]: Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string 'Łukasz': ${urllib.unquote(c.user.firstName).encode('latin-1')[0:1]} and I received this

Multiple window handling

2008-09-01 Thread Anish Chapagain
Hi!! I'm trying to program an application which have multiple windows and is capable of executing method defined inside class of one another, i tries a simpel frame work here and am creating Toplevel inside method as the new window to be genereated, and again want another window to be loaded when

Using an existing instance as parent

2008-09-01 Thread André
Hi, I was trying to find a way to set, upon __init__() the parent of a class to an existing instance. Here is a minimal example of what I'm trying to do: class A(object): def __init__(self, x): self.x = x class B(A): def __init__(self, *args): if not isinstance(args[0], A):

Eleganz way to get rid of \n

2008-09-01 Thread Hans Müller
Hello, I'm quite often using this construct: for l in open(file, r): do something here, l contains the \n or \r\n on windows at the end. I get rid of it this way: for l in open(file, r): while l[-1] in \r\n: l = l[:-1] I find this a little bit clumsy, but it

Re: How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread sniipe
On 1 Wrz, 15:10, Marco Bizzarri [EMAIL PROTECTED] wrote: 2008/9/1 [EMAIL PROTECTED]: Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string 'Łukasz':

CSV reader and unique ids

2008-09-01 Thread Mike P
Hi All, I'm trying to use the CSV module to read in some data and then use a hashable method (as there are millions of records) to find unique ids and push these out to another file, can anyone advise? Below is the code so far fin = open(CSV_INPUT, rb) fout = open(CSV_OUTPUT, wb) reader =

Re: How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread Marco Bizzarri
On Mon, Sep 1, 2008 at 3:25 PM, [EMAIL PROTECTED] wrote: When I do ${urllib.unquote(c.user.firstName)} without encoding to latin-1 I got different chars than I will get: no Łukasz but Å ukasz -- http://mail.python.org/mailman/listinfo/python-list That's crazy. string.encode('latin1') gives

Re: Eleganz way to get rid of \n

2008-09-01 Thread josh logan
On Sep 1, 9:25 am, Hans Müller [EMAIL PROTECTED] wrote: Hello, I'm quite often using this construct: for l in open(file, r):         do something here, l contains the \n or \r\n on windows at the end. I get rid of it this way: for l in open(file, r):         while l[-1] in \r\n:      

Re: Eleganz way to get rid of \n

2008-09-01 Thread Wojtek Walczak
On Mon, 01 Sep 2008 15:25:03 +0200, Hans M�ller wrote: I'm quite often using this construct: for l in open(file, r): do something Has someone a better solution ? The most general would be to use rstrip() without arguments: a=some string\r\n a.rstrip() 'some string' but be

Re: SAXReaderNotAvailble: No parsers found

2008-09-01 Thread josh logan
On Aug 30, 8:59 pm, josh logan [EMAIL PROTECTED] wrote: Vincent Yau [EMAIL PROTECTED] writes: I am trying to use Python SAX API to parse XML files.  I do see expat.py somewhere underneath my Python 2.1.1 installation (on Solaris). But I got this error when invoking the

Re: Eleganz way to get rid of \n

2008-09-01 Thread josh logan
On Sep 1, 9:41 am, Wojtek Walczak [EMAIL PROTECTED] wrote: On Mon, 01 Sep 2008 15:25:03 +0200, Hans Müller wrote: I'm quite often using this construct: for l in open(file, r):    do something Has someone a better solution ? The most general would be to use rstrip() without arguments:

Re: logging - how to use in a library?

2008-09-01 Thread Vinay Sajip
On Aug 29, 11:02 pm, Thomas Heller [EMAIL PROTECTED] wrote: BTW: Let me say that the more I useloggingthe more I like it.loggingis a fantastic package! Thank you, I can say the same for ctypes and py2exe :-) Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Grant Edwards
On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: That's the question in Subject. For example, the difference between 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and 03/03/2008 is 4, leap year--extra day in Feb. I'm really only interested in years between, say, 1990

Re: Command lime code

2008-09-01 Thread Grant Edwards
On 2008-08-29, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am new to python. OK. I did find a page which listed some code - IE chdir type code but can not find it again. I have absolutely no clue what you mean. Can you supply an address? Sure, in fact, I can supply two!

Re: Eleganz way to get rid of \n

2008-09-01 Thread Bruno Desthuilliers
Hans Müller a écrit : Hello, I'm quite often using this construct: for l in open(file, r): do something here, l contains the \n or \r\n on windows at the end. I get rid of it this way: for l in open(file, r): while l[-1] in \r\n: l = l[:-1] I find this a little bit clumsy,

Re: Eleganz way to get rid of \n

2008-09-01 Thread Fredrik Lundh
Hans Müller wrote: I'm quite often using this construct: for l in open(file, r): do something here, l contains the \n or \r\n on windows at the end. nope -- if you open a file in text mode (without the b), the I/O layer will translate \r\n to \n on Windows. if you want even more

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread W. eWatson
Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: That's the question in Subject. For example, the difference between 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and 03/03/2008 is 4, leap year--extra day in Feb. I'm really only interested in years

python extension dynamic linking

2008-09-01 Thread Martin Landa
Hi, I am writing Python extension in C++, in this extension I am using methods from another Python extension. On Linux I am currently linking my extension with used Python extension -- what is quite ugly. gcc ... -lgdi where gdi is a link to C++ extension imported by 'module' I would like to

Re: Using an existing instance as parent

2008-09-01 Thread Bruno Desthuilliers
André a écrit : Hi, I was trying to find a way to set, upon __init__() the parent of a class to an existing instance. ??? Sorry but I just can't make any sense of this. Here is a minimal example of what I'm trying to do: class A(object): def __init__(self, x): self.x = x class B(A):

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Grant Edwards
On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: That's the question in Subject. For example, the difference between 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and 03/03/2008 is 4, leap

Buffer objects

2008-09-01 Thread Tom Harris
Greetings, I need a little help with buffer objects. Many Python objects export the buffer interface, or can be persuaded to create a buffer object with a buffer() call. First question, the buffer() function appears very quick. Does it just wrap the internal pointer and then exit? Second

Printing list of dates starting today

2008-09-01 Thread Luka Djigas
Hello everyone, please, I need your help. I'm new to python, so I don't know if this will seem like a stupid question to some of you ... I have a need to write to a file (or just print on screen, that part doesn't matter at this point) a list of dates, starting today. For example: 02.09.2008. tue

Re: Printing list of dates starting today

2008-09-01 Thread Fredrik Lundh
Luka Djigas wrote: please, I need your help. I'm new to python, so I don't know if this will seem like a stupid question to some of you ... I have a need to write to a file (or just print on screen, that part doesn't matter at this point) a list of dates, starting today. For example:

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread W. eWatson
Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: That's the question in Subject. For example, the difference between 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and

FHA Refinance Loan

2008-09-01 Thread king . geek22
On October 1, 2008, new FHA Refinance Loan Guidelines will go into effect as part of The Housing and Economic Recovery Act of 2008. This new FHA Mortgage program is designed to help thousands of homeowners who are at risk of foreclosure in their curent conventional or sub- prime home loans. The

Problem with Twisted

2008-09-01 Thread Grom
Hello. I have something like that: from twisted.words.protocols.jabber import xmlstream from twisted.internet import protocol from twisted.words.xish import domish, utility from twisted.internet import reactor from twisted.python import log import sys, hashlib log.startLogging(sys.stdout) def

Re: Writing to ms excel

2008-09-01 Thread Alan G Isaac
http://docs.python.org/lib/module-csv.html -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV reader and unique ids

2008-09-01 Thread Tim Golden
Mike P wrote: I'm trying to use the CSV module to read in some data and then use a hashable method (as there are millions of records) to find unique ids and push these out to another file, You could either zip with a counter or use the uuid module, depending on just how unique you want your

Re: Printing list of dates starting today

2008-09-01 Thread Ari Makela
On 2008-09-01, Luka Djigas [EMAIL PROTECTED] wrote: please, I need your help. I'm new to python, so I don't know if this will seem like a stupid question to some of you ... There are several ways to do it. Have a look at the documentation of modules time and datetime. For this exact problem

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Ari Makela
On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Oddly, Leaning Python has no mention of datetime (not date or time), at least, that I could find. I'm considering the Nutshell book, 2nd ed., as a better reference (and cross reference) to various topics. datetime is pretty new standard

Make money using free affiliate programs

2008-09-01 Thread Aquila
Making money with affiliate programs is a better way, please see this web-site: http://www.abicana.com/affiliatenetworks.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Some problems with classes

2008-09-01 Thread Bruno Desthuilliers
Chris Rebert a écrit : On Sun, Aug 31, 2008 at 6:39 PM, ssecorp [EMAIL PROTECTED] wrote: Why/how is it possible to add variables like this? I don't understand this mechanism: http://docs.python.org/tut/node11.html#SECTION001133 Under the covers, Python objects are implemented

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Terry Reedy
Marc 'BlackJack' Rintsch wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437. Why does Python using cp437 even when the default encoding is utf-8? On WinXP sys.getdefaultencoding() 'utf-8' s='\u012b' s Traceback (most recent call last): File

Getting an objetcs dict?

2008-09-01 Thread ssecorp
I did nce(I think). class X X.__dict__() and ngot a dict of its variables. Now i get errors doing this. what am i doing wrong? -- http://mail.python.org/mailman/listinfo/python-list

TkMessageBox - Using sys.exit() is a a great pain. Looking for other similar commands.

2008-09-01 Thread dudeja . rajat
Hi, I'm using a TkMessageBox for handling some errors and displaying them through the message boxes. My code is as below: if selectedVer == strNoArchivedResults: tkMessageBox._show(Error, \ type='ok', icon='error', \

Re: Getting an objetcs dict?

2008-09-01 Thread Wojtek Walczak
On Mon, 1 Sep 2008 11:31:42 -0700 (PDT), ssecorp wrote: I did nce(I think). class X X.__dict__() and ngot a dict of its variables. Now i get errors doing this. what am i doing wrong? You're not asking smart questions: http://www.catb.org/~esr/faqs/smart-questions.html HINT: the attribute

Re: Command lime code

2008-09-01 Thread Terry Reedy
Manuel Ebert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, I'll take I wild guess: By command lime code you did not refer to the algorithmic domination of citrus fruit, but rather to that window with the tiny blinking cursor and loads of text in white on black. Also by 'chdir'

Benchmark differences between 32 and 64 bit Python?

2008-09-01 Thread python
Anyone have any benchmarks on the difference in performance between 32 and 64 bit versions of Python for specific categories of operation, eg. math, file, string, etc. operations? My question is OS neutral so feel free to share your experience with either Windows or Linux OS's. Thank you,

Re: how to find position of dictionary values

2008-09-01 Thread Terry Reedy
Alexandru Palade wrote: lookfor = 'dfsdf' for item, value in kev.items(): if lookfor in value: print item print value.index(lookfor) break # assuming you only want one result slight variation: lookfor = 'dfsdf' for item, value in

Re: The Importance of Terminology's Quality

2008-09-01 Thread Robert Maas, http://tinyurl.com/uh3t
From: George Neuner [EMAIL PROTECTED] A friend of mine had an early 8080 micros that was programmed through the front panel using knife switches When you say knife switches, do you mean the kind that are shaped like flat paddles? I think that would be the IMSAI, which came after the ALTAIR.

Py 2.6 changes

2008-09-01 Thread bearophileHUGS
I have just re-read the list of changes in Python 2.6, it's huge, there are tons of changes and improvements, I'm really impressed: http://docs.python.org/dev/whatsnew/2.6.html I'll need many days to learn all those changes! I can see it fixes several of the missing things/problems I have found

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 14:25:01 -0400, Terry Reedy wrote: Marc 'BlackJack' Rintsch wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: Most likely because Python figured out that the terminal expects cp437. What does `sys.stdout.encoding` say? The interpreter in the command prompt

  1   2   3   >