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

Discussion in 'Python' started by Dave Angel, Aug 1, 2012.

  1. Dave Angel

    Dave Angel Guest

    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
    Dave Angel, Aug 1, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    863
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,766
    Smokey Grindel
    Dec 2, 2006
  3. nickname
    Replies:
    7
    Views:
    1,065
    Nobody
    Aug 26, 2009
  4. Terry Reedy
    Replies:
    0
    Views:
    141
    Terry Reedy
    Aug 1, 2012
  5. Dave Angel
    Replies:
    0
    Views:
    173
    Dave Angel
    Aug 1, 2012
Loading...

Share This Page