Jython Sounds Examples

2006-10-10 Thread Ian Vincent
I have been hunting around Google hits for any source code examples of using sound (preferably WAV) under Jython with no success (minus several using other toolkits such as JNRI and JES). Does anybody know if any such examples exist and if so, I would be grateful for a pointer in their directio

Jythonc Problem

2006-07-04 Thread Ian Vincent
I cannot find a Jython newsgroup, so apologies in advance if this question has been posted to the wrong group. Just written my first Jython program (previously written Python ones) and it is working fine in 'interpreted mode'. I now want to compile it into Java classes but I get the following e

Re: Writing pins to the RS232

2005-11-28 Thread Ian Vincent
Peter Hansen <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > All true, but then Jay might get into electrical compatibility issues, > and may not realize that the output levels of RS-232 serial hardware > are not simply 0 and 5V levels, but rather +9V (or so) and -9V (and > with variatio

Re: How to use generators?

2005-11-10 Thread Ian Vincent
Tom Anderson <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Exactly - using a queue means you'll do a breadth-first rather than a > depth-first search, which will involve much less depth of recursion. > See: Thanks for the answers but found a easier (admittedly cheating) way around

How to use generators?

2005-11-09 Thread Ian Vincent
I have never used generators before but I might have now found a use for them. I have written a recursive function to solve a 640x640 maze but it crashes, due to exceeding the stack. The only way around this I can think of is to use Generator but I have no idea how to. The function is as b

Re: Spoiler to Python Challenge (help!!!)

2005-09-29 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > bz2.decompress(eval('"' + user + '"')) > > Sorry about that. I was trying the other as an alternative, > but in fact, it doesn't work. So ignore that. Excellent! Thanks. -- http://mail.python.org/mailman/listinfo/pytho

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Took me a long time to figure out what you meant. ;-) > > So the string actually contains the backslashes, not the escaped > characters. > > This works: > bz2.decompress(eval(repr(user))) > 'huge' Unfortunately, it d

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > please, line = line[20:-1], etc, is easier to read and understand ;-) Thanks, i'll put that in. -- http://mail.python.org/mailman/listinfo/python-list

Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Ian Vincent
Damn this is annoying me. I have a webpage with a BZ2 compressed text embedded in it looking like: 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M \x07<]\xc9\x14\xe1BA\x06\xbe\x084' Now, if I simply copy and paste this into Python and decompress it - it works a treat. H

Re: TKinter, Entry objects and dynamic naming

2005-09-13 Thread Ian Vincent
Ian Vincent <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > I have looked at using a dictionary but I cannot get my head around > how to do that either. I have tried this now but the Entry field just does not seem to work: def add_variable(self, root, varname): L

TKinter, Entry objects and dynamic naming

2005-09-13 Thread Ian Vincent
I am hoping someone may be able to help. I am using Python and TKinter to create a GUI program that will eventually create an XML file for a project I am working on. Now, the XML file contents changes depending on the type of file it represents - so I am dynamically creating the TK Entry boxes.

Re: Help need with converting Hex string to IEEE format float

2004-12-17 Thread Ian Vincent
Max M <[EMAIL PROTECTED]> wrote in news:41bf121e$0$280 [EMAIL PROTECTED]: > > ## > st = '80 00 00 00' > > import binascii > import struct > > s = ''.join([binascii.a2b_hex(s) for s in st.split()]) > v = struct.unpack("f", s)[0] > print v > ## This one worked great for what I was trying to do.