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
Use Cross-platform Functions Instead of Linux Only Shell Commands #73
Comments
I agree with this comment, but what is the cross-platform version of this? (from the lesson4-IMDB notebook) |
May I answer a question with a question??? How would you perform this operation if shell commands weren't implemented in jupyter? |
I don't know how - which is why I asked the original question :) - I guess I would have to write some Python code to do it... |
Right. So far I'm able to code one-to-one replacements of non-portable shell commands with os functions. The example you gave requires some python code to replace the non-portable shell command. The downside of using shell commands is lack of portability which is problematic for a MOOC audience. |
I'd be happy to accept a PR that replaced shell commands with python x-platform equivalents :) |
add docments to 33_text.models.core notebook
There's a few places in Lesson 1 that uses Linux-only shell commands. This is an issue for Windows users. Why not use platform independent code? For example:
Linux only: !ls {PATH}
Cross-platform: os.listdir(PATH)
Linux only: !ls {PATH}valid
Cross-platform: os.listdir(PATH + 'valid')
Linux only: files = !ls {PATH}valid/cats | head
Cross-platform: files = os.listdir(PATH + 'valid/cats')
Linux only: !rm -rf {PATH}tmp
Cross-platform: os.removedirs(PATH + 'tmp')
The text was updated successfully, but these errors were encountered: