Python Forum
global variables, classes, imports
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global variables, classes, imports
#8
They do if you do them in the global scope. And similarly, if you import somewhere other than the global scope, you import into that scope instead (star imports are disallowed anywhere other than global scope, but this holds any other time).
Reply


Messages In This Thread
global variables, classes, imports - by Skaperen - Feb-17-2017, 07:17 AM
RE: global variables, classes, imports - by wavic - Feb-17-2017, 09:56 AM
RE: global variables, classes, imports - by Larz60+ - Feb-17-2017, 06:11 PM
RE: global variables, classes, imports - by micseydel - Feb-18-2017, 06:11 AM
RE: global variables, classes, imports - by Larz60+ - Feb-18-2017, 01:29 PM
RE: global variables, classes, imports - by buran - Feb-26-2017, 09:49 AM
RE: global variables, classes, imports - by buran - Mar-02-2017, 08:37 AM
RE: global variables, classes, imports - by Mekire - Mar-02-2017, 05:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand global variables 357mag 5 1,142 May-12-2023, 04:16 PM
Last Post: deanhystad
  Organizing several similar classes with overlapping variables 6hearts 7 1,413 May-07-2023, 02:00 PM
Last Post: 6hearts
  Global variables or local accessible caslor 4 1,040 Jan-27-2023, 05:32 PM
Last Post: caslor
  global variables HeinKurz 3 1,161 Jan-17-2023, 06:58 PM
Last Post: HeinKurz
  Clarity on global variables JonWayn 2 959 Nov-26-2022, 12:10 PM
Last Post: JonWayn
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,600 Mar-11-2022, 01:50 PM
Last Post: snippsat
  Imports in my first package cuppajoeman 1 1,965 Jun-28-2021, 09:06 AM
Last Post: snippsat
  script with imports works but pytest gives "ModuleNotFoundError"? Hpao 0 1,575 Jun-27-2021, 08:30 PM
Last Post: Hpao
  Help wanted with python imports petros21 3 2,571 Apr-07-2021, 07:16 PM
Last Post: snippsat
Question How to include Modules not found (conditional imports) in my setup.py when I want to cff 0 3,831 Mar-17-2021, 11:57 AM
Last Post: cff

Forum Jump:

User Panel Messages

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