473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Function parameter passing problem

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
Jul 19 '05 #1
0 1078

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: andy | last post by:
i am coding a dll which contains a function take a const wchar_t* as parameter, call it form a exe, the wchar_t is passed to dll function, but the function in dll will then call another function...
8
by: kalinga1234 | last post by:
there is a problem regarding passing array of characters to another function(without using structures,pointer etc,).can anybody help me to solve the problem.
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
6
by: Minfu Lu | last post by:
I have a problem dealing with passing a function address to a COM callback. I use this COM function for communicating to a hardware. My original project was written in VB. I have converted it to...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
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...
0
tracyyun
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...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.