>> class ChooseDestinationWindow(Frame): def __init__(self,master):
>>super(ChooseDestinationWindow,self).__init_
_(master)
>What exactly does this super method since I have seen it numerous
>times before and as far as I can see it is not anything the user
>created himself in the class?
This has
On 12/08/2011 05:03 PM, Steven D'Aprano wrote:
Robert Berman wrote:
Hi,
Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I
want to get the index of 'c'.
You will need to explain what you mean by "the index of 'c'".
Do you mean 0, because 'c' is in position 0 of the sub-list
On Thu, Dec 8, 2011 at 5:03 PM, Steven D'Aprano wrote:
> Robert Berman wrote:
>
>> Hi,
>>
>> Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I want
>> to get the index of 'c'.
>>
>
> You will need to explain what you mean by "the index of 'c'".
>
> Do you mean 0, because 'c' is
शंतनू wrote:
Using re module:
===
import re
strNum = raw_input("enter numbers, separated by space: ")
if re.search('[^\d ]', strNum):
print('Invalid input')
else:
data = [int(x) for x in strNum.split()]
print(data)
This is not Perl, where everything is a nail that needs to be ham
Robert Berman wrote:
Hi,
Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I want
to get the index of 'c'.
You will need to explain what you mean by "the index of 'c'".
Do you mean 0, because 'c' is in position 0 of the sub-list ['c', 3]?
Or do you mean 2, because 'c' is in
On 12/08/2011 04:27 PM, bod...@googlemail.com wrote:
That won't work because l1[0] is ['a', 1]
What happens if you don't change the code?
l1.index('c')
Bodsda
Sent from my BlackBerry® wireless device
-Original Message-
From: Robert Berman
Sender: tutor-bounces+bodsda=googlemail@py
That won't work because l1[0] is ['a', 1]
What happens if you don't change the code?
l1.index('c')
Bodsda
Sent from my BlackBerry® wireless device
-Original Message-
From: Robert Berman
Sender: tutor-bounces+bodsda=googlemail@python.org
Date: Thu, 08 Dec 2011 16:13:32
To: tutor
S
On 12/8/11, Robert Berman wrote:
> Hi,
>
> Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I want
> to get the index of 'c'. A one dimensional list is extremely easy; val =
> list.index(value). But how do I get it for a list similar to l1. I have
> tried ind = l1[0].index('c') an
Hi,
Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I want
to get the index of 'c'. A one dimensional list is extremely easy; val =
list.index(value). But how do I get it for a list similar to l1. I have
tried ind = l1[0].index('c') and that tells me 'c' is not in list.
Eith
On 08-Dec-2011, at 7:13 PM, Dario Lopez-Kästen wrote:
> oh, yes, no top posting. See below.
>
> On Thu, Dec 8, 2011 at 1:33 PM, surya k wrote:
>
> This is something I am trying to do..
> Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
> directly as numbers. how can
The general rule with GUIs is to bind at the lowest practical level, usually
the widget itself.
The exception is usually for things like global accelerators. For example
launching a
help browser might be at window level.
Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk
>self.Bind(wx.EVT_BUTTON, self.OnSubmit, self.button_submit)
How do you decide when it is appropriate to bind to a panel/frame and when to
bind to the widget itself? I understand that certain events do not propagate up
the widget stack, but what about for events that do? Is there a guideline of
On 08/12/11 09:03, sunil tech wrote:
/Can i copy the content if a dictionary in to another variable, with out
any link between the dictionary & the variable?
if so, please teach.
Yes, but they will both refer to the same object.
But the two references will be entirely independant:
D = {1:2,3:
On 08/12/11 14:49, rail shafigulin wrote:
i created a class and in some instances when i use it call some of its
methods i need to print a method name.
I'm curious why you need this?
In most cases if you call a method you know its name...
myObj = MyClass()
myObj.spam()
print "Just called MyCla
On Thu, Dec 8, 2011 at 7:43 AM, Dario Lopez-Kästen wrote:
>
>
> In that case a for loop with a try-except would better:
>
> strNum = raw_input("enter numbers, separated by space: ").split()
> num_list = []
>
> for token in strNum:
> try:
> num_list.append(int(token))
> except Valu
On 08/12/11 10:59, surya k wrote:
I'm doing puzzles where we need to write code that works as fast a possible
So, how can I check the compile time of my program ?...
Why would that be helpful?
The code is only compiled the first time you use it so any second run
will use the compiled code for
On Thu, Dec 8, 2011 at 10:40 AM, Lie Ryan wrote:
> On 12/09/2011 01:49 AM, rail shafigulin wrote:
>
>> i created a class and in some instances when i use it call some of its
>> methods i need to print a method name. the online search did produce
>> some results but none of them seem to work for m
On Thu, Dec 8, 2011 at 10:17 AM, Joel Goldstick wrote:
>
>
> On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin > wrote:
>
>> i created a class and in some instances when i use it call some of its
>> methods i need to print a method name. the online search did produce some
>> results but none of the
On 12/09/2011 01:49 AM, rail shafigulin wrote:
i created a class and in some instances when i use it call some of its
methods i need to print a method name. the online search did produce
some results but none of them seem to work for me. for example one of
them said just to use __name__ or func_n
>>>mylist = [1,2,3,4,1]
>>>mylist.index(1)
0
But note that this only shows the index for the first occurrence of the item.
Bodsda
Sent from my BlackBerry® wireless device
-Original Message-
From: surya k
Sender: tutor-bounces+bodsda=googlemail@python.org
Date: Thu, 8 Dec 2011 20:5
On 08/12/2011 15:28, surya k wrote:
Well, we all know to know the value when we have the index of a list.
But how can we find it in the reverse way... say a listl=[1,2,3,4]
l[0]=1.but how can I find its address with its value 1 ??
help ([])
...
index(...)
L.index(value, [start, [stop]])
On Thu, Dec 8, 2011 at 10:28 AM, surya k wrote:
>
> Well, we all know to know the value when we have the index of a list. But
> how can we find it in the reverse way...
> say a listl=[1,2,3,4]
> l[0]=1.but how can I find its address with its value 1 ??
> __
Well, we all know to know the value when we have the index of a list. But how
can we find it in the reverse way...
say a listl=[1,2,3,4]
l[0]=1.but how can I find its address with its value 1 ??
___
Tutor mailli
On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin
wrote:
> i created a class and in some instances when i use it call some of its
> methods i need to print a method name. the online search did produce some
> results but none of them seem to work for me. for example one of them said
> just to use __n
On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin
wrote:
> i created a class and in some instances when i use it call some of its
> methods i need to print a method name. the online search did produce some
> results but none of them seem to work for me. for example one of them said
> just to use __n
i created a class and in some instances when i use it call some of its
methods i need to print a method name. the online search did produce some
results but none of them seem to work for me. for example one of them said
just to use __name__ or func_name but it didn't work for me. i'm using
python 3
oh, yes, no top posting. See below.
On Thu, Dec 8, 2011 at 1:33 PM, surya k wrote:
>
> This is something I am trying to do..
> Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
> directly as numbers. how can I do it?
> I could put that numbers as string but not as numbe
This is something I am trying to do..
Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
directly as numbers. how can I do it?
I could put that numbers as string but not as number..
strNum = raw_input('enter:').split()
I can convert the list into numbers by doing this...
f
surya k wrote:
I am using the following code
astr = "foobar"str1 ="foo"astr.find(str1, beg=0, end=3)
You have mangled the code in your email and lost line breaks. Fortunately this
is simple enough to fix:
astr = "foobar"
str1 ="foo"
astr.find(str1, beg=0, end=3)
Please take more care to pos
On 2011/12/08 01:19 PM, surya k wrote:
I am using the following code
astr = "foobar"str1 ="foo"astr.find(str1, beg=0, end=3)
This is showing the following error
Traceback (most recent call last): File "", line 1,
inTypeError: find() takes no keyword arguments
I even tried by importing "string
On 2011/12/08 12:59 PM, surya k wrote:
I'm doing puzzles where we need to write code that works as fast a
possible
So, how can I check the compile time of my program ?...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
Hi Surya,
On 8 December 2011 11:19, surya k wrote:
>
> >>>astr.find(str1, beg=0, end=3)
> This is showing the following error
> Traceback (most recent call last): File "", line 1, in
> TypeError: find() takes no keyword arguments
>
See the documentation for the str.find() method here:
http://do
I am using the following code
astr = "foobar"str1 ="foo"astr.find(str1, beg=0, end=3)
This is showing the following error
Traceback (most recent call last): File "", line 1, in
TypeError: find() takes no keyword arguments
I even tried by importing "string" module, but it isn't working.
This sa
I'm doing puzzles where we need to write code that works as fast a possible
So, how can I check the compile time of my program ?...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription op
Op 08-12-11 10:03, sunil tech schreef:
/Can i copy the content if a dictionary in to another variable, with
out any link between the dictionary & the variable?
/
Have a look at the copy module [1], or use the builtin dict.copy() method.
Cheers,
Timo
[1] http://docs.python.org/library/copy.htm
*Can i copy the content if a dictionary in to another variable, with out
any link between the dictionary & the variable?
if so, please teach.
*
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/
36 matches
Mail list logo