Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: why the different output in Eclipse and Python Shell?

Reply
Thread Tools

Re: why the different output in Eclipse and Python Shell?

 
 
Dave Angel
Guest
Posts: n/a
 
      08-01-2012
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 <type 'dict'>
>
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: why the different output in Eclipse and Python Shell? Dave Angel Python 0 08-01-2012 06:42 PM
Re: why the different output in Eclipse and Python Shell? Terry Reedy Python 0 08-01-2012 06:39 AM
os.popen output different from native shell output nickname Python 7 08-26-2009 02:18 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM



Advertisments