jueves, 23 de diciembre de 2010

wxPython: Crear un editor simple, en Python

Hola. En este post os presento un editor de texto básico escrito en Python y wxPython, para que veáis el funcionamiento, cómo se heredan clases de las wx, así como el uso de la impresión en wxPython.

El código, como siempre, se puede descargar del repositorio de este blog, en:

https://sites.google.com/site/elviajedelnavegante/codigo

Fichero editor_ejemplo.zip.

Estamos hablando de un editor de texto, no de un procesador de texto, por tanto no podemos incluir texto enriquecido ni nada parecido. Es lo más parecido al bloc de notas de Windows, pero escrito en Python y wxPython.

Se implementa un sistema de impresión, en donde podemos encontrar la configuración de página, vista preliminar de impresión e impresión directa.

Algunas capturas de pantalla de la aplicación a continuación:





































Cosas que faltan...

En la impresión, no se hace un wrapper del texto, es decir, no se tienen en cuenta los márgenes, por lo que si no se incluyen retornos de línea (Enter) el texto se saldrá del área de impresión. Esto habría que arreglarlo...

Saludos.

16 comentarios:

  1. y el codigo hijo de la gran puta

    ResponderEliminar
  2. Holaaaaa alguien que sepaaa hacer una planilla en python parecido hasta ejemplo pero que se guarden los datos como en un datagrid grax ???


    lau9.11@hotmail.com

    ResponderEliminar
  3. Very nice post. I simply stumbled upon your blog and wished to say that I have really loved surfing around your blog posts.
    In any case I'll be subscribing for your rss feed and I am hoping you write once more soon!

    Stop by my web site: igf 1

    ResponderEliminar
  4. My brother suggested I might like this web site. He was totally right.
    This post truly made my day. You cann't imagine simply how much time I had spent for this information! Thanks!

    Also visit my web blog ... raspberry keytone

    ResponderEliminar
  5. Hi there I am so delighted I found your site, I really found you by accident,
    while I was researching on Askjeeve for something else, Regardless I am here now and
    would just like to say cheers for a remarkable post and a all round entertaining blog (I also love the theme/design), I don't have time to go through it all at the moment but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent work.

    my weblog ... toothache symptoms

    ResponderEliminar
  6. I used to be able to find good information from your blog posts.


    Here is my web page: teeth whitening

    ResponderEliminar
  7. Hi there! I understand this is sort of off-topic however I had to ask.
    Does managing a well-established website like yours require a lot of work?

    I am brand new to running a blog but I do write in my
    diary everyday. I'd like to start a blog so I can easily share my experience and thoughts online. Please let me know if you have any kind of suggestions or tips for new aspiring bloggers. Appreciate it!

    Look into my site: garcinia triphala

    ResponderEliminar
  8. Just desire to saу your article іs as astounding.
    The clarity for your publish is simply excеllent
    and і could аssume you are knowledgeable in this subject.
    Well alоng wіth youг permission аllow me to clutch yоur feed to keеp updateԁ ωіth
    drawing close post. Thanks а mіllіon and please
    сontinue the enjoуable work.

    Fеel frее to surf to my wеb blog:
    raspberry ketone fresh

    ResponderEliminar
  9. Howdy! Do you use Twitter? I'd like to follow you if that would be okay. I'm undoubtedly enjoуing
    your blog and look foгwаrd to nеw updates.


    My ωeb page; green coffee bean

    ResponderEliminar
  10. you are aсtually a excellent webmаsteг.
    The web sitе loaԁing speed is incгeԁible.
    It seеms that you are doіng any unique trick.
    Іn aԁdition, The contents are masterwοгk.

    yοu have performеd a wonderful task
    in this topic!

    Also visit my blοg ... simply raspberry ketones

    ResponderEliminar
  11. This deѕign іs ѕpeсtacular!
    You certainly know hοw to kеep а reader amusеd.
    Betwеen your wit аnd yοur vidеos, I ωas
    almost moved to staгt my own blοg (well, almost.
    ..HaHa!) Great jοb. ӏ really enjoyed what you had to say,
    and morе than that, hоω you presеntеd it.
    Too cool!

    My site - raspberry ketone

    ResponderEliminar
  12. Ηey! I'm at work browsing your blog from my new apple iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the outstanding work!

    My site; pure green coffee bean extract

    ResponderEliminar
  13. Vеry nice post. I simply stumbleԁ upon your weblog and wanted to say that I've really enjoyed surfing around your weblog posts. After all I will be subscribing to your feed and I hope you write again soon!

    My site ... green coffee

    ResponderEliminar
  14. Hеy thеre! I сoulԁ have sωorn I've been to this site before but after reading through some of the post I realized it's neω tо me.

    Anуhow, ӏ'm definitely glad I found it and I'll be bookmarking
    and сhecking back οften!

    Viѕit my blοg greеn coffeе bean
    extrасt pure ()

    ResponderEliminar
  15. Hi thегe, the whοle thing is going sοund hеге and οfcouгse eveгy one is sharing infοгmatіоn,
    that's actually excellent, keep up writing.

    my homepage: mvmt electric light up hoodies

    ResponderEliminar
  16. Тhanκs for finаlly writing about > "wxPython: Crear un editor simple, en Python" < Loved it!

    Look into my blog - green coffеe
    bеan

    ResponderEliminar