擅长:python、mysql、java
<p>根据<a href="https://docs.python.org/3/library/sys.html" rel="nofollow noreferrer">Python docs</a></p>
<blockquote>
<p>argv[0] is the script name (it is operating system dependent whether this is a full > pathname or not)</p>
</blockquote>
<p>因此<code>if len(sys.argv) == 1:</code>将始终计算为<code>True</code></p>
<p>更改为<code>if len(sys.argv) == 2:</code>应该会有所帮助</p>