470,810 Members | 880 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Function parameter passing problem


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

def foo1(request, result)
Id_No, FirstName, LastName = result
<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">


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.


Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
Jul 19 '05 #1
0 1017

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by kalinga1234 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.