What does p stand for in "fp" of with open(filename, "w") as fp:
Question:
It might be extremely frivolous, but google searches are not helpful indeed.
In python official docs, it constantly refers file as fp:
with open(filename, "w") as fp:
fp.write()
What’s does “p” stand for?
Answers:
- It’s an entirely arbitrary name, but I think you understand that.
- It’s usually file pointer.
"fp" stands for "file pointer" and it was a pointer to a FILE
structure in C. The name "fp" just sort of stuck.
"fd" was an alternate and usually indicated an unsigned integer, which was the offset of the referenced file in the "file table" (file descriptor).
It might be extremely frivolous, but google searches are not helpful indeed.
In python official docs, it constantly refers file as fp:
with open(filename, "w") as fp:
fp.write()
What’s does “p” stand for?
- It’s an entirely arbitrary name, but I think you understand that.
- It’s usually file pointer.
"fp" stands for "file pointer" and it was a pointer to a FILE
structure in C. The name "fp" just sort of stuck.
"fd" was an alternate and usually indicated an unsigned integer, which was the offset of the referenced file in the "file table" (file descriptor).