Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'binary': 0.07; 'ascii': 0.09; 'iterate': 0.09; 'python:': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; "'q'": 0.16; 'characters:': 0.16; 'gpg': 0.16; 'hex': 0.16; 'subject:Problems': 0.16; 'values?': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'cc:addr:python.org': 0.22; 'unicode': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'that.': 0.31; 'too.': 0.31; 'letter.': 0.31; 'run': 0.32; 'text': 0.33; 'url:python': 0.33; 'subject:with': 0.35; 'display': 0.35; 'skip:s 30': 0.35; 'convert': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'turn': 0.37; 'url:mail': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'new': 0.61; 'from:charset:utf-8': 0.61; 'to:addr:gmail.com': 0.65; 'characters,': 0.84; 'url:tk': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JOqUbxfw51rONqlu5scLfLg/yE95+P6O23qzRdMnJbc=; b=IC2/poXiB/KQ3YC6VidmZn97lMu1eS1MdTSgbADgVz9MUgrU6Ns96YJ6JeThXU1RhR bALIecShz0CPY7lJE7gkduPGPyN0F3hzYp+EIpANMx0SsLC6UVB5uu+x8ec5uVsIE/pz ozBNMqrrYMFasIXdxBuXu0MMsoZysbB9DJ+V5kbyoFmrphuar6kT19lXmpd/BcJt81K4 OtwDO2jpedvtQC6Edq4OzHm25ZHbCRV9qu4VBVFmb/l3CExaXgfolfE/HvcFg58asUK7 sSNtEoPXA7aoAXI49RIKJ9kI4zU1plsjusE8b6euY0/htrqZccldjGdYUdzi0hnd0Px+ zLBA== X-Received: by 10.42.64.135 with SMTP id g7mr17015248ici.37.1369660244491; Mon, 27 May 2013 06:10:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8d8fd7fc-2509-457e-a4c9-0a1ac1f65c02@googlegroups.com> References: <8d8fd7fc-2509-457e-a4c9-0a1ac1f65c02@googlegroups.com> From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= Date: Mon, 27 May 2013 15:10:24 +0200 Subject: Re: Problems with python and pyQT To: silusilusilu@gmail.com Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369660253 news.xs4all.nl 15894 [2001:888:2000:d::a6]:42145 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46196 On Mon, May 27, 2013 at 11:26 AM, wrote: > Hi, > i'm new with python: so excuse me for my questions.... > i have this code: > > def updateLog(self, text): > self.ui.logTextEdit.moveCursor(QTextCursor.End) > self.ui.logTextEdit.insertHtml(""+text) > self.ui.logTextEdit.moveCursor(QTextCursor.End) > > logTextEdit is a QTextEdit object.With this code,i can display only ascii characters: how can i diplay text as hex and binary values? > Thanks > -- > http://mail.python.org/mailman/listinfo/python-list You would need to convert them to strings first. You may want bin() and hex() for that. And if you want to convert 'q' to 0x71, hex(ord("q")). And if you want to turn 'hello' into 0x68656c6c6f, you would need to iterate over 'hello' and run the above function over every letter. Also, you are able to display Unicode characters, too. -- Kwpolska | GPG KEY: 5EAAEA16 stop html mail | always bottom-post http://asciiribbon.org | http://caliburn.nl/topposting.html