Home >Backend Development >Python Tutorial >sys.argv是什么?
<code class="language-python"><span class="c">#!/usr/bin/python</span>
<span class="c"># Filename: using_sys.py</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="k">print</span> <span class="s">'The command line arguments are:'</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">:</span>
<span class="k">print</span> <span class="n">i</span>
<span class="k">print</span> <span class="s">'</span><span class="se">\n\n</span><span class="s">The PYTHONPATH is'</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="p">,</span> <span class="s">'</span><span class="se">\n</span><span class="s">'</span>
</code>
用IDLE怎么运行带参的*.py文件
python新人来回答一发,下面进入正题: