Resolving windows shortcut to url

2007-09-21 Thread Richard Townsend
If I have a windows shortcut to a URL, is there a way to get the URL in a Python app? I found some code that uses pythoncom to resolve shortcuts to local files, but I haven't found any examples for URLs. The PyWin32 help mentions the PyIUniformResourceLocator Object, but I couldn't find an

Re: Resolving windows shortcut to url

2007-09-21 Thread Richard Townsend
On Fri, 21 Sep 2007 22:29:37 +0200, Ivo [EMAIL PROTECTED] wrote: Ivo wrote: Richard Townsend wrote: If I have a windows shortcut to a URL, is there a way to get the URL in a Python app? I found some code that uses pythoncom to resolve shortcuts to local files, but I haven't found any

Re: Tutorial or Example (or Tutorial) of Using Canvas to Produce a Plot

2007-09-18 Thread Richard Townsend
On Tue, 18 Sep 2007 13:18:36 -0700, W. Watson [EMAIL PROTECTED] wrote: Tk is it. I'm really not interested in the others at this point. John Grayson's book 'Python and Tkinter Programming' has a chapter on plotting Graphs and Charts. You can even download that chapter as a PDF file:

Re: Bitwise expression

2007-01-08 Thread Richard Townsend
On Mon, 08 Jan 2007 22:32:12 +0100, Gigs_ wrote: Can someone explain me bitwise expression? few examples for every expression will be nice http://wiki.python.org/moin/BitwiseOperators -- Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] pyparsing 1.4.5 released

2006-12-23 Thread Richard Townsend
On 22 Dec 2006 19:59:53 -0800, Paul McGuire wrote: Download pyparsing 1.4.5 at http://pyparsing.sourceforge.net. The pyparsing Wiki is at http://pyparsing.wikispaces.com When I click on the sourceforge link above, I get redirected to the wiki. However,

Re: USB support

2006-06-13 Thread Richard Townsend
On 13 Jun 2006 11:08:59 -0700, rodmc wrote: Hi, I need to write a program which can access the USB ports on Mac and Linux, is there a library available for Python? Thanks in advance. Best, rod Not tried it, but: http://pyusb.berlios.de/ -- Richard --

Re: altering an object as you iterate over it?

2006-05-19 Thread Richard Townsend
On Fri, 19 May 2006 13:36:35 -0700, James Stroud wrote: Paul McGuire wrote: Your coding style is a little dated - are you using an old version of Python? This style is the old-fashioned way: [clip] 1. open(xxx) still works - not sure if it's even deprecated or not - but the new style is to

Re: How to get computer name

2006-04-29 Thread Richard Townsend
On 29 Apr 2006 10:04:39 -0700, pitarda wrote: Thanks! :) Though,... I think once I saw something like: getComputerByName but can't find it anymore,... :) import socket print socket.gethostname() blade print socket.gethostbyname('blade') # will print IP address -- Richard --

Re: Why TypeError: 'str' object is not callable?

2006-03-22 Thread Richard Townsend
On 22 Mar 2006 12:10:49 -0800, Randall Parker wrote: TmpErrMsg1 = State machine %s (StateMachineName) TmpErrMsg1 = State machine %s % (StateMachineName) -- Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: Using ElementTree to tidy up an XML string to my liking

2006-02-25 Thread Richard Townsend
On Fri, 24 Feb 2006 18:21:59 +0100, Magnus Lycka wrote: Concerning element names, it's your coice of course, but I agree more and more with Guido and PEP008 that camelCase is ugly. (Not that ALLCAPS is better...) I can see in PEP008 where it says Capitalized_Words_With_Underscores is ugly,

Re: directory listing

2005-11-11 Thread Richard Townsend
On 11 Nov 2005 21:20:33 GMT, SU News Server wrote: Try passing the full pathname of each item to os.path.isdir() You can create the pathname using os.path.join(directory, x) -- Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: directory listing

2005-11-11 Thread Richard Townsend
On 11 Nov 2005 22:00:04 GMT, Michael Konrad wrote: Richard Townsend [EMAIL PROTECTED] wrote: On 11 Nov 2005 21:20:33 GMT, SU News Server wrote: Try passing the full pathname of each item to os.path.isdir() You can create the pathname using os.path.join(directory, x) I wonder

Re: starting an X11 session from Python

2005-11-05 Thread Richard Townsend
On Sat, 05 Nov 2005 19:51:40 +, Philippe C. Martin wrote: Hi, Have there been any attempt to do so, and is there any source out there that could help me get started ? Regards, Philippe Have you tried: http://python-xlib.sourceforge.net/ http://sourceforge.net/projects/python-xlib

Re: Creating internet shortcuts

2005-10-10 Thread Richard Townsend
On Sun, 9 Oct 2005 23:08:45 -0400, Roger Upole wrote: Pythoncom doesn't directly support the necessary interfaces, but you can use the Shell COM interfaces to create them. import win32com.client wsh=win32com.client.gencache.EnsureDispatch('wscript.shell')

Creating internet shortcuts

2005-10-09 Thread Richard Townsend
I've seen the python.faqts page: http://www.faqts.com/knowledge_base/view.phtml/aid/4475/fid/538 on how to create windows shortcuts using Python. Does anyone know if this be adapted to create internet shortcuts on windows? (as used for Favorites). Thank you, -- Richard --

Extending Embedded Python

2005-09-24 Thread Richard Townsend
In the Extending and Embedding part of the Python documentation: section 5.4 Extending Embedded Python - it describes how to use a Python extension module from Python that is embedded in a C application. Is it safe to call Py_InitModule() more than once in the same application - in order to be

Re: Putting function references in a Queue

2005-08-10 Thread Richard Townsend
On Tue, 09 Aug 2005 23:46:22 GMT, Bryan Olson wrote: I think that's a good thing to do. The tricky part is getting an event loop to wait on both the queue and other kinds of events. Periodic polling works, but kind of sucks. What's the 'done' argument? A lock maybe? 'done' is just a

Putting function references in a Queue

2005-08-06 Thread Richard Townsend
I've been experimenting putting a reference to a function into a Queue object and was wondering what actually gets put in the Queue - is it the function's code object? If I read from the Queue in a different module, it appears that I don't need to import the module that defines the function - or

Re: Running twisted http server - Method Not Allowed error

2005-05-31 Thread Richard Townsend
On 30 May 2005 23:50:45 -0700, [EMAIL PROTECTED] wrote: from twisted.web import server, resource from twisted.internet import reactor class Simple(resource.Resource): isLeaf = True def render_GET(self, request): return htmlHello, world!/html site = server.Site(Simple())