Unable to open file

Hi everyone.

My coworker email me his python file which generated through googlecolab. I upload it to my drive and try to open it via googlecolab but fail.  Can anyone please advisev me how should I open and access the file below? Thanks.

demo3.PNG

Hi @low89shi,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our community organized so users can more easily find information.

As you’ll notice, your topic is now here in the Programming Help and Discussion board. No action is needed on your part; you can continue the conversation as normal here.

Hi @low89shi,

Welcome to the Github Community Forum!

In windows you need to give to a file an extension in order to OS recognize how to open it. Did you try rename the file? Click with the right button of the mouse than choose the rename option and than give a name with a .py on the right, something like this _ filename.py _. Once you do this windows suggest to open with a editor like: notepad, atom or something like this. If you don’t have any editor download and install atom : https://atom.io/

Hope this solve your problem! If not, try to ask here for more help.

-Gabriele-

Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents!

Hi Wabri,

Thank you for your advice. I have done as suggested. However, it doesn’t display the code correctly. What can I do? Is it possible for me to open it through googlecolab (since my labworker written the code in googlecolab-python3)?  Thanks

This is not a pyhton file, your coworker probably saved or exported it as is. I have never work with google colab but that is not a python3 file.

I know that colab have some sort of functionality like “export as python file” that your coworker not used, you can find it as “Download .py” on file in the corner up-left of the menu.

You can try open it with colab but I don’t know if will work. Alternatively you can try to request to your labworker if he/she can try to export as python3 file, or request to have the authorisations to modify him/her file. Also because it is called colab that stand for collab oratory.

Hope this solve the problem

-Gabriele-

Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents!

1 Like

Googlecolab uses Jupyter notebooks.

As @wabri suggests, your coworker needs to save the python file directly as a .py file, or you need to use Jupyter to view/access the notebook. 

2 Likes