Re: Question about output different with command dis.dis(code)

2015-11-26 Thread Steven D'Aprano
On Thu, 26 Nov 2015 08:02 pm, fl wrote: > Hi, > > I see the following from a previous post: > > > Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat > 4.1.2-52)] on linux2 > Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam import dis code = compile("(1

Re: Question about output different with command dis.dis(code)

2015-11-26 Thread Chris Angelico
On Thu, Nov 26, 2015 at 8:02 PM, fl wrote: > Are there something, my input or Python difference > make the output different? Anything involving the disassembly of Python code depends heavily on internal interpreter details. You just quoted something showing that ancient versions of Python did at

Re: Question about output different with command dis.dis(code)

2015-11-26 Thread Random832
fl writes: > Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat > 4.1.2-52)] on linux2 The context of the post was discussing the behavior of a very old version of python. I'm not sure how you missed this. > When I run the above three line code, I get the following: Further

Question about output different with command dis.dis(code)

2015-11-26 Thread fl
Hi, I see the following from a previous post: Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import dis >>> code = compile("(1, 2, 3)", "", "eval") >>> dis.dis(code) 0 S

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 16:25, Aahz wrote: > In article , > J   wrote: >> >>The tuple thing is a new concept to me... at least the vocabulary is, >>I'll go look that up now and learn info on tuples. It's been ages >>since I did any python programming, and even back then it was fairly >>simple stuf

Re: A stupid newbie question about output...

2009-10-20 Thread Aahz
In article , J wrote: > >The tuple thing is a new concept to me... at least the vocabulary is, >I'll go look that up now and learn info on tuples. It's been ages >since I did any python programming, and even back then it was fairly >simple stuff (this was about 9 years ago)... so I'm relearning b

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 14:53, Ethan Furman wrote: > osVer = "%s Service Pack %d" % (os.Name.split("|")[0], >        os.ServicePackMajorVersion) > > This way, osVer is a string, and not a tuple. Thanks for the help... The tuple thing is a new concept to me... at least the vocabulary is, I'll go

Re: A stupid newbie question about output...

2009-10-20 Thread Ethan Furman
J wrote: Can someone explain why this code results in two different outputs? for os in comp.CIM_OperatingSystem (): print os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion osVer = os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion print osVer the first pri

Re: A stupid newbie question about output...

2009-10-20 Thread nn
On Oct 20, 2:23 pm, J wrote: > Can someone explain why this code results in two different outputs? > > > for os in comp.CIM_OperatingSystem (): > >  print os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion > >  osVer = os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVe

A stupid newbie question about output...

2009-10-20 Thread J
Can someone explain why this code results in two different outputs? > for os in comp.CIM_OperatingSystem (): > print os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion > osVer = os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion > print osVer the first print s

Re: question about output

2005-10-05 Thread utabintarbo
Given that the format is consistent (and the last char is not part of the number you want), you can probably do something like this: x = int('10944800e'[:-1]) Disclaimer: I am a n00b. YMMV ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: question about output

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 07:24:31 -0700, Java and Swing wrote: > i have printed out some numbers and they look like > > 10944800e > 10952560d They don't look like numbers to me. They have letters at the end. What are they? What does the letter mean? > ...if i want to later assign this type of numbe

Re: question about output

2005-10-05 Thread Java and Swing
doh! nevermind, my original output had e and d in it. -- http://mail.python.org/mailman/listinfo/python-list

question about output

2005-10-05 Thread Java and Swing
i have printed out some numbers and they look like 10944800e 10952560d ...if i want to later assign this type of number to variable how can i do it? for example i can't do... >> x = 10944800e ..since it says "invalid token" on the "e". thanks. -- http://mail.python.org/mailman/listinfo/pyth