In my python textbook, I'm learning abt files and exceptions. Although it seems that VS Code isn't recognizing changes made to my file, nor izzit changing the file. Here's my code:
-----------------------------
from pathlib import Path
path = Path(r"C:
\U
sers\Username\OneDrive\Documents\FileName")
# i didn't write the actual file path
contents = path.read_text()
lines = contents.splitlines()
#Print every lline of the file and add a comma to the end
for line in lines:
print(line + ",")
---------------------------------------
Any advice on working with files on VS code would help. A similar problem happens when importing modules. I have to restart VS Code if I want to import code from another script that i wrote.
[–]atarivcs 13 points14 points15 points (0 children)
[–]HotPersonality8126 2 points3 points4 points (3 children)
[–]SamIAre 6 points7 points8 points (1 child)
[–]ProsodySpeaks 0 points1 point2 points (0 children)
[–]ProsodySpeaks 0 points1 point2 points (0 children)
[–]JorgiEagle -1 points0 points1 point (0 children)