Firestarter
Firestarter

Reputation: 96

How to run Python script on Google Cloud storage?

I am trying to run a Python script on files in Google Cloud Storage (without using the google-cloud-storage package). I have Jupyter running on a VM instance. How can I access my files from Jupyter? this is an example of the code I'm trying to run:

    fileName = 'OUTCAR'

    with open(fileName) as file:
        for line in file:
            if 'free  energy   TOTEN' in line:
                print(line)

Upvotes: 0

Views: 1831

Answers (1)

Alessandro
Alessandro

Reputation: 655

After the last comment, I might know what you can do. At the end, it comes to what you want to try to do. To "see" a bucket as a local volume, you could use gcsfue to mount GCS as volume on your VM. At that point you will see files as local. However they are not really local file gcsfue manages downlaod, upload, and update for you.

Upvotes: 2

Related Questions