foo

Tuesday, July 19, 2005

Python:Creating a Task Bar icon in wxPython





Here is another nifty tidbit of python code that is often hard to find. If you work with Python and wxPython to build gui apps, there are number of widgets etc., that can be hard to figure out. Adding a task bar icon for your app is one of them. This simple example shows you how to add a taskbar icon, and capture events from it.

import wx

def OnTaskBarRight(event):
app.ExitMainLoop()
#setup app
app= wx.PySimpleApp()

#setup icon object
icon = wx.Icon("favicon.ico", wx.BITMAP_TYPE_ICO)

#setup taskbar icon
tbicon = wx.TaskBarIcon()
tbicon.SetIcon(icon, "I am an Icon")

#add taskbar icon event
wx.EVT_TASKBAR_RIGHT_UP(tbicon, OnTaskBarRight)

app.MainLoop()



Check out the documentation for wxPython, for more information.

Thursday, June 30, 2005

Google: New Maps API





Google has released the API for Google Maps. This api allows you to display maps on you own pages, and do things like add routes, icons, and information tabs. This is actually pretty easy to use, and all you need to do is apply for your own API key, and copy the example api code into any html page. If you need to see a working example, check the very bottom of this page, and you will see it at work(and where I work)REMOVED--Check the Google site. Pretty nifty trick. And if you are a blogger on blogspot, it is as easy as pasting the correct code into your template.

Click here for the API goodness!

Wednesday, June 29, 2005

QT: Trolltech QT 4.0



Trolltech has finally launched a GPL version of their software for Win32. This is great news for myself, and a lot of people out there.I for one, have never been able to install QT properly on my linux box.
There was always some missing or mis-referenced library, and I never could get it to work. I could also never seem to find the old 2.3 Win32 version that was GPL'd. Now, I can try it on my windoze box, and see if it is easier to write my Python Gui's.

Click here for the win32 download mirrors!

Tuesday, June 28, 2005

iTunes: Version 4.9 with Podcast Support


The new version of iTunes has hit the street, so all of you blogcast/podcast folks can enjoy searching the hundreds of audio blogs out there.
Also in this new version, is the ability to publish your own podcast.
Nothing else that exciting about it, aside from the podcast features.
Good stuff-

Apple - iTunes - Download iTunes

Monday, June 27, 2005

Linux Gaming: Linspire and Transgaming Change the World


Interesting stuff here. This new software package is touting the ability to allow you to play hundreds(a hundred?) different win32 games on linux. This particular package is Linspire specific. There is a lot of talk out there in the open source community, about how this is pointless because it's not free, and goes against the spirit of the linux community...blah..blah.

The point is, that this kind of software has to get out there, and has to sell, to ever make Linux the desktop powerhouse it deserves to be. It is time for the Linux/FOSS community to grow up a little, and realize that it is still just a commodity. Not that I'm going to pay to try it out, but I'm a cheap bastard.



TransGaming Technologies

Thursday, June 23, 2005

Javascript: Virtual Unix






Check out this really neat implementation of a *nix console done entirely in javascript. The quality of web design work showing up on the interweb, is getting really impressive. I am also rather happy to see this resurgence of javascript. I get the feeling that the popularity of Firefox
may be leading the new javascript/XUL/Ajax front.

Click here to check this out.

Monday, June 20, 2005

Python: Simple Socket Test





I have found that there is not a lot of documentation out there that shows you a simple way to instantiate a socket connection. Here is a simple code snippet, that shows you how to make a connection using the socket module. This would be useful for checking whether a host is listening on a particular port. This is not a full sockets implementation(no send, or recieve), but simply tests if a TCP socket is open.


import socket

#Simply change the host and port values
host = '127.0.0.1'
port = '80'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((host, port))
s.shutdown(2)
print "Success connecting to "
print host + " on port: " + str(port)
except:
print "Cannot connect to "
print host + " on port: " + str(port)


FYI- You can test for a UDP port by changing "socket.SOCK_STREAM" to "socket.SOCK_DGRAM" .

Check out the documentation for the socket module here
.