Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import
#1
how different is import from just reading some other file's lines of code at that point, besides the namespacing (which nilamo will insist is an essential thing).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
if you really want to know, watch this by author of new import: https://www.youtube.com/watch?v=AqnxyRuenAg
Reply
#3
what i want to understand is if the existence of import is sufficient to not have included a compile/interpret time code inclusion feature. i really don't see much of a difference other than the way import finds the file it will use and the name space encapsulation it will do.

the closed captions on that video routinely block over stuff. and i need the captions to be on.

i remember many programs i wrote in the past that read a user created file. i always had some kind of #include feature to insert other files into the file being processed. many of these pre-dated my use of the C language, so i did not get the idea from there (i don't remember where i got it, but it was on some IBM mainframe thing or from someone's suggestion).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
Is it possible for you to write one thread without whining about how something was done in 'C'?
It's gets old fast.
Reply
#5
i was not whining about C. i was referring to my history of having an include feature in programs i wrote in the past and trying to make it clear that i did not get the idea from C. i cannot remember where i got the idea, but i do remember having implemented an include feature in a few programs i wrote (in 370 assembler in most cases) before i encountered C. one thing i did not do was macros to modify what was read in or anything else. i didn't see any need for that then, or now. C can keep its macros (yes, i have used them, but that was when doing things in C).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#6
OK, I was very fond of C and could write it in my sleep, but when I use python, I think python, not C.
And, I'll admit I was Grumpy.
Reply
#7
i want to get to the point of thinking Python instead of C when i code Python. but it is hard when so many of my "applications" are system level things. i have no doubt they can be done the Python way like high level applications. so, now i need a way to do the pivot_root() syscall in Linux. i also need to write a UDP forwarder with rules about where datagrams may come from to be forwarded.

i do know it is the Python Way to use modules that can help, like twisted for UDP networking. but in quite many cases my scripts need to "just run" with what each Linux distro comes with (hopefully python3). that means i am limited to the modules that come in the python package the distro has. and i know of at least one distro that comes with python2, only, even though python3 is available to install from the official repository.
Tradition is peer pressure from dead people

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


Forum Jump:

User Panel Messages

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