Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'binary': 0.07; 'collier': 0.09; "'or',": 0.16; 'bitwise': 0.16; 'command.': 0.16; 'integer.': 0.16; 'operations?': 0.16; 'wrote:': 0.18; 'typing': 0.19; 'header:User-Agent:1': 0.23; 'errors.': 0.24; 'instance,': 0.24; 'script': 0.25; 'task': 0.26; 'header:In-Reply-To:1': 0.27; 'google,': 0.29; 'gives': 0.31; 'received:10.0.0': 0.31; 'url:python': 0.33; 'something': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'received:10.0': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'saw': 0.77; 'url:search': 0.81; 'edwards': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=DokU5yCd3Z/fDRFHsLQE8O5KkUWJzbdkSMDqsi5fVYQ=; b=Cji+6rT3Y8zW8F7HbSKA4s4vy1eAqUyde4n9aMUGjr3tnAtX3w3Ln1Inl155dXG5Kx bJycDpnbZsAzvWD7Qa0YS3nKJq9qZU83W6nRABtCUjKGUcAQxUPWoYOZtcHcyIynHmB0 QCsKYOfF5vYdpIfosHkJ4OQDJwjOnkOZZYiMbAu0dWve/SiAWXeyinYWPNVild3PKAfm u+UeyY9Wg8ZAaK4iJjWF6oGcFGmqRYl7ZxIJmaNHPEqOnhxFoJJY7CrYrHKBEMVpQHa/ hM/K7dozcd49bMQOm06uJLZKAnBgxaJKqdoDN+wkjnxfCsKOYMV7fj78eClb3ZNQKXyK Fg2g== X-Received: by 10.236.175.42 with SMTP id y30mr28254352yhl.2.1375140853427; Mon, 29 Jul 2013 16:34:13 -0700 (PDT) Date: Mon, 29 Jul 2013 19:34:00 -0400 From: Devyn Collier Johnson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Python Mailing List Subject: Re: Bitwise Operations References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375140856 news.xs4all.nl 15935 [2001:888:2000:d::a6]:37608 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51521 On 07/29/2013 05:53 PM, Grant Edwards wrote: > On 2013-07-29, Devyn Collier Johnson wrote: > >> On Python3, how can I perform bitwise operations? For instance, I want >> something that will 'and', 'or', and 'xor' a binary integer. > http://www.google.com/search?q=python+bitwise+operations > I understand the symbols. I want to know how to perform the task in a script or terminal. I have searched Google, but I never saw a command. Typing "101 & 010" or "x = (int(101, 2) & int(010, 2))" only gives errors. Mahalo, DCJ