【发布时间】:2018-10-21 20:53:39
【问题描述】:
我想用 Python 导出这段代码:
#!/usr/bin/env bash
export LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"
echo Starting carddav sync at $(date)
mkdir -p carddav
cat vdirsyncer.config.template | sed
"s/VDIRSYNC_USER/$VDIRSYNC_USER/; s/VDIRSYNC_PASS/$VDIRSYNC_PASS/" >
vdirsyncer.config
yes | vdirsyncer -c vdirsyncer.config discover
vdirsyncer -c vdirsyncer.config sync
rm vdirsyncer.config
echo Carddav sync done, starting carddavsync
我尝试利用 bash2py,但没有成功。
【问题讨论】:
-
您想在 Python 中创建等效代码吗?您想从 Python 运行脚本吗?你想...?
-
不幸的是 SO 不是代码翻译服务。
-
请阅读此内容。 Why is "Help me" is not a question? 。我们派人来阅读这篇文章,因为 Stack Overflow 用于提出具体问题。
标签: python python-3.x bash