X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'win32': 0.03; 'defaults': 0.07; 'installed.': 0.07; '[0,': 0.09; 'exit': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '2.7': 0.14; 'windows': 0.15; '(),': 0.16; 'exit()': 0.16; 'inc.)': 0.16; 'message-id:@4ax.com': 0.16; 'nameerror:': 0.16; 'range(0,': 0.16; 'really?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'bit': 0.19; 'trying': 0.19; 'command': 0.22; '>>>': 0.22; 'shell': 0.22; 'print': 0.22; 'url:home': 0.24; 'script': 0.25; 'defined': 0.27; 'required.': 0.27; 'header:X-Complaints-To:1': 0.27; 'tried': 0.27; 'function': 0.29; "doesn't": 0.30; '"",': 0.31; 'invoke': 0.31; 'layer': 0.31; 'sep': 0.31; 'us!': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'quite': 0.32; 'open': 0.33; '(most': 0.33; 'fri,': 0.33; 'but': 0.35; 'idle': 0.36; 'skip:> 10': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'ensure': 0.60; 'subject: ': 0.61; 'show': 0.63; 'name': 0.63; 'more': 0.64; 'default': 0.69; '(still': 0.84; 'difference.': 0.84; 'pain': 0.84; '2013,': 0.91; 'subject:Lists': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: I am out of trial and error again Lists Date: Sat, 25 Oct 2014 14:23:44 -0400 Organization: IISS Elusive Unicorn References: <2412654f-ac5e-4678-8956-afc4e27affb3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-218-175.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 106 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414261434 news.xs4all.nl 2947 [2001:888:2000:d::a6]:36255 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79677 On Fri, 24 Oct 2014 10:38:31 -0400, Seymore4Head declaimed the following: > >I do get the difference. I don't actually use Python 2. I use >CodeSkulptor. I do have Python 3 installed. Actually I have Python 2 >installed but IDLE defaults to Python 3. So it is a pain to actually >load Python 2. > So don't use Idle... Open up a Windows command shell and invoke Python without giving a script file to execute. C:\Users\Wulfraed\Documents>python ActivePython 2.7.5.6 (ActiveState Software Inc.) based on Python 2.7.5 (default, Sep 16 2013, 23:11:01) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> exit() C:\Users\Wulfraed\Documents>python3 ActivePython 3.3.2.0 (ActiveState Software Inc.) based on Python 3.3.2 (default, Sep 16 2013, 23:11:39) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> exit() C:\Users\Wulfraed\Documents> Note that my default Python is still 2.7, but I also have Python 3.3 installed, and can access it using "python3" (I can also ensure Python 2.7 by using "python2") > >I tried list(range(10) I thought that would work in Python 3. It >didn't. I spent quite a bit of time last night trying to come up with Really? what did it do? SHOW US! C:\Users\Wulfraed\Documents>python3 ActivePython 3.3.2.0 (ActiveState Software Inc.) based on Python 3.3.2 (default, Sep 16 2013, 23:11:39) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> print(list(range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> repr(list(range(10))) '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]' >>> Recall that "print" is a function in Python 3, so the extra layer of () are required. C:\Users\Wulfraed\Documents>python ActivePython 2.7.5.6 (ActiveState Software Inc.) based on Python 2.7.5 (default, Sep 16 2013, 23:11:01) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> print list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> print(list(range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> repr(list(range(10))) '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]' >>> "Print" doesn't need the (), but they also don't hurt it in Python 2. (still in Py2) >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> xrange(10) xrange(10) >>> print range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> print xrange(10) xrange(10) >>> exit Use exit() or Ctrl-Z plus Return to exit >>> exit() Now Py3 C:\Users\Wulfraed\Documents>python3 ActivePython 3.3.2.0 (ActiveState Software Inc.) based on Python 3.3.2 (default, Sep 16 2013, 23:11:39) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> range(10) range(0, 10) >>> xrange(10) Traceback (most recent call last): File "", line 1, in NameError: name 'xrange' is not defined >>> print(range(10)) range(0, 10) >>> -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/