84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
请问下,在put_file函数中的路径file_path参数,是输入绝对路径还是相对路径,如果绝对路径,Windows和linux平台的路径也有所不同。
欢迎选择我的课程,让我们一起见证您的进步~~
Indicates that the level of questioning needs to be improved
Is the put_file you are talking about the function here?
The internal call is os.stat, which can be a relative path or an absolute path.
You don’t need to care about the beginning of the absolute path. There are related functions that can help you operate, such as:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
You can also write your own function judgment, or set environment variables, etc.
Is the put_file you are talking about the function here?
The internal call is os.stat, which can be a relative path or an absolute path.
You don’t need to care about the beginning of the absolute path. There are related functions that can help you operate, such as:
You can also write your own function judgment, or set environment variables, etc.