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


Groups > comp.lang.python > #46196

Re: Problems with python and pyQT

References <8d8fd7fc-2509-457e-a4c9-0a1ac1f65c02@googlegroups.com>
From Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Date 2013-05-27 15:10 +0200
Subject Re: Problems with python and pyQT
Newsgroups comp.lang.python
Message-ID <mailman.2249.1369660253.3114.python-list@python.org> (permalink)

Show all headers | View raw


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.

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html

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


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