简体   繁体   English

如何修复 python3 中的“sh: 1: title: not found”错误?

[英]How do I fix "sh: 1: title: not found" error in python3?

I want to make a twitch token generator for a discord bot, but when i run it, I get the error我想为 discord 机器人制作一个 twitch 令牌生成器,但是当我运行它时,我得到了错误

sh: 1: title: not found

I think the part of the code that went wrong is我认为出错的代码部分是

success = 0
fail = 0
created = 0

def count():
    while True:
        os.system(f'title S = {success}/ F = {fail} / C = {created}')
        time.sleep(1)

full source code here完整的源代码在这里

Does anybody have any ideas?有人有什么想法吗? Any help would be appreciated任何帮助,将不胜感激

os.system(f'title S = {success}/ F = {fail} / C = {created}')

Why are you trying to execute a string (which is what os.system() does) that you probably should just be printing out?你为什么要执行一个你可能应该打印出来的字符串(这是os.system()所做的)? Something like:就像是:

    print(f'title S = {success}/ F = {fail} / C = {created}')

Your shell is unlikely to respond well to that.您的 shell 不太可能对此做出良好反应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM