Python Forum
I need some clarity on the use of the open command
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need some clarity on the use of the open command
#2
The function is only called if the file (Maryland Case Search.csv) does not exist (the if branch; line 4). In that case, it is created at line 2 of the function (which simply creates an empty file); the rest of the function then creates the csv header, opens said file then writes the header, after which the file is auto closed.

I assume that the rest of the code (not shown) goes on to use the returned file handler.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
RE: I need some clarity on the use of the open command - by rob101 - Nov-07-2022, 04:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Clarity on global variables JonWayn 2 1,874 Nov-26-2022, 12:10 PM
Last Post: JonWayn
  Open a dos shell for ssh command martinmistere 6 3,151 Jun-07-2022, 12:24 PM
Last Post: martinmistere
  Dynamic File Name to a shared folder with open command in python sjcsvatt 9 10,431 Jan-07-2022, 04:55 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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