I need something like this:
def func1(*args, **kwargs):
if some_cond:
return func2(*args, **kwargs)
else:
return func3(some_other_args, **kwargs)
Thank you in advance, D. 13 1345
dmitrey <op*****@ukr.netwrote:
I need something like this:
def func1(*args, **kwargs):
if some_cond:
return func2(*args, **kwargs)
else:
return func3(some_other_args, **kwargs)
Thank you in advance, D.
You 'need something like this', so write something like that.
Did you intend to ask a question?
On Jul 1, 12:00 pm, Duncan Booth <duncan.bo...@invalid.invalidwrote:
You 'need something like this', so write something like that.
Did you intend to ask a question?
I would gladly write the one, but the example doesn't work, and I
don't know any easy way (moreover any way) to make it work correctly.
D.
dmitrey <op*****@ukr.netwrote:
On Jul 1, 12:00 pm, Duncan Booth <duncan.bo...@invalid.invalidwrote:
>You 'need something like this', so write something like that. Did you intend to ask a question?
I would gladly write the one, but the example doesn't work, and I
don't know any easy way (moreover any way) to make it work correctly.
D.
The example doesn't work because it isn't a real example (what are
some_cond or some_other_args?). An identical example which runs but doesn't
give the output you expect would be more meaningful.
If you actually wrote a runnable example, and explained what about it you
think doesn't work, then I could probably tell you how to fix it without
having to engage my telepathy.
The only thing I can see wrong with your made-up example is that you may
have intended a * before some_other_args, but since it isn't a real example
it is probably just a typo rather than being your question.
Thanks all, I have solved the problem.
D.
dmitrey ha escrito:
Thanks all, I have solved the problem.
D.
If you take the time to comment this, it is good form to comment on
how you solved the problem, so the next one wondering about it can
find an answer before posting.
--
Saludos
Adriano
dmitrey wrote:
Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Frank Swarbrick a écrit :
dmitrey wrote:
>Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.
Nis
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.
Nis
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.
Nis
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.
Nis
Frank Swarbrick <in*****@earthlink.netwrote:
>dmitrey wrote:
>Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Hey, if we're expected to magically deduce what the problem is
without being told an error messages, surely we can magically
deduce the discovered solution too?
--
\S -- si***@chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
"Frankly I have no feelings towards penguins one way or the other"
-- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
Sion Arrowsmith <si***@chiark.greenend.org.ukwrote:
Frank Swarbrick <in*****@earthlink.netwrote:
>>dmitrey wrote:
>>Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Hey, if we're expected to magically deduce what the problem is
without being told an error messages, surely we can magically
deduce the discovered solution too?
Quite so. Meanwhile the OP is killfiled so can't expect any help from me in
the future. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Achim Domma |
last post by:
Hi,
I'm using py2exe to create a exe out of a python script. If works fine so
far, but a get lot's of this warnings:
warning: use func(*args, **kwargs) instead of apply(func, args, kwargs)
...
|
by: Jim Jewett |
last post by:
Normally, I expect a subclass to act in a manner consistent
with its Base classes. In particular, I don't expect to
*lose* any functionality, unless that was the whole point of
the subclass. ...
|
by: Stefan Behnel |
last post by:
Hi!
I'm trying to do this in Py2.4b1:
-------------------------------
import logging
values = {'test':'bla'}
logging.log(logging.FATAL, 'Test is %(test)s', values)...
|
by: Tor Rustad |
last post by:
I have a C program, where I control the error behavior according to context:
/* some error handlers */
static void on_error_log (MYSQL *mysql, const char *msg, ...);
....
static void...
|
by: dmitrey |
last post by:
hi all,
howto check is object Arg1
- a func, lambda-func
- something else?
I tried callable(Arg1), but callable(lambda-func) returnes False
Thx, D.
|
by: dmitrey |
last post by:
hi all,
can anyone explain howto get function from module, known by string
names?
I.e. something like
def myfunc(module_string1, func_string2, *args):
eval('from ' + module_string1 + 'import...
|
by: JonathanB |
last post by:
Ok, this is probably definitely a newbie question, but I have looked
all over the Python library reference material and tutorials which I
can find online and I cannot find a clear definition of...
|
by: Sean DiZazzo |
last post by:
Why is the following not working? Is there any way to get keyword
arguments working with exposed XMLRPC functions?
~~~~~~~~~~~~~~~~ server.py
import SocketServer
from SimpleXMLRPCServer import...
|
by: dmitrey |
last post by:
hi all,
howto check is function capable of obtaining **kwargs?
i.e. I have some funcs like
def myfunc(a,b,c,...):...
some like
def myfunc(a,b,c,...,*args):...
some like
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |