Skip to content

Python code snippet – How to open a file in a different directory in mac?

import os
f = open (os.path.expanduser("~/Desktop/somedir/somefile.txt"))
See also  PHP code snippet - How to create controller in specific folder laravel?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.