Results of executing hyperlink in script

Cameron Laird claird at lairds.us
Wed Jan 28 21:02:22 EST 2009


In article <mailman.8233.1233184499.3487.python-list at python.org>,
MRAB  <google at mrabarnett.plus.com> wrote:
>Muddy Coder wrote:
			.
			.
			.
>You could put quotes around the URL:
>
>os.startfile('"%s"' % URL)
>
>or:
>
>os.system('start "%s"' % URL)
>
>if "&" has a special meaning to the command-line.

In fact, no, happiness does NOT result in these contexts with
another layer of quoting.
  os.startfile(URL)
works fine even if URL embeds special characters, and does not
work at all if URL is itself quoted.

  os.system("start ...")

just gives a variety of unuseful results if URL embeds special
characters.



More information about the Python-list mailing list