Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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; 'output': 0.04; 'subject:Python': 0.05; 'none,': 0.05; 'assign': 0.07; 'expressions': 0.07; 'python': 0.09; 'dict': 0.09; 'cc:addr :python-list': 0.10; 'debugger,': 0.16; 'is",': 0.16; 'received:192.168.11': 0.16; 'repr()': 0.16; 'shell:': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'prints': 0.29; 'code': 0.31; 'print': 0.32; 'like:': 0.33; 'subject:?': 0.35; 'something': 0.35; 'but': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'header :Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'anywhere.': 0.84; 'received:74.208.4.194': 0.84 Date: Wed, 01 Aug 2012 06:07:43 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: levi nie Subject: Re: why the different output in Eclipse and Python Shell? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:iHhHin9Vp31/b6GQozGwiytb1xNWachJBPTgOvFgmHD YI+/DgIVp0nPZr5RL8qmumPiQi6+5yHo4lNJSs7LAkukcaq5T9 rZPlNyx29++w22e3S2OXBg2lx/f2tl9tm73qbnYvQBN/JR4+UM sR6e9P4zj38hP5ATecRDg1N8oMzoFRyXY/VoKBZTNSQTdZs/Rb M21j+yh/T5LPaRM8i4bQOQGuXouRNabd+PfoMdEBu1DPCmtw/y aJi+1DD2BNYmbqrowYYJxdT3VsV1JVb4uMeEaCx0ZkhO/RwWMv I9axBNirMvYyjxnjayIJ+hjqrcJ51vkNZp5pXXwygPjCPUD++r op1J0/COc7cQVicCcAbg= Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343815671 news.xs4all.nl 6928 [2001:888:2000:d::a6]:53592 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26341 On 08/01/2012 12:45 AM, levi nie wrote: > my code in Eclipse: > > dict.fromkeys(['China','America']) > print "dict is",dict > > output: dict is > > my code in Python Shell: > > dict.fromkeys(['China','America']) > > output:{'America': None, 'China': None} > > Output in Python Shell is what i wanna,but why not in Eclipse? > > The Python Shell is an interactive debugger, and prints the repr() of expressions that you don't assign anywhere. I don't know Eclipse, but I suspect what you want to do is something like: print "dict is", repr(dict) -- DaveA