On 11/02/13 01:14, Steven D'Aprano wrote:
exit() and quit() (as added by the site.py module) are for interactive use.
aha!
They're mostly there for the benefit of newbies. Experienced developers (at
least in the Unix/Linux world) usually know to exit interactive terminal
apps with Ctrl-D. I
On 10/02/13 20:25, ALAN GAULD wrote:
Maybe the OP meant to say 'quit()' ? That does not require an import.
Ooh! another option I didn't know about!
So many ways to get rid of Python and here's me been importing sys
or raising SystemExit all these years... :-)
exit() and quit() (as added
On Sun, Feb 10, 2013 at 3:39 AM, ALAN GAULD wrote:
> So it does. You learn something new every day...
> When did that first happen? It was one of my biggest frustrations
> with Python when I first started learning, that you couldn't call exit
> without first importing sys (v1.3). But I never notic
ALAN GAULD wrote:
>> Maybe the OP meant to say 'quit()' ? That does not require an import.
>
>
> Ooh! another option I didn't know about!
> So many ways to get rid of Python and here's me been importing sys
> or raising SystemExit all these years... :-)
I tend to use none of these and my script
> Maybe the OP meant to say 'quit()' ? That does not require an import.
Ooh! another option I didn't know about!
So many ways to get rid of Python and here's me been importing sys
or raising SystemExit all these years... :-)
Alan G.
___
Tutor mailli
> On Sat, Feb 9, 2013 at 8:33 PM, Alan Gauld
> wrote:
>>
>> Where does exit() come from? Usually its from sys but you
>> don't import from sys anywhere...
>
> site.py adds the exit/quit Quitter instances to builtins (2.x
> __builtin__). When called they raise SystemExit, like sys.exit does
>site.py adds the exit/quit Quitter instances to builtins (2.x
>__builtin__). When called they raise SystemExit, like sys.exit does.
So it does. You learn something new every day...
When did that first happen? It was one of my biggest frustrations
with Python when I first started learning, that
oh wow, I foolishly named it webbrowser.py earlier.
Thanks for the witty hint, Danny :)
On Sat, Feb 9, 2013 at 11:55 PM, Danny Yoo wrote:
> On Sat, Feb 9, 2013 at 6:25 PM, mann kann wrote:
> > I used webbrowser and it worked via terminal, but the same code returns
> > AttrituteError: 'module'
On Sat, Feb 9, 2013 at 6:25 PM, mann kann wrote:
> I used webbrowser and it worked via terminal, but the same code returns
> AttrituteError: 'module' object has no attribute 'open' in komodo edit.
> suggestions? here's the code:
>
> import webbrowser
> webbrowser.open("http://youtube.com";)
What
On Sat, Feb 9, 2013 at 8:33 PM, Alan Gauld wrote:
>
> Where does exit() come from? Usually its from sys but you
> don't import from sys anywhere...
site.py adds the exit/quit Quitter instances to builtins (2.x
__builtin__). When called they raise SystemExit, like sys.exit does.
Since you can bypa
On 10/02/13 01:00, mann kann wrote:
Dear Jedi,
I wrote my first program but it doesn't open a website as I intended it
to. Please correct my mistake.
Well, how did you intend it to?
It looks like it probably does open the web site, but it will be hard to
tell since you do nothing with the res
I used webbrowser and it worked via terminal, but the same code returns
AttrituteError: 'module' object has no attribute 'open' in komodo edit.
suggestions? here's the code:
import webbrowser
webbrowser.open("http://youtube.com";)
On Sat, Feb 9, 2013 at 8:17 PM, Wayne Werner wrote:
> On Sat,
On Sat, 9 Feb 2013, mann kann wrote:
Dear Jedi,
I wrote my first program but it doesn't open a website as I intended it to.
Please correct my mistake.
Sincerely,
Mann
You'll actually want the webbrowser module, which will open the links in
your web browser - at least if you want to load s
Dear Jedi,
I wrote my first program but it doesn't open a website as I intended it to.
Please correct my mistake.
Sincerely,
Mann
def a():
import urllib.request
url = "http://www.google.com";
response = urllib.request.urlopen(url)
g = input("Please enter y or n to go to youtube :
14 matches
Mail list logo