首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
Python 菜鸟请教一个在 Windows 下使用 os.popen 调用 copy 命令复制文件的问题
varkai
·
2022-11-11 15:17:25 +08:00
· 2196 次点击
这是一个创建于 873 天前的主题,其中的信息可能已经有所发展或是发生改变。
使用
os.popen
调用
copy
命令复制文件的时候,不会等到文件复制完成后才返回吗,那我要怎么确定文件拷贝成功了呀?
popen
文件
copy
调用
7 条回复
•
2022-11-12 12:53:39 +08:00
1
ysc3839
2022-11-11 15:18:59 +08:00
为什么要这么复制文件呢?
2
varkai
OP
2022-11-11 15:23:37 +08:00
@
ysc3839
我是复制网络共享上面的文件,那要怎么复制呀,还请大佬指点
3
ysc3839
2022-11-11 15:31:16 +08:00
shutil.copyfile?
如果不行的话可能要用系统 API CopyFileW
4
fuge
2022-11-11 15:33:30 +08:00
win 下有一个 Robocopy 相当于 Linux 下的 rsync 。
5
varkai
OP
2022-11-11 15:38:17 +08:00
@
ysc3839
@
fuge
好的,我研究研究,谢谢两位的指点。
6
varkai
OP
2022-11-11 15:49:09 +08:00
@
fuge
这个工具真是不错,功能强大,都不需要特意去写 Python 脚本了。
7
ruanimal
2022-11-12 12:53:39 +08:00
os.popen 和 os.system 是不一样的
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
991 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 19:46
·
PVG 03:46
·
LAX 12:46
·
JFK 15:46
Developed with
CodeLauncher
♥ Do have faith in what you're doing.