Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't open local files #7

Open
alvinmrrry opened this issue Mar 12, 2023 · 5 comments
Open

can't open local files #7

alvinmrrry opened this issue Mar 12, 2023 · 5 comments

Comments

@alvinmrrry
Copy link

hi, I think this plugin is awesome. now I met one problem is I don't know how to open / save the files in local directory? my computer is Mac system. Thanks.

@mokeyish
Copy link
Owner

I don't understand what's your meaning. save file ?

@uxtechie
Copy link

uxtechie commented Apr 6, 2023

Hi!

I think this issue is related to this Pyodide FAQ entry.

Please try this Python example:

import micropip

await micropip.install('pandas')

import pandas as pd
from pyodide.http import open_url

csv_url = 'https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv'

response = open_url(csv_url)

df = pd.read_csv(response)

print(df.head())

@mokeyish
Copy link
Owner

Sorry, I missed your reply.

It seems no probelm.

图片

@Luppyn
Copy link

Luppyn commented Mar 19, 2024

Eu não entendo qual é o seu significado. salvar Arquivo ?

In my case, I would like to use the open function to manipulate files within Obsidian itself, but apparently the code is being executed in an Emscripten environment, which made me question if it would be possible to create that level of abstraction, enhancing Obsidian manipulation. I also tried searching through folders, but the execution file is located in the Pyodide folder, which is just a distribution of Python to work in a browser. I really wonder if such a thing is possible.

@Krisloveless
Copy link
Contributor

you can take a look at my implementation - https://github.com/Krisloveless/obsidian-code-emitter?tab=readme-ov-file#using-python-local-file, currently supports reading from local(doable to sync back, but I have not implement yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants