Function parameter passing problem

Discussion in 'Python' started by Eduardo Biano, May 17, 2005.

  1. 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
    Eduardo Biano, May 17, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newsgroup - Ann
    Replies:
    5
    Views:
    592
    John Carson
    Jul 30, 2003
  2. andy
    Replies:
    4
    Views:
    756
    Jonathan Turkanis
    Feb 21, 2004
  3. Azdo
    Replies:
    2
    Views:
    427
  4. Mister B
    Replies:
    8
    Views:
    530
    Nick Keighley
    Aug 26, 2010
  5. AzamSharp
    Replies:
    2
    Views:
    162
Loading...

Share This Page