0

i used this code to open a file in my computere using the code playground, but it failed, however it successed in my locaL pytho

f = open('dna.example.fasta') ----------------------------------- f = open('c:\..\desktop\dna.example.fasta') -------------------------------------- f = open(r'c:\..\desktop\dna.example.fasta') ------------------------------------- f = open('c:\\..\\desktop\\dna.example.fasta') ------------------------------------ f = open('c:/../desktop/dna.example.fasta') ----------------------------------= all gave me this error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape or: Traceback (most recent call last): File "..\Playground\", line 1, in <module> \ufefff = open(r'..\Playground\') FileNotFoundError: [Errno 2] No such file or directory:

2nd Dec 2018, 8:58 AM
Ahmad Ali
Ahmad Ali - avatar
3 ответов
+ 5
Sololearn doesn't support some libraries yet.. File opening is not supported in Java(On SL) .. So I may tell it won't be able to work in Python too...😅
2nd Dec 2018, 10:12 AM
$hardul B
$hardul B - avatar
0
the file already existed in the path
2nd Dec 2018, 8:59 AM
Ahmad Ali
Ahmad Ali - avatar
- 1
I think so, what program do you advice me to finish my project on this file? Not the command line program Thank you so much
2nd Dec 2018, 10:14 AM
Ahmad Ali
Ahmad Ali - avatar