About 372,000 results
Open links in new tab
  1. python - Why do some functions have underscores - Stack Overflow

    May 24, 2024 · In Python, the use of an underscore in a function name indicates that the function is intended for internal use and should not be called directly by users. It is a convention used …

  2. python - How do I call a function from another .py file ... - Stack ...

    First, import function from file.py: from file import function Later, call the function using: function(a, b) Note that file is one of Python's core modules, so I suggest you change the filename of …

  3. python - How can I use a global variable in a function? - Stack …

    Jul 11, 2016 · In Python, the module is the natural place for global data: Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the …

  4. How can I use a DLL file from Python? - Stack Overflow

    Oct 31, 2008 · 237 What is the easiest way to use a DLL file from within Python? Specifically, how can this be done without writing any additional wrapper C++ code to expose the functionality to …

  5. when to use functions in python and when not to? - Stack Overflow

    Aug 12, 2018 · Thanks. As I understand it, the question is when not how to use a function. Sure, the OP has some syntax/logic issues, but I think they are mainly interested in understanding …

  6. In Python, when should I use a function instead of a method?

    The Zen of Python states that there should only be one way to do things- yet frequently I run into the problem of deciding when to use a function versus when to use a method. Let's take a …

  7. python - importing functions from another jupyter notebook

    May 29, 2018 · 5 Something I've done to import functions into a Jupyter notebook has been to write the functions in a separate Python .py file then use the magic command %run in the …

  8. class - Classes vs. Functions - Stack Overflow

    May 22, 2016 · In your example, if you want a Person record that you can modify and calculate values like age from, I would prefer using a Person record (namedtuple in Python) and writing …

  9. python - Why use lambda functions? - Stack Overflow

    A more interesting use would be to dynamically construct a python function to evaluate a mathematical expression that isn't known until run time (user input). Once created, that …

  10. How to import functions from other projects in Python?

    Ideally both projects will be an installable python package, replete with __init__.py and setup.py. They could then be installed with python setup.py install or similar. If that is not possible, don't …