Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import vs inserting code
#2
Perhaps I misunderstand the question / idea - or my knowledge of the language fails me, but let's try this:

alpha.py
x=5
from beta import *
print(x)
beta.py
x=7
del x
you see, it is not the same as copy-pasting beta.py contents instead of insert. the variable is as if shadowed rather than overrwritten. disclaimer: I don't understand the mechanics, just was amused by the question and tried few statements in two files
Gribouillis likes this post
Reply


Messages In This Thread
import vs inserting code - by Skaperen - Jun-14-2024, 01:18 AM
RE: import vs inserting code - by rodiongork - Jun-19-2024, 07:55 PM
RE: import vs inserting code - by Gribouillis - Jun-19-2024, 09:42 PM
RE: import vs inserting code - by Skaperen - Jun-20-2024, 10:38 PM
RE: import vs inserting code - by rodiongork - Jun-21-2024, 05:47 AM
RE: import vs inserting code - by Skaperen - Jun-22-2024, 01:21 AM
RE: import vs inserting code - by Gribouillis - Jun-22-2024, 08:14 AM
RE: import vs inserting code - by Skaperen - Jun-23-2024, 01:54 AM
RE: import vs inserting code - by Gribouillis - Jun-23-2024, 06:52 AM
RE: import vs inserting code - by AdamHensley - Jun-23-2024, 12:02 PM
RE: import vs inserting code - by Skaperen - Jun-26-2024, 09:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  visual studio code python how to get source code of import module definitian umen 2 4,200 Jun-13-2020, 06:20 PM
Last Post: umen

Forum Jump:

User Panel Messages

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