Re: How can i use a variable without define it ?

2008-07-18 Thread Tim Roberts
zhw [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: What problem are you trying to solve? I an sorry, I can't tell you. That's nonsense. No one is asking you to reveal the design of your company's next product. However, you have some overall problem you are trying to solve, and

Re: % sign in python?

2008-07-18 Thread Tim Roberts
Steven Howe [EMAIL PROTECTED] wrote: Terry Reedy wrote: korean_dave wrote: What does this operator do? Specifically in this context test.log( [[Log level %d: %s]] % ( level, msg ), description ) I thought, in this contexted, it was mapping operator. What?? Python does not have a mapping

Re: storing references instead of copies in a dictionary

2008-07-18 Thread castironpi
On Jul 17, 7:36 pm, bgeddy [EMAIL PROTECTED] wrote: bgeddy wrote: castironpi wrote: On Jul 17, 10:05 am, mk [EMAIL PROTECTED] wrote: def f2(arg):     return f2 +arg def f1(arg):     return f1 +arg a={1:f1,2:f2} print [eval(x[1])(x[0]) for x in a.items()] def f2(arg):    

Re: interpreter vs. compiled

2008-07-18 Thread castironpi
On Jul 17, 11:39 pm, Kay Schluehr [EMAIL PROTECTED] wrote: On 18 Jul., 01:15, castironpi [EMAIL PROTECTED] wrote: On Jul 17, 5:37 pm, I V [EMAIL PROTECTED] wrote: On Thu, 17 Jul 2008 15:08:17 -0700, castironpi wrote: The Python disassembly is baffling though. y= 3

Re: storing references instead of copies in a dictionary

2008-07-18 Thread John Machin
On Jul 18, 4:26 pm, castironpi [EMAIL PROTECTED] wrote: I delicately ask for an example in natural language and daily life in which we change what object a name refers to, her, him, it, ... i.e. any pronoun -- http://mail.python.org/mailman/listinfo/python-list

Re: How to process a very large (4Gb) tarfile from python?

2008-07-18 Thread Uwe Schmitt
On 17 Jul., 22:21, Lars Gustäbel [EMAIL PROTECTED] wrote: Maybe we should post this issue to python-dev mailing list. Parsing large tar-files is not uncommon. This issue is known and was fixed for Python 3.0, seehttp://bugs.python.org/issue2058. The proposed patch does not avoid caching

None in comparison

2008-07-18 Thread r . grimm
Hello, I'm a little confused about None in comparison. id ( None ) 3086100672L id ( 1 ) 134541104 None 1 True I thought, the id of the object is the last comparison criterion. Therefore, None must be greater then 1. Where is the behaviour of the comparison defined?. In the __cmp__ of int.

Re: interpreter vs. compiled

2008-07-18 Thread [EMAIL PROTECTED]
On Jul 18, 2:31 pm, castironpi [EMAIL PROTECTED] wrote: Given that, what does that column indicate? Offset. -- http://mail.python.org/mailman/listinfo/python-list

Re: wholesale n i k e [...]

2008-07-18 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: [incomplete babbling removed] I guess this guy meant the whole snake, but messed up his keyboard. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: None in comparison

2008-07-18 Thread Marc 'BlackJack' Rintsch
On Thu, 17 Jul 2008 23:52:13 -0700, r.grimm wrote: Hello, I'm a little confused about None in comparison. id ( None ) 3086100672L id ( 1 ) 134541104 None 1 True I thought, the id of the object is the last comparison criterion. Obviously that expectation is false. The result of a

Re: singletons

2008-07-18 Thread Paddy
On Jul 16, 11:20 pm, Craig Allen [EMAIL PROTECTED] wrote: Hey, forgive me for just diving in, but I have a question I was thinking of asking on another list but it really is a general question so let me ask it here.  It's about how to approach making singletons. Hi Craig, This might be good

Re: About wmi

2008-07-18 Thread patrol
On 7月17日, 下午4时22分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: I will try to modify the wmi.py ,however I'm a novice.It will take a long time. You can give it up temporarily. If you don't mind ,can you tell me where needs modifying and how? Just unicode? Or Other? OK. Thanks for

sub typing built in type with common attributes. Am I right?

2008-07-18 Thread King
I am new to python and getting into classes. Here I am trying to create subtype of built in types with some additional attributes and function. 'Attributes' is the main class and holds all the common attributes that requires by these subtypes. This is what I came out with. I need to know whether

Re: % sign in python?

2008-07-18 Thread Terry Reedy
Tim Roberts wrote: Steven Howe [EMAIL PROTECTED] wrote: Terry Reedy wrote: korean_dave wrote: What does this operator do? Specifically in this context test.log( [[Log level %d: %s]] % ( level, msg ), description ) I thought, in this contexted, it was mapping operator. You miss

Re: None in comparison

2008-07-18 Thread Terry Reedy
Marc 'BlackJack' Rintsch wrote: On Thu, 17 Jul 2008 23:52:13 -0700, r.grimm wrote: Hello, I'm a little confused about None in comparison. id ( None ) 3086100672L id ( 1 ) 134541104 None 1 True I thought, the id of the object is the last comparison criterion. Obviously that

Re: Python Behind a Squid Corporate Proxy on Windows

2008-07-18 Thread Chris
On Jul 17, 6:40 pm, Larry Hale [EMAIL PROTECTED] wrote: Err, the line above should be: proxy_handler = urllib2.ProxyHandler( { http: http:// myusername:[EMAIL PROTECTED]:3128 } ) (Sorry!  :) some old code I wrote to download public domain info for our company, also through a squid proxy and

Question on Joining of list

2008-07-18 Thread SUBHABRATA
Dear Group, I am trying the following code line: def try2(n): a1=raw_input(PRINT A STRING:) a2=a1.split() a3=God Godess Heaven Sky for x in a2: a4=a3.find(x) if a4-1: a5=a3[a4] print a5

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-18 Thread sukkopera
FYI, I have opened a bug on the official tracker: http://bugs.python.org/issue3403. -- http://mail.python.org/mailman/listinfo/python-list

checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
Hi, I want to test if an object IS in a list (identity and not equality test). I can if course write something like this : test = False myobject = MyCustomClass(*args, **kw) for element in mylist: if element is myobject: test = True break and I can even write a isinlist(elt,

Glamour models Fasion designing New look watch my profile http://www.geocities.com/cathrina39

2008-07-18 Thread hot rathi
Glamour models Fasion designing New look watch my profile http://www.geocities.com/cathrina39 -- http://mail.python.org/mailman/listinfo/python-list

Re: sub typing built in type with common attributes. Am I right?

2008-07-18 Thread Peter Otten
King wrote: I am new to python and getting into classes. Here I am trying to create subtype of built in types with some additional attributes and function. 'Attributes' is the main class and holds all the common attributes that requires by these subtypes. This is what I came out with. I need

Re: checking if an object IS in a list

2008-07-18 Thread Peter Otten
[EMAIL PROTECTED] wrote: Hi, I want to test if an object IS in a list (identity and not equality test). I can if course write something like this : test = False myobject = MyCustomClass(*args, **kw) for element in mylist: if element is myobject: test = True break

Re: sub typing built in type with common attributes. Am I right?

2008-07-18 Thread King
My mistake... The correct __slots__ is like: __slots__ = ['_Attribute_name', '_Attribute_type', '_Attribute_range', 'label'] Could you please suggest an alternative or code improvement for the matter. Prashant -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Joining of list

2008-07-18 Thread Marc 'BlackJack' Rintsch
On Fri, 18 Jul 2008 01:31:59 -0700, SUBHABRATA wrote: def try2(n): a1=raw_input(PRINT A STRING:) a2=a1.split() a3=God Godess Heaven Sky for x in a2: a4=a3.find(x) if a4-1: a5=a3[a4] print a5

Re: % sign in python?

2008-07-18 Thread Ken Starks
Terry Reedy wrote: korean_dave wrote: What does this operator do? Specifically in this context test.log( [[Log level %d: %s]] % ( level, msg ), description ) (Tried googling and searching, but the % gets interpreted as an operation and distorts the search results) Having seen a number of

Re: Question on Joining of list

2008-07-18 Thread Peter Otten
SUBHABRATA wrote: I am trying the following code line: def try2(n): user_line = raw_input(PRINT A STRING:) user_words = user_line.split() my_line = God Godess Heaven Sky for word in user_words: pos = my_line.find(word) if pos - 1: first_char =

Re: Question on Joining of list

2008-07-18 Thread SUBHABRATA
Sorry if I didn't say that. The input is a string Petrol Helium Heaven Sky Now, in a3 it is God Goddess Heaven Sky is there, it is matching Heaven and Sky but not Petrol and Helium as they are not in a3. Now, as per the code it is giving me an output S of Sky and Helium But I was looking for an

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
On 18 juil, 11:30, Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi, I want to test if an object IS in a list (identity and not equality test). I can if course write something like this : test = False myobject = MyCustomClass(*args, **kw) for element in mylist:  

Re: Question on Joining of list

2008-07-18 Thread SUBHABRATA
Thanx Peter, I would change my variables next time I would post. And obviously, thanx for your solution. I am reviewing it, I was also trying out some solutions. Best Regards, Subhabrata. Peter Otten wrote: SUBHABRATA wrote: I am trying the following code line: def try2(n): user_line =

Re: sub typing built in type with common attributes. Am I right?

2008-07-18 Thread Peter Otten
King wrote: My mistake... The correct __slots__ is like: __slots__ = ['_Attribute_name', '_Attribute_type', '_Attribute_range', 'label'] Could you please suggest an alternative or code improvement for the matter. How about class AttributesMixin(object): Warning: If you change name,

Protecting instance variables

2008-07-18 Thread Nikolaus Rath
Hello, I am really surprised that I am asking this question on the mailing list, but I really couldn't find it on python.org/doc. Why is there no proper way to protect an instance variable from access in derived classes? I can perfectly understand the philosophy behind not protecting them from

Re: Unusual Exception Behaviour

2008-07-18 Thread mk
Ok, Just to add a little interest, when I comment out the configuration line for my logging, like so: #logging.config.fileConfig(/myapp/configuration/logging.conf) It appears to throw the exceptions as normal :-) :-s To tell the truth I have never used logging module extensively, so I'm

Re: Question on Joining of list

2008-07-18 Thread SUBHABRATA
Hi Peter, In your code s would print first_char(of the last word)+ +missing_word(the last word) I was looking all. Best Regards, Subhabrata. SUBHABRATA wrote: Sorry if I didn't say that. The input is a string Petrol Helium Heaven Sky Now, in a3 it is God Goddess Heaven Sky is there, it is

Re: Question on Joining of list

2008-07-18 Thread Peter Otten
SUBHABRATA wrote: Thanx Peter, I would change my variables next time I would post. No, you should use meaningful variable names when you write your code no matter whether you plan to post it or not. And obviously, thanx for your solution. I am reviewing it, I was also trying out some

Re: Best Python packages?

2008-07-18 Thread Ben Sizer
On Jul 16, 3:31 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Ben Sizer wrote: make my development a lot easier. Knowing what kind of development you do might help, of course.  Some libraries are excellent in some contexts and suck badly in others... Sure. Mostly I'm just interested in what's

Re: sub typing built in type with common attributes. Am I right?

2008-07-18 Thread Maric Michaud
Le Friday 18 July 2008 11:36:20 King, vous avez écrit : Could you please suggest an alternative or code improvement for the matter. I'm not sure what you are trying to achieve with your snippet, but I suspect it's some sort of templating, right ? If so, using the dynamic nature of python

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
In fact, 'any(myobject is element for element in mylist)' is 2 times slower than using a for loop, and 'id(myobject) in (id(element) for element in mylist)' is 2.4 times slower. -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if an object IS in a list

2008-07-18 Thread Peter Otten
[EMAIL PROTECTED] wrote: I think something like id(myobject) in (id(element) for element in mylist) would also work, also it's not so readable, and maybe not so fast (?)... An is in operator would be nice... And rarely used. Probably even less than the (also missing) in, | in,

trying to match a string

2008-07-18 Thread arnimavidyarthy
Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not exactly meet what I need. For eg: LRLRLRLRLM is ok but

trying to match a string

2008-07-18 Thread arnimavidyarthy
Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not exactly meet what I need. For eg: LRLRLRLRLM is ok but

Re: Protecting instance variables

2008-07-18 Thread Diez B. Roggisch
Nikolaus Rath schrieb: Hello, I am really surprised that I am asking this question on the mailing list, but I really couldn't find it on python.org/doc. Why is there no proper way to protect an instance variable from access in derived classes? I can perfectly understand the philosophy behind

Re: Question on Joining of list

2008-07-18 Thread SUBHABRATA
Hi Peter, Peter Otten wrote: SUBHABRATA wrote: Thanx Peter, I would change my variables next time I would post. No, you should use meaningful variable names when you write your code no matter whether you plan to post it or not. Good You are teaching me something good in life. Thanx.

Re: trying to match a string

2008-07-18 Thread Eddie Corns
[EMAIL PROTECTED] writes: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not exactly meet what I need. For

Re: Question on Joining of list

2008-07-18 Thread Quentin Gallet-Gilles
Actually, since you want to keep the missing words apart from the found ones, it's not necessary to do that. Using first_char and missing_word (quoting Peter's code) as lists instead of strings comes to mind, then you can join both lists into a string once the code exits the for loop. Cheers,

Re: sub typing built in type with common attributes. Am I right?

2008-07-18 Thread King
Thanks Michaud, You have actually solved an another problem by 'make_subtype_with_attr' function. What actually I am trying to do here is to create custom types using built in types to use in my application. For example , float2, float3, color, vector, point, normal, matrix etc. The reason being

RE: Unusual Exception Behaviour

2008-07-18 Thread Robert Rawlins
Hi Mk, To tell the truth I have never used logging module extensively, so I'm not expert in this area and can't help you there. However, it seems to me that you may have stumbled upon some subtle bug / side effect of logging module that could cause some side effects in exceptions. Or

welcome to $500 monthly in onlin jobs jest join him with in all datting in girls frined available

2008-07-18 Thread hot
welcome to $500 monthly in onlin jobs jest join him with in all datting in girls frined available in all information viset welcome to $500 monthly in onlin jobs jest join him with in all datting in girls frined available in all information viset web

Re: trying to match a string

2008-07-18 Thread John Machin
On Jul 18, 8:33 pm, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not exactly

Re: trying to match a string

2008-07-18 Thread oj
On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not

Re: trying to match a string

2008-07-18 Thread arni
On Jul 18, 3:46 pm, [EMAIL PROTECTED] (Eddie Corns) wrote: [EMAIL PROTECTED] writes: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R]

Re: trying to match a string

2008-07-18 Thread John Machin
On Jul 18, 9:05 pm, oj [EMAIL PROTECTED] wrote: On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect:

Re: checking if an object IS in a list

2008-07-18 Thread Peter Otten
[EMAIL PROTECTED] wrote: In fact, 'any(myobject is element for element in mylist)' is 2 times slower than using a for loop, and 'id(myobject) in (id(element) for element in mylist)' is 2.4 times slower. This is not a meaningful statement unless you at least qualify with the number of item

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-18 Thread Sebastian lunar Wiesner
[EMAIL PROTECTED] [EMAIL PROTECTED]: On 13 Lug, 19:42, [EMAIL PROTECTED] wrote: I expect it's because default values for parameters are evaluated and bound at definition time. So once def m (self, param = a): line executes, the default value for parameter is forever bound to be 1. What you

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
On 18 juil, 12:26, Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I think something like id(myobject) in (id(element) for element in mylist) would also work, also it's not so readable, and maybe not so fast (?)... An is in operator would be nice... And rarely used.

How to register an extension DLL with python 2.5?

2008-07-18 Thread Boaz Feldbaum
Hello all, I wrote an extension dll in C++ using VS2005 to be used in windows platform. In pyhon 2.4 I used to copy my dll to the dlls sub-directory of python installation and import my dll and it worked fine. This doesn't work with python 2.5. I get the following when trying to import my dll:

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
On 18 juil, 13:13, Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: In fact, 'any(myobject is element for element in mylist)' is 2 times slower than using a for loop, and 'id(myobject) in (id(element) for element in mylist)' is 2.4 times slower. This is not a meaningful

https in pylons

2008-07-18 Thread sniipe
Hello, I have a question about framework pylons - how to run(in paster) webpages over https? Is it possible, or not? Best regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Tcl extensions with Python?

2008-07-18 Thread Thomas Troeger
C Martin wrote: How do you setup a Tcl extension to be accessible through Python? I understand that I'll have to use native Tcl calls to use it (tk.call() etc), but I can't figure out where to put the files or how to initialize them so I can call them. The package I would like to use is TkPNG:

Re: storing references instead of copies in a dictionary

2008-07-18 Thread [EMAIL PROTECTED]
On 17 juil, 15:56, mk [EMAIL PROTECTED] wrote: Calvin Spealman wrote: To your actual problem... Why do you wanna do this anyway? If you want to change the function in the dictionary, why don't you simply define the functions you'll want to use, and change the one you have bound to the key

Re: How to process a very large (4Gb) tarfile from python?

2008-07-18 Thread Uwe Schmitt
Due to the discussion above I wrote a python module for scanning of large tarfiles. You can get it from http://www.procoders.net/wp-content/tarfile_scanner.zip Greetings, Uwe -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to match a string

2008-07-18 Thread oj
On Jul 18, 12:10 pm, John Machin [EMAIL PROTECTED] wrote: On Jul 18, 9:05 pm, oj [EMAIL PROTECTED] wrote: On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the

Re: checking if an object IS in a list

2008-07-18 Thread Peter Otten
[EMAIL PROTECTED] wrote: On 18 juil, 13:13, Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: In fact, 'any(myobject is element for element in mylist)' is 2 times slower than using a for loop, and 'id(myobject) in (id(element) for element in mylist)' is 2.4 times slower.

substitution of list elements

2008-07-18 Thread antar2
I want to replace each first element in list 5 that is equal to the first element of the list of lists4 by the fourth element. I wrote following code that does not work: list4 = [['1', 'a', 'b', 'c'], ['2', 'd', 't', 'e'], ['8', 'g', 'q', 'f']] list5 = ['1', '2', '3'] for j in list4: for k in

Question regarding os.write() and write() method of a file descriptor

2008-07-18 Thread phil lemelin
Good Day python users, I have a question regarding os.write and the write method of a file descriptor object. My python was written on linux, under python 2.4 and I've recently migrated to python 2.5. My problem came from a pipe I used to to open and write to using : fd = os.open(myfifo,w+)

Re: checking if an object IS in a list

2008-07-18 Thread bearophileHUGS
Peter Otten: PS: Take these numbers with a grain of salt, they vary a lot between runs. Another possibility :-) from itertools import imap id(x) in imap(id, items) If you want efficiency you should use a dictionary instead of the list anyway: I agree, but sometimes you have few items to look

Re: substitution of list elements

2008-07-18 Thread Wolfram Kraus
Am 18.07.2008 14:33, antar2 schrieb: I want to replace each first element in list 5 that is equal to the first element of the list of lists4 by the fourth element. I wrote following code that does not work: list4 = [['1', 'a', 'b', 'c'], ['2', 'd', 't', 'e'], ['8', 'g', 'q', 'f']] list5 = ['1',

Re: trying to match a string

2008-07-18 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: I am taking a string as an input from the user and it should only contain the chars:L , M or R How about skipping re's and doing something like: set(input_string) = set('LMR') If you want to disallow the empty string: set([]) set(input_string) = set('LMR')

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-18 Thread sukkopera
On 18 Lug, 13:23, Sebastian \lunar\ Wiesner [EMAIL PROTECTED] wrote: It _is_ the correct thing.  Evaluation of default parameters at declaration time and not at invocation is truely a language feature, not a bug. You'll find your bug report being closed quickly. It has ;). I had totally

Re: Problem with MySQLdb and mod_python

2008-07-18 Thread Graham Dumpleton
On Jul 18, 3:28 pm, John Nagle [EMAIL PROTECTED] wrote: Cyril Bazin wrote: Thanks for your reply The apache log contains lines like : [Tue Jul 15 23:31:01 2008] [notice]mod_python(pid=11836, interpreter='www.toto.fr'):Importing module

Re: property getter with more than 1 argument?

2008-07-18 Thread [EMAIL PROTECTED]
On 17 juil, 16:57, mk [EMAIL PROTECTED] wrote: It seems like getter is defined in such way that it passes only 'self': class FunDict(dict): def __init__(self): self.fundict = dict() What's the use of inheriting from dict here ??? def fget(self, fun): wrong

Re: https in pylons

2008-07-18 Thread Graham Dumpleton
On Jul 18, 9:50 pm, [EMAIL PROTECTED] wrote: Hello, I have a question about framework pylons - how to run(in paster) webpages over https? Is it possible, or not? If Paste server that is uses doesn't already support HTTPS, then run Pylons under Apache/mod_wsgi, or just run Pylons with Paste

Re: How to register an extension DLL with python 2.5?

2008-07-18 Thread Boaz Feldbaum
OK, found it! I just had to give my dll a new file extension: PYD, that is rename it from foo.dll to foo.pyd Boaz Feldbaum [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I wrote an extension dll in C++ using VS2005 to be used in windows platform. In pyhon 2.4 I used

Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread johnericaturnbull
Hi - I am very new to python. I get this random core dump and am looking for a good way to catch the error. I know the function my core dump occurs. Is there any error catching/handling that I could use in python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python packages?

2008-07-18 Thread Iain King
On Jul 18, 11:23 am, Ben Sizer [EMAIL PROTECTED] wrote: On Jul 16, 3:31 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Ben Sizer wrote: make my development a lot easier. Knowing what kind of development you do might help, of course.  Some libraries are excellent in some contexts and suck

Re: Question on Joining of list

2008-07-18 Thread ptn
On Jul 18, 5:40 am, SUBHABRATA [EMAIL PROTECTED] wrote: Hi Peter,Peter Otten wrote: SUBHABRATA wrote: Thanx Peter, I would change my variables next time I would post. No, you should use meaningful variable names when you write your code no matter whether you plan to post it or not.

Re: Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread phil lemelin
I would suggest importing traceback. import traceback try : mystuff except : print str(traceback.format_exc()) But in the case of a SegFault or core dump, it might not help you at all. Can you post part of the function ? On Fri, Jul 18, 2008 at 9:25 AM, [EMAIL PROTECTED] wrote: Hi - I

Re: Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: Hi - I am very new to python. I get this random core dump and am looking for a good way to catch the error. I know the function my core dump occurs. Is there any error catching/handling that I could use in python? Since you are using Windows, this is somewhat

Re: Regular expression help

2008-07-18 Thread Russell Blau
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am new to Python, with a background in scientific computing. I'm trying to write a script that will take a file with lines like c afrac=.7 mmom=0 sev=-9.56646 erep=0 etot=-11.020107 emad=-3.597647 3pv=0 extract the values of afrac

Re: Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread johnericaturnbull
On Jul 18, 9:56 am, Stefan Behnel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi - I am very new to python. I get this random core dump and am looking for a good way to catch the error. I know the function my core dump occurs. Is there any error catching/handling that I could use in

Re: Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread Doug Morse
On Fri, 18 Jul 2008 15:56:10 +0200, Stefan Behnel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi - I am very new to python. I get this random core dump and am looking for a good way to catch the error. I know the function my core dump occurs. Is there any error catching/handling that

Re: Regular expression help

2008-07-18 Thread Brad
[EMAIL PROTECTED] wrote: Hello, I am new to Python, with a background in scientific computing. I'm trying to write a script that will take a file with lines like c afrac=.7 mmom=0 sev=-9.56646 erep=0 etot=-11.020107 emad=-3.597647 3pv=0 extract the values of afrac and etot... Why not just

Re: substitution of list elements

2008-07-18 Thread [EMAIL PROTECTED]
On 18 juil, 14:33, antar2 [EMAIL PROTECTED] wrote: I want to replace each first element in list 5 that is equal to the first element of the list of lists4 by the fourth element. I wrote following code that does not work: list4 = [['1', 'a', 'b', 'c'], ['2', 'd', 't', 'e'], ['8', 'g', 'q',

Re: Regular expression help

2008-07-18 Thread Gerard flanagan
[EMAIL PROTECTED] wrote: Hello, I am new to Python, with a background in scientific computing. I'm trying to write a script that will take a file with lines like c afrac=.7 mmom=0 sev=-9.56646 erep=0 etot=-11.020107 emad=-3.597647 3pv=0 extract the values of afrac and etot and plot them. I'm

Help with decorators

2008-07-18 Thread Mr SZ
Hi, I'm using decos for the first time.I want to check the input and then call a function in a class. I'm pasting the code:     def check_input_sanity(self,rover_input):         '''Check the input from client'''         def _check(fn):             def _inner(rover_input):                 if

Re: Regular expression help

2008-07-18 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I think you're over-complicating this. I'm assuming that you're going to do a line graph of some sorta, and each new line of the file contains a new set of data. The problem you mentioned with your regex returning a match object rather than a string

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
What is your (concrete) use case, by the way? I try to make it simple (there is almost 25000 lines of code...) I have a sheet with geometrical objects (points, lines, polygons, etc.) The sheet have an object manager. So, to simplify : sheet.objects.A = Point(0, 0) sheet.objects.B =

Re: Regular expression help

2008-07-18 Thread nclbndk759
On Jul 18, 3:35 pm, Nick Dumas [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I think you're over-complicating this. I'm assuming that you're going to do a line graph of some sorta, and each new line of the file contains a new set of data. The problem you mentioned

[ANN] PyStar 0.1 -- A* graph search algorithm

2008-07-18 Thread Glenn Hutchings
Announcing PyStar, a python module implementing the A* graph search algorithm. Available under the GPL, you can find it at http://fluffybunny.memebot.com/pystar.html I tried to find a decent Python version of this on the Interweb, but the only one I found

Re: trying to match a string

2008-07-18 Thread Andrew Freeman
oj wrote: On Jul 18, 12:10 pm, John Machin [EMAIL PROTECTED] wrote: On Jul 18, 9:05 pm, oj [EMAIL PROTECTED] wrote: On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only contain the chars:L

Re: trying to match a string

2008-07-18 Thread Andrew Freeman
Andrew Freeman wrote: oj wrote: On Jul 18, 12:10 pm, John Machin [EMAIL PROTECTED] wrote: On Jul 18, 9:05 pm, oj [EMAIL PROTECTED] wrote: On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi, Hi, I am taking a string as an input from the user and it should only

Re: trying to match a string

2008-07-18 Thread arni
On Jul 18, 7:51 pm, Andrew Freeman [EMAIL PROTECTED] wrote: Andrew Freeman wrote: oj wrote: On Jul 18, 12:10 pm, John Machin [EMAIL PROTECTED] wrote: On Jul 18, 9:05 pm, oj [EMAIL PROTECTED] wrote: On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: Hi,         Hi,         I am taking

create PyString

2008-07-18 Thread Torsten Mohr
Hi, in an extension module i'd like to create a very large PyString. As the string is very large i'd first like to create the string and let Python allocate the space for it and then fill it from my code. But the only interface that i can find in Python/stringobject.h is: PyAPI_FUNC(PyObject *)

Re: Unusual Exception Behaviour

2008-07-18 Thread Vinay Sajip
On Jul 18, 12:03 pm, Robert Rawlins [EMAIL PROTECTED] wrote: Yeah it's got me a little bemused to be honest, I've tried playing around with configuration options this morning and not been able to achieve anything that works properly. The logging configuration functionality provided by

Re: x, = y (???)

2008-07-18 Thread Andrew Freeman
kj wrote: I just came across an assignment of the form x, = y where y is a string (in case it matters). 1. What's the meaning of the comma in the LHS of the assignment? 2. How could I have found this out on my own? (Regarding (2) above, I consulted the index of several Python reference

Python evening class

2008-07-18 Thread lloyd
I am learning about python but I would like to attend and evening class at college as I find it hard to study at home. Does anyone know of such a class in London UK? -- http://mail.python.org/mailman/listinfo/python-list

Re: Core Dump - Segmentation Fault -Newbie

2008-07-18 Thread Stefan Behnel
Doug Morse wrote: Well, I must be missing something re: why Stefan states that you are using Windows. I don't see that stated in your original post It's stated in the mail headers of his post, though. That's the problem with newbies - you never know where that stops being right. Stefan --

Re: Regular expression help

2008-07-18 Thread Marc 'BlackJack' Rintsch
On Fri, 18 Jul 2008 10:04:29 -0400, Russell Blau wrote: values = {} for expression in line.split( ): if = in expression: name, val = expression.split(=) values[name] = val […] And when you get to be a really hard-core Pythonista, you could write the whole routine

Re: Converting from local - UTC

2008-07-18 Thread M.-A. Lemburg
On 2008-07-18 05:28, Dennis Lee Bieber wrote: On Thu, 17 Jul 2008 20:26:11 -0300, Gabriel Genellina [EMAIL PROTECTED] declaimed the following in comp.lang.python: Note that I used %s everywhere (it's just a placeholder, not a format) and cue the beer commercial

Re: Using Tcl extensions with Python?

2008-07-18 Thread C Martin
On Jul 17, 5:18 pm, Guilherme Polo [EMAIL PROTECTED] wrote: [snip] And.. for tkpng specifically, you won't need tk.call to use it, you just need to create your images using Tkinter.PhotoImage with a png type. Thank you Guilherme, that's all great info. Thomas Troeger [EMAIL PROTECTED] wrote:

Re: x, = y (???)

2008-07-18 Thread kj
In [EMAIL PROTECTED] Matthew Woodcraft [EMAIL PROTECTED] writes: kj wrote: I still don't get it. If we write y = 'Y' x, = y what's the difference now between x and y? And if there's no difference, what's the point of performing such unpacking? If y really is is a string, I think

  1   2   3   >