[python-win32] Interactive Code to Script File

Abhay Anant Jahagirdar jahagird at usc.edu
Wed Sep 17 00:57:48 CEST 2014


Hi,

You are doing it right but, for the URL string use " "(double quotes). you
should be fine
https://docs.python.org/2.0/ref/strings.html

import webbrowser
webbrowser.open_new("https://www.google.org/")


Thanks,
Abhay

On Tue, Sep 16, 2014 at 12:13 PM, DJ Webre <d_webre at yahoo.com.dmarc.invalid>
wrote:

> I am trying to convert a program from interactive to script file.
>
> The program consists of the following 2 lines:
>
> import webbrowser
> webbrowser.open_new('http://www.google')
>
> When I run it interactively, it works but if I run it as a scrip file, it
> produces an error unless I import webbrowser interactively.
>
> What am I doing wrong?
>
> Thanks in advance for any assistance.
>
> D. J.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>


-- 
Thank you,
Abhay Anant Jahagirdar
MS candidate at Dept. of Computer Science
University of Southern California
Email: jahagird at usc.edu
Phone: (323) 578-1548
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140916/e642ad02/attachment-0001.html>


More information about the python-win32 mailing list