FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/examples/copy_to.py at patch-1 · dawncold/python-sdk · GitHub
dawncold
/
python-sdk
Public
forked from
qiniu/python-sdk
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
examples
/
copy_to.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
25 lines (18 loc) · 552 Bytes
Breadcrumbs
python-sdk
/
examples
/
copy_to.py
Copy path
File metadata and controls
executable file
·
25 lines (18 loc) · 552 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
# flake8: noqa
from
qiniu
import
Auth
from
qiniu
import
BucketManager
access_key
=
'...'
secret_key
=
'...'
# 初始化Auth状态
q
=
Auth
(
access_key
,
secret_key
)
# 初始化BucketManager
bucket
=
BucketManager
(
q
)
# 你要测试的空间, 并且这个key在你空间中存在
bucket_name
=
'Bucket_Name'
key
=
'python-logo.png'
# 将文件从文件key 复制到文件key2。 可以在不同bucket复制
key2
=
'python-logo2.png'
ret
,
info
=
bucket
.
copy
(
bucket_name
,
key
,
bucket_name
,
key2
)
print
(
info
)
assert
ret
==
{}
Back
|
FazBrowse Home
|
New Git URL