*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:
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]
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
I am using the following code
astr = foobarstr1 =fooastr.find(str1, beg=0, end=3)
This is showing the following error
Traceback (most recent call last): File interactive input, line 1, in
moduleTypeError: find() takes no keyword arguments
I even tried by importing string module, but it isn't
Hi Surya,
On 8 December 2011 11:19, surya k sur...@live.com wrote:
astr.find(str1, beg=0, end=3)
This is showing the following error
Traceback (most recent call last): File interactive input, line 1, in
moduleTypeError: find() takes no keyword arguments
See the documentation for the
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
On 2011/12/08 01:19 PM, surya k wrote:
I am using the following code
astr = foobarstr1 =fooastr.find(str1, beg=0, end=3)
This is showing the following error
Traceback (most recent call last): File interactive input, line 1,
inmoduleTypeError: find() takes no keyword arguments
I even tried by
surya k wrote:
I am using the following code
astr = foobarstr1 =fooastr.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 post code
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...
oh, yes, no top posting. See below.
On Thu, Dec 8, 2011 at 1:33 PM, surya k sur...@live.com 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
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
On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin
rail.shafigu...@gmail.comwrote:
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
On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin
rail.shafigu...@gmail.comwrote:
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
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
On Thu, Dec 8, 2011 at 10:28 AM, surya k sur...@live.com 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 ??
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,
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 sur...@live.com
Sender: tutor-bounces+bodsda=googlemail@python.org
Date: Thu, 8 Dec
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
On Thu, Dec 8, 2011 at 10:17 AM, Joel Goldstick joel.goldst...@gmail.comwrote:
On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin rail.shafigu...@gmail.com
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
On Thu, Dec 8, 2011 at 10:40 AM, Lie Ryan lie.1...@gmail.com 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
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
On Thu, Dec 8, 2011 at 7:43 AM, Dario Lopez-Kästen cl2dl...@gmail.comwrote:
snip
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))
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
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 =
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
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
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 sur...@live.com 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.
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.
On 12/8/11, Robert Berman berma...@cfl.rr.com 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 =
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 berma...@cfl.rr.com
Sender: tutor-bounces+bodsda=googlemail@python.org
Date: Thu, 08 Dec 2011
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 Bermanberma...@cfl.rr.com
Sender:
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
शंतनू 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
On Thu, Dec 8, 2011 at 5:03 PM, Steven D'Aprano st...@pearwood.info 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'
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
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 to do
36 matches
Mail list logo