Dear All,
In unittesting in python, how can I use variables of setUpModule() in tests?
example:
import unittest
def setUpModule():
b = 20 #> how can I use this variable in testa print
class A(unittest.TestCase):
def testa(self):
a = 10
print(a + b)
if __name__ ==
Hi All,
Is there any way to convert x = (1, 2, 3, (4, 5)) to x = (1, 2, 3, 4, 5) in
python 2.7
Thanks in advance
Ram.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Hi,
Can you please explain the functionality of collections.Callable ? If
possible with a code snippet.
I could not find a good explanation on google.
Thanks,
Ram.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
h
Hi All,
I know
> sum([1,2,3]) returns 6.
But sum with [] 'empty list' as second parameter returns as below.
> sum([[1,2,3], [3,4,5]], []) returns [1, 2, 3, 3, 4, 5]
Can any one please explain this logic ? I searched in google but could not
find the suitable answer.
Thanks in advance.
Thanks,
nice explanation .. thanks
this cleared my doubt
>>> k = [20]
>>> for i in [[1,2,3],[3,4,5]]:
... k += i
...
>>> k
[20, 1, 2, 3, 3, 4, 5]
On Tue, Aug 1, 2017 at 1:35 AM, Alan Gauld via Tutor
wrote:
> On 01/08/17 07:06, ramakrishna reddy wrote:
>
> >&g
Hi there,
I am implementing a soap webservice where a method which has keyword
parameter(named:abc-xyz) needs to be used to call third party app.
eg: obj.method(abc-xyz=10)
As python does not support '-' in variable names, I am a bit confused.
I know in case of methods we can use getattr(self.ob