How to compile the programm corectly? [on hold]
-2
f = open("C:\fileObject.txt", "w")
f.write("I love to code")
f.close()
Traceback (most recent call last):
File "c:Users�������DesktopBakhtiyarPythonpracticefileObjects.py", line 1, in <module>
f = open("C:\fileObject.txt", "w")
PermissionError: [Errno 13] Permission denied: 'C:\fileObject.txt'
python file
New contributor
put on hold as off-topic by usr2564301, pault, trincot, SiKing, Dalija Prasnikar 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – pault, trincot, SiKing, Dalija Prasnikar
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
-2
f = open("C:\fileObject.txt", "w")
f.write("I love to code")
f.close()
Traceback (most recent call last):
File "c:Users�������DesktopBakhtiyarPythonpracticefileObjects.py", line 1, in <module>
f = open("C:\fileObject.txt", "w")
PermissionError: [Errno 13] Permission denied: 'C:\fileObject.txt'
python file
New contributor
put on hold as off-topic by usr2564301, pault, trincot, SiKing, Dalija Prasnikar 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – pault, trincot, SiKing, Dalija Prasnikar
If this question can be reworded to fit the rules in the help center, please edit the question.
3
The JVM can't open the fileC:fileObject.txt
for writing due to permissions (windows refuse to let you write toC:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.
– Aaron
Dec 27 at 13:14
2
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
1
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27
add a comment |
-2
-2
-2
f = open("C:\fileObject.txt", "w")
f.write("I love to code")
f.close()
Traceback (most recent call last):
File "c:Users�������DesktopBakhtiyarPythonpracticefileObjects.py", line 1, in <module>
f = open("C:\fileObject.txt", "w")
PermissionError: [Errno 13] Permission denied: 'C:\fileObject.txt'
python file
New contributor
f = open("C:\fileObject.txt", "w")
f.write("I love to code")
f.close()
Traceback (most recent call last):
File "c:Users�������DesktopBakhtiyarPythonpracticefileObjects.py", line 1, in <module>
f = open("C:\fileObject.txt", "w")
PermissionError: [Errno 13] Permission denied: 'C:\fileObject.txt'
python file
python file
New contributor
New contributor
edited Dec 27 at 13:43
Gama11
10.8k21946
10.8k21946
New contributor
asked Dec 27 at 13:12
Бахтияр Баглан
1
1
New contributor
New contributor
put on hold as off-topic by usr2564301, pault, trincot, SiKing, Dalija Prasnikar 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – pault, trincot, SiKing, Dalija Prasnikar
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by usr2564301, pault, trincot, SiKing, Dalija Prasnikar 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – pault, trincot, SiKing, Dalija Prasnikar
If this question can be reworded to fit the rules in the help center, please edit the question.
3
The JVM can't open the fileC:fileObject.txt
for writing due to permissions (windows refuse to let you write toC:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.
– Aaron
Dec 27 at 13:14
2
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
1
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27
add a comment |
3
The JVM can't open the fileC:fileObject.txt
for writing due to permissions (windows refuse to let you write toC:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.
– Aaron
Dec 27 at 13:14
2
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
1
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27
3
3
The JVM can't open the file
C:fileObject.txt
for writing due to permissions (windows refuse to let you write to C:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.– Aaron
Dec 27 at 13:14
The JVM can't open the file
C:fileObject.txt
for writing due to permissions (windows refuse to let you write to C:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.– Aaron
Dec 27 at 13:14
2
2
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
1
1
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
3
The JVM can't open the file
C:fileObject.txt
for writing due to permissions (windows refuse to let you write toC:
without elevated priviledges). Either change the file path to something like your user's home (preferred) or launch your jvm with elevated priviledges. BTW your code successfully compiled from what I can tell, the error happens at runtime when you execute it.– Aaron
Dec 27 at 13:14
2
You don't have write permission to `C:`. This is not a python problem. Your operating system doesn't allow this.
– Daniel
Dec 27 at 13:23
1
@Aaron: Python, not Java.
– Daniel
Dec 27 at 13:24
@Daniel Woops, right ^^'
– Aaron
Dec 27 at 13:27