Python Forum
python import module or namespace from namepsace variable ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python import module or namespace from namepsace variable ?
#1
this is very important to me, i want import a module or package (namespace) from another namespace variable.

example

import mydir # imports namepace

module_foo = get_module_from_name_space("foo", namespace = mydir) # imports foo module from mydir. that means from mydir import foo expression but I must import foo in that way, with this function.

print(module_foo == mydir.foo) # prints True
thanks.

is there a function like get_module_from_name_space ?
Reply


Messages In This Thread
python import module or namespace from namepsace variable ? - by harun2525 - May-23-2017, 12:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  is import cointegration_analysis a recognized module mitcht33 1 425 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  problem in import module from other folder akbarza 5 1,394 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  can not import anaconda pandas module. PySpark pandas module is imported!! aupres 0 715 Aug-06-2023, 01:09 AM
Last Post: aupres
Video doing data treatment on a file import-parsing a variable EmBeck87 15 2,815 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  import module error tantony 5 3,443 Dec-15-2022, 01:55 PM
Last Post: Lauraburmrs
  Import a module one step back of the path prathampatel9 1 1,075 Sep-21-2022, 01:34 PM
Last Post: snippsat
Question How can I import a variable from another script without executing it ThomasFab 12 7,749 May-06-2022, 03:21 PM
Last Post: bowlofred
  Import a module for use in type hint? Milosz 0 1,482 Nov-08-2021, 06:49 PM
Last Post: Milosz
  Can't install nor import delorean module Tek 3 2,798 Oct-27-2021, 03:32 AM
Last Post: Tek
  'namespace' shorthand for function arguments? shadowphile 5 2,586 Aug-11-2021, 09:02 PM
Last Post: shadowphile

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020