Directory recognition problem
See original GitHub issueHello guys, I’m not sure if it’s a mistake or if I’m doing something wrong. Can anybody help me?
The function below works well on the console. But when I try to print using PyScript and the Live Server extension, I get the following error:
with open(r"C:\Python\readme.txt") as f:
lines = f.readlines()
print(lines)
Console print: ['Text line 1\n', 'Text line 2\n', 'Text line 3']
Error on Browser: JsException(PythonError: Traceback (most recent call last): File “/lib/python3.10/site-packages/_pyodide/_base.py”, line 429, in eval_code .run(globals, locals) File “/lib/python3.10/site-packages/_pyodide/_base.py”, line 300, in run coroutine = eval(self.code, globals, locals) File “”, line 12, in FileNotFoundError: [Errno 44] No such file or directory: ‘C:\Python\readme.txt’ )
Issue Analytics
- State:
- Created a year ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
How to Avoid Who's Who and Vanity Award Scams - AARP
Fraud experts say you can protect yourself against who's who, fake award and directory scams with a few simple, straightforward precautions.
Read more >Automated Directory listing Retrieval System Based on ...
Automated Directory listing Retrieval System. Based on Isolated Word Recognition. BERND ALDEFELD, LAWRENCE R. RABINER, FELLOW, IEEE, AARON E. ROSENBERG,.
Read more >Troubleshooting Voice Recognition - Cisco
Check to make sure that the name is found in the search scope of the user or directory handler, depending on where the...
Read more >No Directory Service? A Cloud Directory May Be The Tool For ...
It's hard to believe, but some organizations manage identities manually. No directory service? No problem. Try JumpCloud Directory-as-a-Service.
Read more >Recognition of Spoken Spelled Names for ... - IEEE Xplore
In a recent paper, Rosenberg and Schmidt demonstrated the ap plicability of a speaker-trained, isolated word speech recognizer to the problem of automatic ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The error you are receiving is that pyscript cannot read your “readme.txt” file. This is a security feature of your web browser (don’t want some javascript reading your personal files do you?).
Please take a look at the image below: The “file system” is from emscripten (think of it as a web assembly “container”) to get your files onto this “container” you need to upload them. One method of achieving this is to create a form on your page and write the raw bytes to a file.
You can read the emscripten file system API documentation here
As you can see in the architecture above, pyscript is built on top of pyodide which includes the emscripten “container”. The file system you are seeing when you run those python commands is the file system of emscripten.
This file system is ephemeral and lives entirely in your web browser.