def showImage(imageFile):
import PyQt4.Qt as qt
app = qt.QApplication([])
imgWin = qt.QLabel(None)
img = qt.QImage(imageFile)
imgWin.setPixmap(qt.QPixmap.fromImage(img))
imgWin.resize(img.width(), img.height())
imgWin.setWindowTitle(imageFile)
imgWin.show()
app.exec_()
showImage("C:\\tmp\\zoom.jpg")
More PyQt
Okay I am sure there is a right way to do this, and I am sure this isnt it, but this python function displays an image in a window ..... Now I need to go back to drawing board and do some reading to see how this stuff is really meant to hang together !!
Python + Qt4 + PyQt4
Sorry - a bit of a departure from the normal ....
<geekstuff>
Off sick today and spent some time tinkering with python and the flickr api. I have messed about a bit with the flickr api and c# before - but I thought I would give python a go - not as cool as ruby though apparently. All was going well messing around with the flickr api downloading urls, parsing xml etc until it came time to display some images. Time to search for a suitable gui toolkit - some good info here. Decided to give Python Qt (PyQt) a go. It was a bit of a pain to get going - mainly because most of the examples I could find were for Qt3 and not Qt4.
Anyway - I got it up and running on windows xp using msis and prebuilt binaries (yes - I know ... taking the easy way out !)
Need to make sure to add Qt to your path : eg. C:\Qt\4.2.1\bin
Run IDLE, a python interactive shell and enter the following
All that for this Enough for today .... hopefully I will get around to doing something a little more useful with it. Thanks to this link which helped me on my way.
</geekstuff>
<geekstuff>
Off sick today and spent some time tinkering with python and the flickr api. I have messed about a bit with the flickr api and c# before - but I thought I would give python a go - not as cool as ruby though apparently. All was going well messing around with the flickr api downloading urls, parsing xml etc until it came time to display some images. Time to search for a suitable gui toolkit - some good info here. Decided to give Python Qt (PyQt) a go. It was a bit of a pain to get going - mainly because most of the examples I could find were for Qt3 and not Qt4.
Anyway - I got it up and running on windows xp using msis and prebuilt binaries (yes - I know ... taking the easy way out !)
- Downloaded the latest python (V2.5) from python.org as an msi here.
- Dowloaded the latest Qt 4.2.1 from trolltech as self exe installer here.
- Downloaded PyQt4 from riverbankcomputing as a self exe installer here.:
Need to make sure to add Qt to your path : eg. C:\Qt\4.2.1\bin
Run IDLE, a python interactive shell and enter the following
import PyQt4.Qt as qt
app = qt.QApplication([])
hello = qt.QPushButton("Hello world",None)
hello.resize(100, 30)
hello.show()
app.exec_()
All that for this Enough for today .... hopefully I will get around to doing something a little more useful with it. Thanks to this link which helped me on my way.
</geekstuff>
The Killers @ Brixton Academy
Last night I headed down to the Brixton Academy to catch The Killers. Never been to the Brixton Academy before - cool venue. Support were The Rapture who were pretty good . The Killers finally took the stage and the fans went crazy - especially those who had paid 100 quid a ticket on ebay ! As for the gig, well they played new stuff, they played old stuff. And well, that was pretty much all they did. Brandon jumped around the stage, but crowd interaction was pretty minimal. No Billy Bragg concert! All in all the show was pretty good but just seemed to lack something - to be honest I think I was far more into The Killers a couple of years ago. Maybe it was just bad timing ...
Anyway - obligatory photos below ....
2006 : A Jarvis Oddity
Just got back from seeing Jarvis (as in Jarvis Cocker ex-Pulp) @ Koko in Camden. Great gig. Only got the new album this morning so had only heard the new material a couple of times - the gig was still fantastic despite my lack of familiarity with the music. The new album seems pretty good after the first couple of listens.
The encore was amazing. When he first came back on he played "Running the World" (google jarvis + myspace). After that he bantered with the crowd - "You want to hear some old material?" - the crowd cheered. To be honest though I didnt really want to hear him play any Pulp. He had the last laugh though - "Ok. Here is an old song. its not mine though .... " with which he launched into a cover of David Bowie's Space Oddity - "ground control to major tom ....." Brilliant. Glad I got tickets to the next gig at Roundhouse too !
The encore was amazing. When he first came back on he played "Running the World" (google jarvis + myspace). After that he bantered with the crowd - "You want to hear some old material?" - the crowd cheered. To be honest though I didnt really want to hear him play any Pulp. He had the last laugh though - "Ok. Here is an old song. its not mine though .... " with which he launched into a cover of David Bowie's Space Oddity - "ground control to major tom ....." Brilliant. Glad I got tickets to the next gig at Roundhouse too !
Guy Fawkes
Saturday night I once again broke my vow of not taking photos at fireworks displays - they never seem to work out. The photo below was taken in Battersea Park - it was a pretty good display - but the photographic results were average ..... Headed out afterwards to see Soulwax play live and also DJ at Fabric. Soulwax was good but the venue was just way too crowded. That combined with an attempted pickpocketing at Fabric by someone who looked suspiciously like a sith lord took the shine off the night a bit. Will be a while before I venture back to Fabric again - shame - great music.
Along the Banks Of The Thames
Decided to walk back towards home along the Thames after work last night. Normally I catch the bus just outside work but I felt like a stroll after a busy week at work. Met A half way and as we wandered passed the London Eye we decided to do the touristy thing and give it a shot. It was nearly closing time and hardly anyone about. We managed to get a "pod" with just two other people - lucky we were spared the large group of screaming girls in the line just behind us !! The view is pretty amazing at night - especially considering its Guy Fawkes soon so there are fireworks going off all over the city.
Subscribe to:
Posts (Atom)