Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about python (old posts, page 6)

And so does uqbar

It's bet­ter than I re­mem­ber. Spe­cial­ly be­cause the SF CVS ver­sion is new­er than all the copies I had on disk (I won­der how that hap­pened).

In fac­t, it has a nice trick to cre­ate er­ror di­alogs from any ex­cep­tion I am lift­ing right away for oth­er apps :-)

The on­ly prob­lem it does have is that python's url­lib and url­lib2 sup­port for FTP seems to suck.

You can't choose the user­name and pass­word?

Sailor (Guten­berg's main server) is picky about the pass­word you send, and ralsi­na@rober­to, which url­lib in­sist on us­ing (user­name@host­name) does­n't pass muster.

And ft­plib, which can do the right thing, does­n't let me give progress of the down­load, which would make the pro­gram aw­ful.

Oh, well.

Good news in PyQt

Phil´s sup­port is great. That´s good enough news, but he helped me make im­ages-and-http-in-q­textbrows­er work again.

I think I will pack­age that wid­get neat­ly, be­cause it´s of gen­er­al use­ful­ness.

Synergy with myself.

Is there a name for that? It's like pick­ing one­self by one's boot­strap­s.

But any­way, I have been writ­ing a bunch of lit­tle PyQt projects in the last year or so, and they all seem to share some­thing with each oth­er.

Writ­ing KrSN, I worked on mak­ing a pseu­do/brows­er us­ing QTextBros­er... which is the note-dis­play­ing el­e­ment in Not­ty... which now is get­ting a re­Struc­tured­Text ed­i­tor... which will be used in Bartle­blog... for which I learned how to use XML­R­PC.. which I will use to write a Not­ty serv­er... and so on.

Of course, since I am do­ing all this as a hob­by, a rea­son­able re­lease of all these apps is still months in the fu­ture (KRsN is us­able, al­though in­com­plete, Not­ty will prob­a­bly be out in a de­cent shape first), but I am on­ly cod­ing for fun, any use any­one gets of it is strict­ly a hap­py side-­ef­fec­t, so... it's amus­ing in its own terms.

Neat stuff

This is a recipe at the Python Cook­Book show­ing how to add a new di­rec­tive to re­Struc­tured­Tex­t, called code-block, which syn­tax-high­lights the block!

I just im­ple­ment­ed it in Not­ty, and now you can have the neat­est code snip­pet­s. I did have to hack the out­put a fair bit since the dis­play­ing wid­get does­n´t sup­port <s­pan> (or CSS for that mat­ter), so I had to do mas­sive search-re­places on the out­put, to con­vert to <font>. But it took on­ly half an hour to do, since Sil­verCi­ty´s out­put is very reg­u­lar.

I think I will sug­gest this to Hugo for PyD­S, con­sid­er­ing the den­si­ty of pro­gram­mers among its users :-)

Whoa. Hits!

Looks like the pro­gram­ming tu­to­ri­al was well re­ceived. About 5000 hits in 12 hours :-)

To­day´s ran­ings:

Lat­er­al Opin­ion (link) 2355 SPE - Stani's Python Ed­i­tor (link) 86

If it con­tin­ues, Lat­er­al Opin­ion will reach 50K hits to­day. I´ll have a beer for that!

Contents © 2000-2024 Roberto Alsina