How to get file address in onedrive environment?

He, Hai Yun 1 Reputation point
2021-04-07T02:00:51.883+00:00

I want to get a file path by python.

My file is in C:\Users\user1\OneDrive\Desktop\Python\test.py

when I using below code , the result is 'C:\Users\user1', cannot get the real path of the file

import os
apath=os.getcwd()
print(apath)

>C:\Users\user1

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
43,611 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nonki Takahashi 661 Reputation points
    2021-04-17T07:29:28.43+00:00

    Hi @He, Hai Yun , this tag small-basic-featured-program is for Small Basic programming language, not python... I recommend you to add the not-supported tag or an appropriate tag. Thanks. By the way, are you using Visual Studio?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.