About 25,400,000 results
Open links in new tab
  1. python - Why do some functions have underscores "__" before and …

    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 that the function is …

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

    function(a, b) Note that file is one of Python's core modules, so I suggest you change the filename of file.py to something else. Note that if you're trying to import functions from a.py to a file called b.py, …

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

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

    @J.F. Sebastian, yes, "operator.itemgetter" ,and hundreds of other short functions one would have to know by heart, each to one specific use -- or use lambda, where one can create a generic …

  5. python - How to list all functions in a module? - Stack Overflow

    I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I …

  6. python - Executing multiple functions simultaneously - Stack Overflow

    I'm trying to run two functions simultaneously in Python. I have tried the below code which uses multiprocessing but when I execute the code, the second function starts only after the first is done.

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

  8. python - How do I forward-declare a function to avoid `NameError`s for ...

    In python the statement globals()[function_name]() is the same as foo() if function_name = 'foo' for the reasons discussed above, since python must lookup each function before calling it. If one were to …

  9. 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:\\

  10. Defining private module functions in python - Stack Overflow

    41 Python allows for private class members with the double underscore prefix. This technique doesn't work at a module level so I am thinking this is a mistake in Dive Into Python. Here is an example of …