Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #46271
| X-Received | by 10.224.200.202 with SMTP id ex10mr17165763qab.8.1369734117013; Tue, 28 May 2013 02:41:57 -0700 (PDT) |
|---|---|
| X-Received | by 10.49.87.70 with SMTP id v6mr1843740qez.25.1369734116982; Tue, 28 May 2013 02:41:56 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!p1no1190823qaj.0!news-out.google.com!y6ni51517qax.0!nntp.google.com!ch1no2573589qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Tue, 28 May 2013 02:41:56 -0700 (PDT) |
| In-Reply-To | <mailman.2249.1369660253.3114.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=139.128.18.51; posting-account=G2g-AgoAAABHgt8irIz8rCHVtwKE5XKP |
| NNTP-Posting-Host | 139.128.18.51 |
| References | <8d8fd7fc-2509-457e-a4c9-0a1ac1f65c02@googlegroups.com> <mailman.2249.1369660253.3114.python-list@python.org> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <646e6bae-b0fc-46fe-bf60-23ec9b4958a3@googlegroups.com> (permalink) |
| Subject | Re: Problems with python and pyQT |
| From | silusilusilu@gmail.com |
| Injection-Date | Tue, 28 May 2013 09:41:57 +0000 |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | quoted-printable |
| Xref | csiph.com comp.lang.python:46271 |
Show key headers only | View raw
Thanks for your reply: very useful!!
I have another question: with hex command i display (for example)
0x1
is it possible to display 0x01?
Thanks
Il giorno lunedì 27 maggio 2013 15:10:24 UTC+2, Chris “Kwpolska” Warrick ha scritto:
> On Mon, May 27, 2013 at 11:26 AM, <silusilusilu@gmail.com> 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("<font color=\"Black\">"+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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Problems with python and pyQT silusilusilu@gmail.com - 2013-05-27 02:26 -0700
Re: Problems with python and pyQT Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-05-27 15:10 +0200
Re: Problems with python and pyQT silusilusilu@gmail.com - 2013-05-28 02:41 -0700
Re: Problems with python and pyQT Dave Angel <davea@davea.name> - 2013-05-28 06:59 -0400
csiph-web