clarification

2007-08-16 Thread Beema shafreen
hi everybody, i have a file with data separated by tab mydata: fhl1fkh2 dfp1chk1 mal3alp14 mal3moe1 mal3spi1 mal3bub1 mal3bub3 mal3mph1 mal3mad3 hob1nak1 hob1wsp1 hob1rad3 cdr2cdc13 cdr2cdc2 shows these two are separated by tab represented as

Re: to property or function in class object

2007-08-16 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Aug 2007 02:29:47 +, james_027 wrote: > i am very new to python, not knowing much about good design. I have an > object here for example a Customer object, where I need to retrieve a > info which has a number of lines of code to get it. > > my question is weather what approach shou

Re: using super() to call two parent classes __init__() method

2007-08-16 Thread Steve Holden
7stud wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. > > > class Parent1(object): > def __init__(self): > print "Parent1 init called." > self.x = 10 > > class Parent2(object): >

Re: defaultdict of arbitrary depth

2007-08-16 Thread Steve Holden
Paul McGuire wrote: > On Aug 16, 11:19 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Thu, 2007-08-16 at 20:25 -0700, Paul McGuire wrote: >>> [...] >>> I've hacked out this recursivedefaultdict which is a >>> defaultdict(defaultdict(defaultdict(...))), arbitrarily deep depending >>> on the keys

Re: using super() to call two parent classes __init__() method

2007-08-16 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. > > > class Parent1(object): > def __init__(self): > print "Parent1 init called." > self.x = 10 > > cla

using super() to call two parent classes __init__() method

2007-08-16 Thread 7stud
When I run the following code and call super() in the Base class's __init__ () method, only one Parent's __init__() method is called. class Parent1(object): def __init__(self): print "Parent1 init called." self.x = 10 class Parent2(object): def __init__(self): pr

One Python in a Pub, with 100 Rails Developers...

2007-08-16 Thread Simon Wittber
Python helped deliver the goods last Wednesday evening in front of a one hundred strong crowd of Rails hecklers... Video footage here: http://blog.scouta.com/2007/08/16/iccarus/ ...just kidding, they were all great chaps, and only a few were Rails devs, and only a few of them were hecklers :-) I

Subprocess & ffmpeg

2007-08-16 Thread Andrew Bloomgarden
Hi, I'm having a problem with the subprocess module. I'm using it to run ffmpeg with the following command, where a_cmd is the command string. proc = subprocess.Popen (a_cmd,shell=True,stdout=subprocess.PIPE,universal_newlines=True,stderr= subprocess.STDOUT,stdin=subprocess.PIPE) Then, I'

Re: defaultdict of arbitrary depth

2007-08-16 Thread Carsten Haese
On Thu, 2007-08-16 at 21:27 -0700, Paul McGuire wrote: > Of course, very short and sweet! Any special reason you wrote: > self.default_factory = type(self) > instead of: > self.default_factory = recursivedefaultdict > ? Besides a pathological need to be clever? ;) The former keeps

Re: defaultdict of arbitrary depth

2007-08-16 Thread Paul McGuire
On Aug 16, 11:19 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Thu, 2007-08-16 at 20:25 -0700, Paul McGuire wrote: > > [...] > > I've hacked out this recursivedefaultdict which is a > > defaultdict(defaultdict(defaultdict(...))), arbitrarily deep depending > > on the keys provided in the refere

Re: about negative polar plots

2007-08-16 Thread greg
yadin wrote: > hi am doing a polar plot of the radiation pattern of an antenna. > the polar plots represents the value of the power in dB's and the dB > go from -40dB to 0dB Add 40 so that the range goes from 0 to 40, then plot that to an appropriate scale. -- Greg -- http://mail.python.org/mail

Re: defaultdict of arbitrary depth

2007-08-16 Thread Carsten Haese
On Thu, 2007-08-16 at 20:25 -0700, Paul McGuire wrote: > [...] > I've hacked out this recursivedefaultdict which is a > defaultdict(defaultdict(defaultdict(...))), arbitrarily deep depending > on the keys provided in the reference. > > Please comment. > [...] > > class recursivedefaultdict(object

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Carsten Haese
On Fri, 17 Aug 2007 03:15:10 -, beginner wrote > On Aug 16, 9:32 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > What is the best solution in Perl need not be the best solution in > > Python. In Python you should just use a tuple as your dict key, i.e. > > a[k1,k2] = v, unless you have some ot

Re: Memory leak when creating lots of object

2007-08-16 Thread Godzilla
On Aug 16, 1:13 am, Paul Moore <[EMAIL PROTECTED]> wrote: > On 14 Aug, 05:57, Godzilla <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I have a program that create and pop an object off a queue, but it is > > experiencing some memory leakage. I have been unable to detect where > > the memory leakage

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread James Stroud
beginner wrote: > On Aug 16, 9:32 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > >>On Fri, 2007-08-17 at 00:53 +, beginner wrote: >> >>>$b is supposed to be a hash-table of hash-table. If a key exists in >>>$b, it points to another hash table. The $a=$b->{"A"} ||={} pattern is >>>useful when y

defaultdict of arbitrary depth

2007-08-16 Thread Paul McGuire
In responding to another post on defaultdict, I posted an implementation of a 2-level hashtable, by creating a factory method that returned a defaultdict(dict). The OP of that other thread was trying to build a nested tree from a set of n-tuples, in which the first (n-1) values in each tuple were

Re: why psyco using more memery in liunx?

2007-08-16 Thread Steve Holden
kyo guan wrote: > Hi all: > > When you import psyco in python2.5, you can see the memery grow up near > 40MB in linux. but the same version python and > psyco, is only grow up 1MB under windows. > Please don't repeat the question again. It *has* reached the list. Patience is a virtue ...

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread beginner
On Aug 16, 5:35 pm, beginner <[EMAIL PROTECTED]> wrote: > Hi All. > > I'd like to do the following in more succint code: > > if k in b: > a=b[k] > else: > a={} > b[k]=a > > a['A']=1 > > In perl it is just one line: $a=$b->{"A"} ||={}. > > Thanks, > Geoffrey It looks like defaultdict is

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread beginner
On Aug 16, 9:32 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-08-17 at 00:53 +, beginner wrote: > > $b is supposed to be a hash-table of hash-table. If a key exists in > > $b, it points to another hash table. The $a=$b->{"A"} ||={} pattern is > > useful when you want to add record

Re: clarification

2007-08-16 Thread Michael Bentley
On Aug 16, 2007, at 2:42 AM, Beema shafreen wrote: hi every body, i have compared two files: code: fh = open('HPRD_MAIN_20.txt','r') for line in fh.readlines(): data = line.strip().split('#') fh1 = open('NOMENCLATURE_MAIN_20.txt','r') for line1 in fh1.readlines():

why psyco using more memery in liunx?

2007-08-16 Thread kyo guan
Hi all: When you import psyco in python2.5, you can see the memery grow up near 40MB in linux. but the same version python and psyco, is only grow up 1MB under windows. kyo -- http://mail.python.org/mailman/listinfo/python-list

why psyco using more memery in liunx?

2007-08-16 Thread Kyo Guan
Hi all: When you import psyco in python2.5, you can see the memery grow up near 40MB in linux. but the same version python and psyco, is only grow up 1MB under windows. kyo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Carsten Haese
On Fri, 2007-08-17 at 00:53 +, beginner wrote: > $b is supposed to be a hash-table of hash-table. If a key exists in > $b, it points to another hash table. The $a=$b->{"A"} ||={} pattern is > useful when you want to add records to the double hash table. > > For example, if you have a series of

to property or function in class object

2007-08-16 Thread james_027
hi, i am very new to python, not knowing much about good design. I have an object here for example a Customer object, where I need to retrieve a info which has a number of lines of code to get it. my question is weather what approach should I use? to use the property which is from the python new

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Paul McGuire
On Aug 16, 7:53 pm, beginner <[EMAIL PROTECTED]> wrote: > On Aug 16, 6:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: > > > > > > > beginner wrote: > > > Hi All. > > > > I'd like to do the following in more succint code: > > > > if k in b: > > > a=b[k] > > > else: > > > a={} > > > b[k]=

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread James Stroud
beginner wrote: > On Aug 16, 6:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: >>I'm afraid you've asked a non sequiter: >> >>euler 40% cat test.pl >> >>$a=$b->{"A"} ||={} ; >>print "$a\n" ; >> >>$b->{"B"} = 0 ; >>$a=$b->{"B"} ||={} ; >>print "$a\n" ; >> >>$b->{"X"} = 15 ; >>$a=$b->{"X"} ||={} ; >>p

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Paul McGuire
On Aug 16, 6:03 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Aug 16, 6:35 pm, beginner <[EMAIL PROTECTED]> wrote: > > > Hi All. > > > I'd like to do the following in more succint code: > > > if k in b: > > a=b[k] > > else: > > a={} > > b[k]=a > > > a['A']=1 > > > In perl it is just on

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Paul McGuire
On Aug 16, 8:28 pm, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Aug 16, 3:35 pm, beginner <[EMAIL PROTECTED]> wrote: > > > > > In perl it is just one line: $a=$b->{"A"} ||={}. > > a = b.setdefault('A', {}) > > This combines all two actions together: > - Sets b['A'] to {} if it is not already d

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Jonathan Gardner
On Aug 16, 3:35 pm, beginner <[EMAIL PROTECTED]> wrote: > > In perl it is just one line: $a=$b->{"A"} ||={}. > a = b.setdefault('A', {}) This combines all two actions together: - Sets b['A'] to {} if it is not already defined - Assigns b['A'] to a More info on dict methods here: http://docs.pyt

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread beginner
On Aug 16, 6:21 pm, James Stroud <[EMAIL PROTECTED]> wrote: > beginner wrote: > > Hi All. > > > I'd like to do the following in more succint code: > > > if k in b: > > a=b[k] > > else: > > a={} > > b[k]=a > > > a['A']=1 > > > In perl it is just one line: $a=$b->{"A"} ||={}. > > I'm afra

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Thomas Jollans wrote: > On Thursday 16 August 2007, Robert Dailey wrote: >> Hi, >> >> I previously created a topic named "Pass by reference or by value" where I >> inquired on how python's function parameters work. I received a lot of nice >> responses, however I'm still confused on the topic. Note

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Robert Dailey wrote: [but he top-posted, so he should consider himself smacked on the wrist] > On 8/16/07, *Steve Holden* <[EMAIL PROTECTED] > > wrote: > > Robert Dailey wrote: > > So immutable objects cannot be modified directly? I guess this means > > int

Re: Cancelling events on a COM Object

2007-08-16 Thread Roger Upole
Oliver Nelson wrote: >I have MapPoint working in Python, and I'm trying to cancel events on the map, >but I can't seem to make that happen. I'm >responding to the events successfully in my panel object. My code is like >this: > > global MapPointMod > MapPointMod = > win32com.client.gencache.

Re: Cancelling events on a COM Object

2007-08-16 Thread James Stroud
Oliver, wait a while before you panic about your post not getting through! James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Cancelling events on a COM Object

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod = win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-

Events in Com Object for Python

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod = win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread James Stroud
beginner wrote: > Hi All. > > I'd like to do the following in more succint code: > > if k in b: > a=b[k] > else: > a={} > b[k]=a > > a['A']=1 > > > In perl it is just one line: $a=$b->{"A"} ||={}. I'm afraid you've asked a non sequiter: euler 40% cat test.pl $a=$b->{"A"} ||={}

Re: Pass by reference or by value?

2007-08-16 Thread Thomas Jollans
On Thursday 16 August 2007, Robert Dailey wrote: > Hi, > > I previously created a topic named "Pass by reference or by value" where I > inquired on how python's function parameters work. I received a lot of nice > responses, however I'm still confused on the topic. Note that I come from a > C++ bac

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Carl Banks
On Aug 16, 6:35 pm, beginner <[EMAIL PROTECTED]> wrote: > Hi All. > > I'd like to do the following in more succint code: > > if k in b: > a=b[k] > else: > a={} > b[k]=a > > a['A']=1 > > In perl it is just one line: $a=$b->{"A"} ||={}. > > Thanks, > Geoffrey Define b as a default dict:

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread beginner
On Aug 16, 5:43 pm, [EMAIL PROTECTED] (Lawrence Oluyede) wrote: > beginner <[EMAIL PROTECTED]> wrote: > > I'd like to do the following in more succint code: > > > if k in b: > > a=b[k] > > else: > > a={} > > b[k]=a > > b.setdefault(k, a) > > -- > Lawrence, oluyede.org - neropercaso.it >

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Lawrence Oluyede
beginner <[EMAIL PROTECTED]> wrote: > I'd like to do the following in more succint code: > > if k in b: > a=b[k] > else: > a={} > b[k]=a b.setdefault(k, a) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not

How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread beginner
Hi All. I'd like to do the following in more succint code: if k in b: a=b[k] else: a={} b[k]=a a['A']=1 In perl it is just one line: $a=$b->{"A"} ||={}. Thanks, Geoffrey -- http://mail.python.org/mailman/listinfo/python-list

Canceling events from COM Objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod = win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
Thanks Steve for your explanation. It was very helpful. I think I understand it now. By the way, by the .set method I meant: class Integer: def __init__( self, number=0 ): self._int = number def set( self, number ): self._int = number # later on mutableInt = Integer(

Canceling events from COM Objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod = win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-

Canceling events from COM objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod = win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Robert Dailey wrote: > So immutable objects cannot be modified directly? I guess this means > integers are immutable and the act of assigning to one is a completely > new definition? Correct. A new value is bound to the name or item on the left-hand side - remember, all variables are pointers

Re: advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Steven Bethard wrote: >Gerardo Herzig wrote: > > >>Hi all. I guess i have a conceptual question: >>Im planing using a quite simple decorator to be used as a conditional >>for the execution of the function. I mean something like that: >> >>@is_logued_in >>def change_pass(): >> bla >> bla >>

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
So immutable objects cannot be modified directly? I guess this means integers are immutable and the act of assigning to one is a completely new definition? So if I were to create a class called Integer and give it a .set() method, this would allow me to create mutable integers, and thus passing in

Re: advice about `correct' use of decorator

2007-08-16 Thread Steven Bethard
Gerardo Herzig wrote: > Hi all. I guess i have a conceptual question: > Im planing using a quite simple decorator to be used as a conditional > for the execution of the function. I mean something like that: > > @is_logued_in > def change_pass(): >bla >bla > > And so on for all the other

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Robert Dailey wrote: > Hi, > > I previously created a topic named "Pass by reference or by value" where > I inquired on how python's function parameters work. I received a lot of > nice responses, however I'm still confused on the topic. Note that I > come from a C++ background to Python, so an

Re: sub-classing the types in the builtin module datetime

2007-08-16 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > On Aug 15, 5:54 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: >> I posted this about 5 hours ago, but it seems to have gone astray. > > > (snipped) > >> > >> >> I wish to sub-class (if that's the right word) datetime and to use a >> >> different signature for t

Re: advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Gerardo Herzig wrote: >> Hi all. I guess i have a conceptual question: >> Im planing using a quite simple decorator to be used as a conditional >> for the execution of the function. I mean something like that: >> >> @is_logued_in >> def change_pass(): >> bla >> bla >> >> And so on for all

Pass by reference or by value?

2007-08-16 Thread Robert Dailey
Hi, I previously created a topic named "Pass by reference or by value" where I inquired on how python's function parameters work. I received a lot of nice responses, however I'm still confused on the topic. Note that I come from a C++ background to Python, so any comparisons to C++ would be very h

Re: ploting issues in program

2007-08-16 Thread Steve Holden
Peter Otten wrote: > Steve Holden wrote: > >> I might ask just exactly what is being plotted to give those answers. It >> sounds like field strength, but I am having difficulty envisaging a >> field that is weakest at its center - is this some sort of alternative >> universe you are plotting :-) ?

Re: Hijack! Different book:

2007-08-16 Thread Steve Holden
Dennis Lee Bieber wrote: > On Thu, 16 Aug 2007 04:21:07 -0700, Paul Boddie <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> Is this the book that came out before TurboGears even reached 1.0, >> probably having diminished relevance now that there are 1.1 and 2.0 > >

Re: advice about `correct' use of decorator

2007-08-16 Thread Laszlo Nagy
Gerardo Herzig wrote: > Hi all. I guess i have a conceptual question: > Im planing using a quite simple decorator to be used as a conditional > for the execution of the function. I mean something like that: > > @is_logued_in > def change_pass(): > bla > bla > > And so on for all the other

Re: A problem with Time

2007-08-16 Thread Roger Miller
On Aug 16, 9:46 am, MRAB <[EMAIL PROTECTED]> wrote: > > As well as the other replies, this also works (as far as I can tell!): > > import time > today = time.localtime() > yesterday = today[ : 2] + (today[2] - 1, ) + today[3 : ] > yesterday = time.localtime(time.mktime(yesterday)) This is somethin

Haskell lambdas in python

2007-08-16 Thread Michael Speer
Hello python-list, I decided to have some fun and altered a copy of python to use a Haskell-like syntax for declaring lambdas. >>> filter( \ x -> x == 3 or x > 8 , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) [3, 9, 10] >>> ( \-> "Hello World!" )() 'Hello World!' While doing this I found somethi

Re: sub-classing the types in the builtin module datetime

2007-08-16 Thread [EMAIL PROTECTED]
On Aug 15, 5:54 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > I posted this about 5 hours ago, but it seems to have gone astray. (snipped) > > > >> I wish to sub-class (if that's the right word) datetime and to use a > >> different signature for the constructor. > >> > >> The second

advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all the other functions who needs that the user is sti

Re: Accessing Windows Network Share?

2007-08-16 Thread frikk
On Aug 16, 3:03 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > > > > > > > On Aug 16, 2:43 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > > > > > I previously posted about accessing SharePoint over t

Re: A problem with Time

2007-08-16 Thread MRAB
On Aug 16, 4:30 pm, "special_dragonfly" <[EMAIL PROTECTED]> wrote: > Hello, > > I need to return the date yesterday in the form DDMM. I looked through > the modules: time, datetime and calendar but can't find anything that leaps > out at me. > > The problem I'm having is that although I can use

Re: Help me!!

2007-08-16 Thread Gerardo Herzig
Anhoter HURRA for list comprehensions: >>> a = ['a', 'b', 'c', 'd'] >>> b = ['a','c'] >>> [x in b and x.upper() or x for x in a] ['A', 'b', 'C', 'd'] Is what you want? Cheers Gerardo >I'm trying to compare the list with another list and if it is there in >both I'm changing it to upper case an

Re: (sort of) deterministic timing in Python

2007-08-16 Thread Paul Rubin
[EMAIL PROTECTED] (John Fisher) writes: > mark start time > start event > event finishes > count time until next interval > start second event… > > rather than this: > > start event > event finishes > sleep for interval > start second event > ... > So how do I accomplish this in

wxpython log redirect

2007-08-16 Thread vedrandekovic
Hello, Why this wx example don't return \nHELLO WORLD and other text in same window: import wx import logging import sys def nekaj(): print "\nHELLO WORLD" class WxLog(logging.Handler): def __init__(self, ctrl): logging.Handler.__init__(self) self.ctrl = ctrl def em

Re: Help me!!

2007-08-16 Thread beginner
On Aug 16, 2:26 pm, beginner <[EMAIL PROTECTED]> wrote: > > Some one help me so that > > If ab = [a,b,c,d] > > and cd = [a,c] > > my global list file should be [A,b,C,d] If there is a lot of entries in the list, I would consider using an indexed data structure such as dict. ab=['a','b','c','d']

Re: Help me!!

2007-08-16 Thread beginner
> Some one help me so that > If ab = [a,b,c,d] > and cd = [a,c] > my global list file should be [A,b,C,d] If there is a lot of entries in the list, I would consider using an indexed data structure such as dict. >>> ab=['a','b','c','d'] >>> cd=['a','c'] >>> common=[x.upper() for x in ab if x in c

Idea for joined() builtin

2007-08-16 Thread Rhamphoryncus
I know similar things have been argued before, but little things (like the joined name implying a copy) can make a big difference. That and I'm providing a simple implementation that works right now, so you don't have to wait for it to ever become a builtin. ;) >>> joined([], [[1,2,3], [4,5,6]])

Help me!!

2007-08-16 Thread Rohan
I have the following piece of code a = len(ab_file) b= 0 while(bhttp://mail.python.org/mailman/listinfo/python-list

Re: Accessing Windows Network Share?

2007-08-16 Thread Chris Mellon
On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > On Aug 16, 2:43 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > I previously posted about accessing SharePoint over the web. Well I > > > have since given up any easy means of doi

Re: Accessing Windows Network Share?

2007-08-16 Thread frikk
On Aug 16, 2:43 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > > > > > > > I previously posted about accessing SharePoint over the web. Well I > > have since given up any easy means of doing this, since something else > > has perked my interest. Inst

Re: Accessing Windows Network Share?

2007-08-16 Thread Chris Mellon
On 8/16/07, frikk <[EMAIL PROTECTED]> wrote: > I previously posted about accessing SharePoint over the web. Well I > have since given up any easy means of doing this, since something else > has perked my interest. Instead of going to http://sharepoint/site, > why not just access \\sharepoint\site\

Tuning - Styling

2007-08-16 Thread [EMAIL PROTECTED]
Cool cars, tuning & styling, modified cars, many upgrades here... http://tuning-styling.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Accessing Windows Network Share?

2007-08-16 Thread frikk
I previously posted about accessing SharePoint over the web. Well I have since given up any easy means of doing this, since something else has perked my interest. Instead of going to http://sharepoint/site, why not just access \\sharepoint\site\ directly? So my question is this - How do I access

Re: ploting issues in program

2007-08-16 Thread Peter Otten
Steve Holden wrote: > I might ask just exactly what is being plotted to give those answers. It > sounds like field strength, but I am having difficulty envisaging a > field that is weakest at its center - is this some sort of alternative > universe you are plotting :-) ? I believe the OP is tryin

Re: Module imports during object instantiation

2007-08-16 Thread Ritesh Raj Sarraf
Steve Holden wrote: > Ritesh Raj Sarraf wrote: >> On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: >>> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> > [...] >> Oops!!! Looks like I completely missed this. It _did_ print the error >> message. >> Apologies to all

Re: A problem with Time

2007-08-16 Thread BartlebyScrivener
On Aug 16, 10:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > RTFM is the answer... I don't know. I remember scratching my head for a day or two over the module explanations and instructions until I found a little howto with a lot of explicite examples. http://pleac.sourceforge.net/pleac_

Re: ctypes and C99 complex numbers

2007-08-16 Thread Martin v. Löwis
Thomas Heller schrieb: > Eugen Wintersberger schrieb: >> Hi there >> I want to use ctypes in connection with C functions that use complex >> datatypes defined in the C99 standard. Does someone know a simple way >> how to implement this? Are there any plans to integrate the C99 complex >> data type

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Martin v. Löwis
>> Why do you think they are not? > > Because they aren't. You even mentioned that a few operations that > aren't atomic. OTOH, the OP specifically asked for .append() and .pop(), which are atomic. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Chris Mellon
On 8/16/07, John Nagle <[EMAIL PROTECTED]> wrote: > A.T.Hofkamp wrote: > > On 2007-08-15, Larry Bates <[EMAIL PROTECTED]> wrote: > > > >>or the mildy > >>amusing "how do I write bytes not characters to a file" questions at least > >>once > >>a week on this forum. > > Actually, that's a reasona

Re: Layer 2 socket connection

2007-08-16 Thread alisonken1
On Aug 16, 5:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I use impacket for stuff like that, > seehttp://oss.coresecurity.com/projects/impacket.html > > Cheers > > Rich. Thanks, Rich - I'll have a look -- http://mail.python.org/mailman/listinfo/python-list

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Matt McCredie
> Why do you think they are not? Because they aren't. You even mentioned that a few operations that aren't atomic. If operations are atomic it isn't necessarily because of the design of the list, but the design of CPython. More specifically the GIL. I don't mean to imply that you can't get a multi

Re: ploting issues in program

2007-08-16 Thread Gerard Flanagan
On Aug 16, 9:48 am, yadin <[EMAIL PROTECTED]> wrote: > hi every one! > > can you please help me to fix these polar plot in db's > so that the center is at the minimun negative number in voltagedb > about [-50] > and the maximun is at zero and how can i see values on the axis like > showing that the

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Diez B. Roggisch
John Nagle schrieb: > A.T.Hofkamp wrote: >> On 2007-08-15, Larry Bates <[EMAIL PROTECTED]> wrote: >> >>> or the mildy >>> amusing "how do I write bytes not characters to a file" questions at >>> least once >>> a week on this forum. > >Actually, that's a reasonable question, and one that Pytho

Re: A problem with Time

2007-08-16 Thread Gary Herron
special_dragonfly wrote: > Hello, > > I need to return the date yesterday in the form DDMM. I looked through > the modules: time, datetime and calendar but can't find anything that leaps > out at me. > > The problem I'm having is that although I can use time.localtime and get a > tuple of th

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Neil Cerutti
On 2007-08-16, John Nagle <[EMAIL PROTECTED]> wrote: >>>or the mildy amusing "how do I write bytes not characters to a >>>file" questions at least once a week on this forum. > > Actually, that's a reasonable question, and one that Python didn't do > quite right. > > Remember, in the beginni

Re: A problem with Time

2007-08-16 Thread Neil Cerutti
On 2007-08-16, Shawn Milochik <[EMAIL PROTECTED]> wrote: > import time > > > oneDay = 60 * 60 * 24 #seconds in one day > > date = time.time() > > yesterday = date - oneDay Or use a timedelta. >>> import datetime >>> yesterday = datetime.datetime.today() - datetime.timedelta(days=1) >>> yesterday.

Re: A problem with Time

2007-08-16 Thread Diez B. Roggisch
special_dragonfly schrieb: > Hello, > > I need to return the date yesterday in the form DDMM. I looked through > the modules: time, datetime and calendar but can't find anything that leaps > out at me. > > The problem I'm having is that although I can use time.localtime and get a > tuple o

Re: A problem with Time

2007-08-16 Thread syndrowm
On 8/16/07, special_dragonfly <[EMAIL PROTECTED]> wrote: > > Hello, > > I need to return the date yesterday in the form DDMM. I looked through > the modules: time, datetime and calendar but can't find anything that > leaps > out at me. > > The problem I'm having is that although I can use time.

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread John Nagle
A.T.Hofkamp wrote: > On 2007-08-15, Larry Bates <[EMAIL PROTECTED]> wrote: > >>or the mildy >>amusing "how do I write bytes not characters to a file" questions at least >>once >>a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite right. Reme

Re: A problem with Time

2007-08-16 Thread Shawn Milochik
import time oneDay = 60 * 60 * 24 #seconds in one day date = time.time() yesterday = date - oneDay -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes and C99 complex numbers

2007-08-16 Thread Thomas Heller
Eugen Wintersberger schrieb: > Hi there > I want to use ctypes in connection with C functions that use complex > datatypes defined in the C99 standard. Does someone know a simple way > how to implement this? Are there any plans to integrate the C99 complex > data types in the ctypes module? I hav

A problem with Time

2007-08-16 Thread special_dragonfly
Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use time.localtime and get a tuple of the year, month, day and so forth, I don'

Car Air Conditioners

2007-08-16 Thread tunedstyle
All the informations about car air conditioners, how to install, repair, service all can be found on this website... http://car-air-conditioning.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem using Optional pyparsing

2007-08-16 Thread Paul McGuire
On Aug 16, 2:09 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I know this isnt the pyparsing list, but it doesnt seem like there is > one. I m trying to use pyparsing to parse a file however I cant get > the Optional keyword to work. Thanks, Peter, your comments are dead-on. Pypars

Re: FM synthesis using Numpy

2007-08-16 Thread Joost Molenaar
Thanks/bedankt Bas for the educative reply. I think I got misleaded by Max/MSP's tutorial[1], because MSP seems to automatically adjust the phase when you combine two oscillators in the way that I did. Joost [1] page 112 of http://www.cycling74.com/download/MSP45TutorialsAndTopics.pdf -- http://

How do you guys convert a tuple into a Set in ABAQUS?

2007-08-16 Thread Baisong Du
A function is defined to get a tuple. def searchObjectByRange(partObject, objectType, xRange, yRange, zRange): """In the partObject, search objects (edge, face, etc.) within the given region""" TOLERANCE_GLOBAL = 1.0E-6 INFINITE_RANGE = (-1.0E309, 1.0E309) tolerance = TOL

Re: Python Book Recommendations

2007-08-16 Thread Shawn Milochik
I should add that "Dive Into Python" is also available for free online: http://www.diveintopython.org/ It's a great book. It is not a linear book -- it doesn't start you off talking about variable types and structure. It starts you right off with a piece of working code. If you already have some

Re: (Re)announcing APL 2007

2007-08-16 Thread glarocque
On Aug 10, 12:40 pm, [EMAIL PROTECTED] wrote: > On Aug 6, 9:20 am, Paul Mansour <[EMAIL PROTECTED]> wrote: > > > APL2007 Roll Call: Is anyone going to this? > > > I'm thinking about going, but I don't want to the only one to show up, > > as in San Diego. > > Here here. > > Sorry to mention the elep

  1   2   >