Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
output to file or ...
#1
i have noticed that many calls in Python support both an open file object as well as a file descriptor, where the argument type i part of the effect. if it is a file type or an int typ, that controls how it is used? what about doing it in a 3-way choice where a string means it is the name of a file to be opened and written. a more complete description is that it opens the file for append, writes (appends) to that open file, then closes the open file. or it could be made to store the open file in a dictionary keyed by the name of the file, and re-use the open file when the same name is given. that way, 3 different types could be used, a file object, an integer, or a string.

what do others think of this mad scheme?
Tradition is peer pressure from dead people

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


Messages In This Thread
output to file or ... - by Skaperen - May-22-2019, 01:10 AM
RE: output to file or ... - by heiner55 - May-22-2019, 06:54 AM

Forum Jump:

User Panel Messages

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