我正在尝试使用twidge在python上发推文。我的脚本如下所示
import subprocess subprocess.call(["sudo", "twidge", "update", "Trying tweeting from linux python - twidge."])
我得到了错误
twidge: user error (No config file found at /root/.twidgerc Run twidge setup to configure twidge for use.)
我已经配置了twidge,它可以在bash中运行。
很抱歉,如果我不是很具体,如果您有任何问题,请询问。
发布于 2018-08-11 23:30:09
您现有的.twidgerc文件可能位于不同的位置。
默认情况下,twidge将在当前用户的主目录中查找配置文件(请参阅man twidge)。由于您使用的是sudo,因此它将在根目录的主目录中查找.twidgerc。
您可以使用-c或--config标志指定备用位置:
import subprocess
subprocess.call(["sudo",
"twidge",
"--config=/path/to/.twidgerc",
"update",
"Trying tweeting from linux python - twidge."])https://stackoverflow.com/questions/46167192
复制相似问题