About 28,800,000 results
Open links in new tab
  1. Basic explanation of python functions - Stack Overflow

    Sep 5, 2015 · The Python language, like many others, already has a set of built-in functionality. The function named print is an example of this. You can get a lot of information using the pydoc …

  2. What is the naming convention in Python for variables and functions ...

    39 As mentioned, PEP 8 says to use lower_case_with_underscores for variables, methods and functions. I prefer using lower_case_with_underscores for variables and mixedCase for methods and …

  3. python - How to run functions in parallel? - Stack Overflow

    I am trying to run multiple functions in parallel in Python. I have something like this: files.py import common #common is a util class that handles all the IO stuff dir1 = 'C:\\folder1' dir2 = 'C:\\

  4. How can I use a global variable in a function? - Stack Overflow

    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 module. …

  5. python - Why do some functions have underscores "__" before and …

    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 to indicate …

  6. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

  7. python - How do I get ("return") a result (output) from a function? How ...

    We can make a tuple right on the return line; or we can use a dictionary, a namedtuple (Python 2.6+), a types.simpleNamespace (Python 3.3+), a dataclass (Python 3.7+), or some other class (perhaps …

  8. python - How can I separate the functions of a class into multiple ...

    A method file is just a regular Python file with functions, except you can't forget 'self' as a first argument. You can have auxiliary methods here, both taking self and not. Methods are imported directly into the …

  9. How do Python functions handle the types of parameters that you pass …

    Apr 7, 2017 · Python doesn't know that you are calling the function with the proper types, and expects the programmer to take care of that. If your function will be called with different types of parameters, …

  10. python - How do I detect whether a variable is a function ... - Stack ...

    Similarity, in Python, those functors are all callable. An ordinary function can be callable, a lambda expression can be callable, a functional.partial can be callable, the instances of class with a …