Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51521

Re: Bitwise Operations

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 <devyncjohnson@gmail.com>
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 <devyncjohnson@gmail.com>
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 <python-list@python.org>
Subject Re: Bitwise Operations
References <mailman.5275.1375134621.3114.python-list@python.org> <kt6o8t$l55$1@reader1.panix.com>
In-Reply-To <kt6o8t$l55$1@reader1.panix.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5286.1375140856.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


On 07/29/2013 05:53 PM, Grant Edwards wrote:
> On 2013-07-29, Devyn Collier Johnson <devyncjohnson@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bitwise Operations Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-29 17:25 -0400
  Re: Bitwise Operations Grant Edwards <invalid@invalid.invalid> - 2013-07-29 21:53 +0000
    Re: Bitwise Operations Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-29 19:34 -0400
      Re: Bitwise Operations Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-07-30 08:20 +0200
    Re: Bitwise Operations Ethan Furman <ethan@stoneleaf.us> - 2013-07-29 16:41 -0700
    Re: Bitwise Operations Chris Angelico <rosuav@gmail.com> - 2013-07-30 00:44 +0100
    Re: Bitwise Operations Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-29 19:48 -0400
    Re: Bitwise Operations Chris Angelico <rosuav@gmail.com> - 2013-07-30 01:07 +0100
    Re: Bitwise Operations MRAB <python@mrabarnett.plus.com> - 2013-07-30 02:55 +0100
    Re: Bitwise Operations Terry Reedy <tjreedy@udel.edu> - 2013-07-30 01:46 -0400

csiph-web