Python Forum
passing a value to imported code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing a value to imported code
#1
i would like to pass a value to imported code in order for it to make a decision at import time (such as which way to define a function). the first way i tried was to set the value as a global variable before doing the import and accessing that variable inside the module very early. could this be because i am using from modulename import functionname to do the import?
Tradition is peer pressure from dead people

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Visual Studio Code Intellisense for Imported Modules Not Working hockinsk 1 2,730 Apr-23-2022, 04:41 PM
Last Post: deanhystad
  Can a module tell where it is being imported from? stevendaprano 3 1,188 Apr-12-2022, 12:46 AM
Last Post: stevendaprano
  module detecting if imported vs not Skaperen 1 1,680 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  [newbie] Why is a module imported twice? Winfried 3 4,090 Apr-02-2021, 04:48 AM
Last Post: deanhystad
  how to do setattr() from an imported module nutron 3 3,361 Sep-20-2019, 08:16 PM
Last Post: nutron
  argparse and imported modules spatialdawn 2 5,465 Dec-01-2018, 12:35 PM
Last Post: spatialdawn
  function NOT imported from a module Skaperen 10 6,064 Aug-31-2018, 07:30 AM
Last Post: Gribouillis
  decorate an imported function? Skaperen 3 9,951 May-22-2017, 08:05 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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