About 50 results
Open links in new tab
  1. python "string" module? - Stack Overflow

    Sep 10, 2011 · So I'm reading this old module from I think around 2002 and it has this line "import string". Did Python require you to import a string module explicitly before to be able to use string type …

  2. python - Importing module from string variable using "__import__" …

    I'm writing Python script which I hope will automate document generation from future MPL releases. I selected interested submodules/packages and want to list their main classes from which I'll generate …

  3. python - Relationship between string module and str - Stack Overflow

    Jan 8, 2010 · There is some overlap between the string module and the str type, mainly for historical reasons. In early versions of Python str objects did not have methods, so all string manipulation was …

  4. string - Alphabet range in Python - Stack Overflow

    Jul 17, 2022 · In Python 3, use string.ascii_lowercase. But this returns a string. In case you need a list, I think, Bg1850 is a neat solution

  5. python - How can I import a module dynamically given its name as …

    Python defines an __import__() function, which takes a string for a module name: __import__(name, globals=None, locals=None, fromlist=(), level=0) The function imports the module name, potentially …

  6. python - How can I import a module dynamically given the full path ...

    How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?

  7. python - How Do I get rid of this error:Traceback (most recent call ...

    Aug 21, 2022 · Python doesn't know that the directory containing your modules (including main.py) is a package, therefore it can't properly locate imports. Create an empty __init__.py file in this directory to …

  8. python - Dynamic instantiation from string name of a class in ...

    In python, I have to instantiate certain class, knowing its name in a string, but this class 'lives' in a dynamically imported module. An example follows: loader-class script: import sys class lo...

  9. python - How to load a module from code in a string? - Stack Overflow

    If the code for the module is in a string, you can forgo using StringIO and use it directly with exec, as illustrated below with a file named dynmodule.py. Works in Python 2 & 3.

  10. python - Calling a function of a module by using its name (a string ...

    Aug 6, 2008 · 168 Given a string, with a complete python path to a function, this is how I went about getting the result of said function: