Python Forum
importing a module given a path to the file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing a module given a path to the file
#1
i want to have my script take a path to a file that it gets (may be typed in, or read from some other file, or given as a command argument) and import it as a module without any copying and/or renaming of files. i vaguely remember that i saw, a few years ago, a function that maybe could do this, but i cannot recall what it is or where i saw it, now that i need it. any ideas?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
importing a module given a path to the file - by Skaperen - Oct-28-2023, 01:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  max component length of file path name Skaperen 1 1,131 Jun-19-2022, 04:03 AM
Last Post: Larz60+
  file system path representation Skaperen 7 3,756 Mar-03-2021, 02:12 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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