Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #16039
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python@mrabarnett.plus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'ok.': 0.04; 'subject:Python': 0.05; 'python': 0.08; 'from:addr:python': 0.09; 'method:': 0.09; 'word)': 0.09; 'python?': 0.15; '(sorry': 0.16; 'clear.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply-to:addr:python-list': 0.16; 'wrote:': 0.18; 'perl': 0.18; 'convert': 0.19; 'header:In-Reply- To:1': 0.22; 'table.': 0.23; 'string': 0.24; 'translation': 0.25; 'import': 0.27; 'bit': 0.28; 'print': 0.29; 'example': 0.29; 'header:User-Agent:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'received:84': 0.34; 'reply-to:addr:python.org': 0.34; 'subject:/': 0.35; 'device': 0.36; 'subject:with': 0.36; 'skip:" 10': 0.37; 'but': 0.37; 'think': 0.37; 'could': 0.37; 'doing': 0.38; 'subject: (': 0.40; 'to:addr:python.org': 0.40; 'quick': 0.61; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'naughty': 0.84; 'subject:Serial': 0.91 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.0 cv=TvRkdUrh c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=9jsOeB20M3cA:10 a=Wj3GC6AdMgQA:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=5W085DuPLWPVZbKwyVIA:9 a=t10tH1v5dJDmjPaxSXsA:7 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 |
| X-AUTH | mrabarnett:2500 |
| Date | Mon, 21 Nov 2011 18:20:01 +0000 |
| From | MRAB <python@mrabarnett.plus.com> |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. |
| References | <27511132.925.1321884055247.JavaMail.geo-discussion-forums@yqnf38> <mailman.2900.1321885611.27778.python-list@python.org> <2723247.1219.1321892899941.JavaMail.geo-discussion-forums@yqzz20> <mailman.2912.1321894079.27778.python-list@python.org> <22753805.1034.1321894337412.JavaMail.geo-discussion-forums@yqdr22> |
| In-Reply-To | <22753805.1034.1321894337412.JavaMail.geo-discussion-forums@yqdr22> |
| 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.12 |
| Precedence | list |
| Reply-To | python-list@python.org |
| 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.2924.1321899609.27778.python-list@python.org> (permalink) |
| Lines | 24 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1321899609 news.xs4all.nl 6972 [2001:888:2000:d::a6]:56141 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:16039 |
Show key headers only | View raw
On 21/11/2011 16:52, Matthew Lenz wrote: > Ahh. Ok. So how would I go about doing that with python? I think in > perl (sorry for the naughty word) I could use the tr// (translate) > but is there a quick way to do so with python? Is it going to be > necessary to convert commands I SEND to the device or only convert > what I receive? Python strings have a .translate method: # Example in Python 2 import string # From top bit set... from_chars = "".join(chr(c | 0x80) for c in range(0x7F)) # ...to top bit clear. to_chars = "".join(chr(c) for c in range(0x7F)) # Build the translation table. force_clear = string.maketrans(from_chars, to_chars) s = "\x41\xC1" print s print s.translate(force_clear)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Non-POSIX parity (mark/space) with Python-Serial on Linux. mlenz@nocturnal.org - 2011-11-21 06:00 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 06:16 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Nizamov Shawkat <nizamov.shawkat@gmail.com> - 2011-11-21 15:26 +0100
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 08:28 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Chris Angelico <rosuav@gmail.com> - 2011-11-22 03:41 +1100
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. David Riley <fraveydank@gmail.com> - 2011-11-21 11:47 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 08:52 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 08:52 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. David Riley <fraveydank@gmail.com> - 2011-11-21 12:22 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 09:59 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 09:59 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. David Riley <fraveydank@gmail.com> - 2011-11-21 13:12 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. MRAB <python@mrabarnett.plus.com> - 2011-11-21 18:20 +0000
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. gene heskett <gheskett@wdtv.com> - 2011-11-21 12:25 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. David Riley <fraveydank@gmail.com> - 2011-11-21 12:50 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 08:28 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. gene heskett <gheskett@wdtv.com> - 2011-11-21 13:33 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 11:29 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Grant Edwards <invalid@invalid.invalid> - 2011-11-21 19:42 +0000
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Matthew Lenz <matthew@nocturnal.org> - 2011-11-21 11:29 -0800
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. David Riley <fraveydank@gmail.com> - 2011-11-21 15:42 -0500
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Grant Edwards <invalid@invalid.invalid> - 2011-11-21 23:08 +0000
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Grant Edwards <invalid@invalid.invalid> - 2011-11-21 23:09 +0000
Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. Chris Angelico <rosuav@gmail.com> - 2011-11-22 11:32 +1100
csiph-web