擅长:python、mysql、java
<p>是的,python可以通过多种方式做到这一点:</p>
<p>1.通过<a href="https://docs.python.org/2/library/webbrowser.html" rel="nofollow noreferrer">webbrowser</a>等模块:</p>
<pre><code>url = 'http://www.python.org/'
# Open URL in a new tab, if a browser window is already open.
webbrowser.open_new_tab(url + 'doc/')
# Open URL in new window, raising the window if possible.
webbrowser.open_new(url)
</code></pre>
<hr/>
<p>2.通过<code>os.system</code>或<code>subprocess.call</code>:</p>
<pre><code>import os
os.system("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -ArgumentList @( '-incognito', 'www.site.com'" )
</code></pre>
<hr/>
<p>3.通过powershell,但这有点过分了</p>
<pre><code>import subprocess
subprocess.call(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", ". \"./SamplePowershell\";", 'Start-Process "chrome.exe" "www.google.com"'])
</code></pre>