About 423,000 results
Open links in new tab
  1. python - How do I pass variables across functions? - Stack Overflow

    I want to pass values (as variables) between different functions. For example, I assign values to a list in one function, then I want to use that list in another function: list = [] def defineALis...

  2. Passing an integer by reference in Python - Stack Overflow

    Mar 1, 2013 · How can I pass an integer by reference in Python? I want to modify the value of a variable that I am passing to the function. I have read that everything in Python is pass by …

  3. python - How do I pass a variable by reference? - Stack Overflow

    Jun 12, 2009 · Python: Python is “pass-by-object-reference”, of which it is often said: “Object references are passed by value.” (read here). Both the caller and the function refer to the …

  4. python - Can a variable number of arguments be passed to a …

    May 28, 2009 · Since the question implies a variable number of items this answer is not really applicable. More generally you can mix a fixed number items passed by position and a …

  5. Python - Passing a function into another function - Stack Overflow

    I am solving a puzzle using python and depending on which puzzle I am solving I will have to use a special set of rules. How can I pass a function into another function in Python? Example def …

  6. python - How to pass arguments to a Button command in Tkinter?

    Aug 3, 2011 · See Python Argument Binders for standard techniques (not Tkinter-specific) for solving the problem. Working with callbacks in Tkinter (or other GUI frameworks) has some …

  7. How do I pass a method as a parameter in Python [duplicate]

    Methods and functions are objects in Python, just like anything else, and you can pass them around the way you do variables. In fact, you can think about a method (or function) as a …

  8. Passing functions with arguments to another function in Python?

    Is it possible to pass functions with arguments to another function in Python? Say for something like: def perform (function): return function () But the functions to be passed will have argume...

  9. python - How can I pass a variable in a decorator to function's ...

    How can I pass a variable in a decorator to function's argument in a decorated function? Asked 15 years, 11 months ago Modified 8 years, 4 months ago Viewed 58k times

  10. python - How do I define a function with optional arguments?

    Just use the *args parameter, which allows you to pass as many arguments as you want after your a,b,c. You would have to add some logic to map args -> c,d,e,f but its a "way" of …