Function parameter passing problem

E

Eduardo Biano

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top