Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'that?': 0.05; 'subject:Python': 0.06; 'runs': 0.10; 'python': 0.11; 'def': 0.12; '2.7': 0.14; "'''": 0.16; 'to:name:python-list@python.org': 0.22; 'received:65.55.116': 0.24; 'header:In-Reply-To:1': 0.27; 'way?': 0.31; 'run': 0.32; 'there': 0.35; 'thank': 0.38; 'to:addr:python- list': 0.38; '\xa0\xa0\xa0': 0.39; 'to:addr:python.org': 0.39; 'skip:n 10': 0.64; 'subject: #': 0.96 X-TMN: [WBifM9tYuK3QBGp+mQTOYYcQfy6Q+s2A] X-Originating-Email: [carlosnepomuceno@outlook.com] From: Carlos Nepomuceno To: "python-list@python.org" Subject: RE: Python #ifdef Date: Tue, 28 May 2013 23:07:39 +0300 Importance: Normal In-Reply-To: References: , , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 28 May 2013 20:07:39.0517 (UTC) FILETIME=[01221AD0:01CE5BDF] 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369771667 news.xs4all.nl 15866 [2001:888:2000:d::a6]:60021 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46333 Thank you! I made it run like the following. What do you think about that? = IS there a better way?=0A= =0A= =0A= =0A= #The following runs on Python 2.7=0A= sc3=3D'''=0A= # Python 3=0A= def original(n):=0A= =A0=A0=A0 m =3D 0=0A= =A0=A0=A0 for b in n.to_bytes(6=2C 'big'):=0A= =A0=A0=A0=A0=A0=A0=A0 m =3D 256*m + b=0A= =A0=A0=A0 return m=0A= '''=0A= if sys.version_info[0] =3D=3D 3:=0A= =A0=A0=A0 exec(sc3) =