Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Function parameter passing problem

Reply
Thread Tools

Function parameter passing problem

 
 
Eduardo Biano
Guest
Posts: n/a
 
      05-17-2005
Hi,

I am new to python and tried to pass parameters
between one function to another. I tried two
approaches in doing this but failed.

The first is, I tried to assign a variable in foo1()
inside an HTML <INPUT hidden> tag so that I can
retreive it in foo2() using (get_form_var()). But
failed using my limited python knowledge. The sample
code.

def foo1(request, result)
...........
...........
Id_No, FirstName, LastName = result
"""
<HTML>
......
......
<INPUT NAME="id" TYPE="hidden" VALUE="Id No">
# I would like to assign Id_No variable to id.

<INPUT NAME="submit" TYPE="submit" VALUE="SUBMIT">

.......
......
</HTML>
"""

The second is, I tried using "return Id_No" statement
foo2() function using a return statement below the
</HTML> tag. I tried this option but unfortunately
when I hit the SUBMIT button it only displayed the
variable and got stucked and didn't continue to the
called <FORM action=foo2> foo2().

I also have a problem with my user defined function
foo2() which I created at first with one parameter to
accept the variable of foo1(). But when I added
another parameter to accomodate some more and executed
the code, an error message TypeError: foo2() takes
exactly 2 arguments (1 given). I thought I can put as
many parameters I could since this is user defined
function, am I correct in this?

I have no more options to this problem, hope you will
help me . Thank you in advance.

Cheers!
Ed








Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameter to function not expecting parameter Mister B C Programming 8 08-26-2010 08:01 AM
How to pass a parameter for a function parameter in a function AzamSharp Javascript 2 07-05-2008 12:24 AM
Passing a member function as a parameter of a member function Azdo C++ 2 03-06-2007 11:21 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Passing a pointer to member function as a parameter to another member function Newsgroup - Ann C++ 5 07-30-2003 02:54 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57