Extract lines from file, add to new files

Grant Edwards grant.b.edwards at gmail.com
Mon Jan 29 17:54:07 EST 2024


On 2024-01-29, Rich Shepard via Python-list <python-list at python.org> wrote:
> On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:
>
>> No, I hadn't ... but I am reading it now.
>
> Perhaps I missed the answer to my question when reading the io module. It
> explains how to open/write/read files of text and binary data, not passing
> a variable's value from one file to a place-keeper in another file.

It's not at all clear (to me) what you're asking about.  When you talk
about "files" are you referring to data files? Python modules within a
single program? Seperate Python programs?  Something else?

The phrase "place-keeper in another file" sounds a bit like you're
trying to do templating. There are many, many ways to do templating in
Python -- ranging from literal 'f-strings' to powerful templating
engines that are used to construct entire web sites:

  https://www.google.com/search?q=python+templating

  https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings

  https://en.wikipedia.org/wiki/Jinja_(template_engine)



More information about the Python-list mailing list