Python Forum
global namespace of an imported function (2 Qs)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global namespace of an imported function (2 Qs)
#3
(Oct-08-2018, 02:07 AM)ichabod801 Wrote: The namespace is created when it is imported, and I believe only when it is first imported. Any top-level code in the module is executed at that time, and can access anything defined above it in that namespace.
and what all does that include?

i would like to set a variable of a specific name followed by importing a module. i want have that module access that variable (it would know the name) and use that value to do different things like defining different functions.
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
RE: global namespace of an imported function (2 Qs) - by Skaperen - Oct-08-2018, 05:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  which namespace? Skaperen 5 311 May-28-2024, 05:38 AM
Last Post: Gribouillis
  Can a module tell where it is being imported from? stevendaprano 3 1,279 Apr-12-2022, 12:46 AM
Last Post: stevendaprano
  Function global not readable by 'main' fmr300 1 1,440 Jan-16-2022, 01:18 AM
Last Post: deanhystad
  module detecting if imported vs not Skaperen 1 1,751 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  'namespace' shorthand for function arguments? shadowphile 5 2,732 Aug-11-2021, 09:02 PM
Last Post: shadowphile
  [newbie] Why is a module imported twice? Winfried 3 4,190 Apr-02-2021, 04:48 AM
Last Post: deanhystad
  Finding global extrema of oscillating function JoeRogan 0 1,719 Dec-22-2020, 01:49 AM
Last Post: JoeRogan
Star NameError – function doesn't recognize imported modules Sir 4 3,747 Dec-01-2020, 06:36 AM
Last Post: Sir
  How to make global list inside function CHANKC 6 3,267 Nov-26-2020, 08:05 AM
Last Post: CHANKC
  Spyder Quirk? global variable does not increment when function called in console rrace001 1 2,321 Sep-18-2020, 02:50 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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