Time script help sought!

2005-01-11 Thread kpp9c
I am kind of in a bit of a jam (okay a big jam) and i was hoping that someone here could give me a quick hand. I had a few pages of time calculations to do. So, i just started in on them typing them in my time calculator and writing them in by hand. Now i realize, that i really need a script to d

Re: Time script help sought!

2005-01-11 Thread kpp9c
Yes, Ultimately it will be part of a large digital archive available for researchers on site and eventually probably on-line for the New York Public Library. It is a huge undertaking and most of the soundfiles have been made. I (we) are struggling with the sheer size of the documentation Sorr

Re: Time script help sought!

2005-01-11 Thread kpp9c
Thanks for this Everyone! Trying to work with all the stuff folks are giving me on this i a have come across a problem... down the line i notice that some of the times will also have an hour as well as in H:M:S (e.g. 1:22:40) so in some cases i would need to convert H:M:S to sec and some just M:S

Re: Time script help sought!

2005-01-11 Thread kpp9c
I also notice that there is the is the 'datetime' module, which is new to version 2.3, which i now have access to. My feeling is that this will do much of what i want, but i can't get my head round the standard library reference stuff http://www.python.org/doc/lib/module-datetime.html I don't hav

Re: Time script help sought!

2005-01-11 Thread kpp9c
still working on it and also fixing the input data. I think for simplicity and consistency's sake i will have *all* time values input and output as hh:mm:ss maybe that would be easier but i have a few thousand find and replaceeseseses to do now (yes i am doing them by hand) grr... this is hard

Re: Time script help sought!

2005-01-11 Thread kpp9c
so all the imput will look more like this now... ( no comments either) tem_133, DAT_20, 7, 00:58:25, 01:15:50 Item_134, DAT_20, 8, 01:15:50, 01:32:15 Item_135, DAT_21, 1, 00:01:00, 00:36:15 Item_136, DAT_60, 3, 00:18:30 Item_136, DAT_60, 4, 00:19:30 Item_136, DAT_60, 5, 00:23:00, 00:28:00 Item

Re: Time script help sought!

2005-01-12 Thread kpp9c
paul that is awesome so much better than what i did which was lamo brute force method. I formmatted and reformatted my input data and stuffed it in a HUGE dictionary it was stupid and kludgy i hope to study all these approaches and learn something here's what i came up with ... with

permutations, patterns, and probability

2005-02-01 Thread kpp9c
Greetings, I am working on a program to produce patterns. What would like is for it to exhaustively produce all possible permutations of a sequence of items but for each permutation produce variations, and also a sort of stutter based on probability / weighted randomess. Let us say we have tiles

Re: random playing soundfiles according to rating.

2006-02-09 Thread kpp9c
I've been looking at some of the suggested approaches and looked a little at Michael's bit which works well bisect is a module i always struggle with (hee hee) I am intrigued by Ben's solution and Ben's distilled my problem quite nicely, but, welli don't understand what "point" is doing wi

Re: Scientific Computing with NumPy

2006-02-17 Thread kpp9c
Numeric, Numarray, & Numpy... some one stick a screwdriver in my forehead and end the madness that Numeric has become. Brilliant programming & an almost essential part of scientific & math hacking in python made maddeningly confusing by truly dumb naming scheme. For crying all night! Numpy was Nu

ls files --> list packer

2006-02-23 Thread kpp9c
I would like to use the power of Python to build some list structures for me. Namely i have organized a bunch of folders that have soundfiles in them and would like Python to slurp up all the .aif/.aiff (or .wav whatever) files in a given set of directories. My friend hacked up this is perl: $fil

Re: ls files --> list packer

2006-02-23 Thread kpp9c
and one example of a slightly fancier version would be a variation that looks recursively into subdirectories and makes separate lists for each subdirectory encountered. so if i had a directory called "~/snd/" and in "~/snd/" i had: "~/snd/one/" "~/snd/two/" "~/snd/three/" each with soundfiles

Re: ls files --> list packer

2006-02-24 Thread kpp9c
cool i just tried: >>> import os >>>snd_filelist = [f for f in os.listdir('/Users/foo/snd') if >>>f.endswith('.aif')] and it worked! and will take a huge bite out of my big script ... which i make by doing an ls in the terminal and editing (boo hoo) one one lc and one import! cool.. that oth

Re: ls files --> list packer

2006-02-24 Thread kpp9c
gosh i could even use other string methods like startswith to take all the files in a given directory which i have organized with a prefix and have them stuffed in different lists ... i think ... snd_filelist = [f for f in os.listdir('/Users/foo/snd') if f.endswith('.aif') & f.startswith('r')] \

Re: ls files --> list packer

2006-02-24 Thread kpp9c
that is nice but the little further wrinkle, which i have no idea how to do, would be to have the contents of each directory packed into a different list since you have no idea before hand how many lists you will need (how many subdirs you will enounter) ... well that is where the hairy pa

Re: ls files --> list packer

2006-02-26 Thread kpp9c
os.listdir works great ... just one problem, it packs the filenames only into a list... i need the full path and seach as i might i se NO documentation on python.org for os.listdir() how do i either grab the full path or append it later ... -- http://mail.python.org/mailman/listinfo/python-list

Re: ls files --> list packer

2006-02-26 Thread kpp9c
Thank you... i was looking in the wrong place cause all i found was this relatively useless doc: http://docs.python.org/lib/module-os.html which says almost nothing. -- http://mail.python.org/mailman/listinfo/python-list

Re: ls files --> list packer

2006-02-27 Thread kpp9c
nice! two little lines that do a boatload of work! hee hee pth = '/Users/kpp9c/snd/01' samples = [os.path.join(pth, f) for f in os.listdir(pth) if f.endswith('.aif')] thank you Kent! (and Jeremy and Magnus and Singletoned and I V ... and john boy and mary

time conversions [hh:mm:ss.ms <-> sec(.ms)

2006-04-28 Thread kpp9c
Hi, I was looking at python & datetime and hoping that it would already have a method/func to translate time formats. I need to translate seconds to hh:mm:ss.ms and vice versa and would like the ability to do some basic arithmetic in these formats. I think that there just has to be a package or mo

resume picking items from a previous list

2006-04-29 Thread kpp9c
I have a several list of songs that i pick from, lets, say that there are 10 songs in each list and there are 2 lists. For a time i pick from my songs, but i only play a few of the songs in that list... now my wife, Jessica Alba, comes home, and i start playing from Jessica's list of songs. After

Re: time conversions [hh:mm:ss.ms <-> sec(.ms)

2006-04-29 Thread kpp9c
timedelta looks to be just the ticket! bravo, thank you... i guess this must be pretty new to Python. Nice... more "batteries included" stuff... cheers, -kevin-- -- http://mail.python.org/mailman/listinfo/python-list

Re: midi input

2006-04-29 Thread kpp9c
http://www.mxm.dk/products/public/pythonmidi mxm rocks! i used to use it this to create midi files so i know it works... but now it has grown to big for my small brain, & have no clue how to actually use it... i keep hoping for a small tutorial and some more docs, this partially due to the bi

Python Launcher.app on OS X

2009-02-09 Thread kpp9c
I am very confused about the current state of Python on OS X 10.5. Looks like Apple ships with 2.5.1 and that is also the latest installer for OS 10.5. The notes on the wiki page found here: http://wiki.python.org/moin/MacPython/Leopard Say: Mac OS X 10.5.x (Leopard) comes with the 2.5.1 Python

Re: Python Launcher.app on OS X

2009-02-10 Thread kpp9c
So how does this effect the install instructions found on the link: http://wiki.python.org/moin/MacPython/Leopard do you trash that when you do an install on OS X? I am so hesitant to delete anything that resides in /System -- http://mail.python.org/mailman/listinfo/python-list

markov query

2006-03-13 Thread kpp9c
markov query I have noticed a couple markov implementations in python, but none quite seem to do what i would like. Most seem to do an analysis of some text and create a new text based on that... I think, (sorry i just don't know terminology well) a markov table (or is it called a transition table

Re: markov query

2006-03-14 Thread kpp9c
> Yes, a system which does this has to build a Markov chain from a data > set and then traverse it. >Any program that actually uses Markov chains to generate new text based >on existing input as you've described will necessarily create a Markov >chain. I think you misunderstood. If you see my ori

Re: markov query

2006-03-14 Thread kpp9c
>Yes, a system which does this has to build a Markov >chain from a data set and then traverse it. >>Any program that actually uses Markov chains to generate >> new text based on existing input as you've described Hi. That isn't really what i have described. If i did i could use exsisting algorith

Re: FIR filtering

2006-03-15 Thread kpp9c
www.rtcmix.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Markov process representation

2006-03-15 Thread kpp9c
This is wicked! I am trying to get it to work and am frantically fixing tabs and spaces... but isn't line 50: self._all_states |= set(key[i] for key in probabilities) an error? isn't it supposed to be: self._all_states != set(key[i] for key in probabilities) -- http://mail.python.org/mailman/l

pretty print, tidy, reindent.py

2006-03-15 Thread kpp9c
What ever happened to reindent.py ? This used to be part of the distribution. Does it still work with modern versions of python? A lot of the code i drag off here (even if i use "show original"!) comes out all messed up and i end up having to clean a lot of it up. I wonder if there is a reformatte

Re: Markov process representation

2006-03-15 Thread kpp9c
try as i might i still get an error: File "markov.py", line 50 self._all_states |= set(key[i] for key in probabilities) I am running: Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin If that helps any... Thanks! -- http://mail.pytho

Re: Markov process representation

2006-03-15 Thread kpp9c
yes looking at this code i see a few things i haven't seem before. I am on Mac OS X 10.3.x and updating the python seems like a non trivial task at the moment.. i will try that and see where that gets me. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Markov process representation

2006-03-15 Thread kpp9c
oh ... uhmm .. i don't follow what you are saying... where should i put those lines... should the import thing go on top? -- http://mail.python.org/mailman/listinfo/python-list

Re: Markov process representation

2006-03-15 Thread kpp9c
hee hee works fine ... but kinda slow on my old machine... really time for a new laptop haha! still this code is so beautiful! *^-^* -- http://mail.python.org/mailman/listinfo/python-list

Re: pretty print, tidy, reindent.py

2006-03-15 Thread kpp9c
thanks. i didn't realize just how bare bones that mac os x install of python is. I just grabbed it from the source. cheers, -kp- -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there no end to Python?

2006-03-18 Thread kpp9c
>> This is good thing because I can ignore what I don't need. I am finding that this is really not true for me. I find that if i use other folks code, collaborate, or get help from other folks i still have to know all the new constructs that i don't often use, and i really struggle with iterators

Re: Is there no end to Python?

2006-03-18 Thread kpp9c
>> This is a common (and silly) whine. 1. not a whine 2. if it is really common is it all that silly? >> effort in a free system is not fungible. The odds of your affecting how the people doing the work by complaining about how they do it and their priorities are about zero to one. That is tru

overlapping sets

2006-03-23 Thread kpp9c
I have a question... and ... whew ... i am gonna be honest, i haven't the slightest clue how to even start ... i am not sure if i used up all my good will here or can take a mulligan.. i love to try to at least post some lame broken code of my own at first... but like i said, not being a math perso

Re: Remove integer from float number

2006-03-23 Thread kpp9c
okay... out of curiousity... how would you then seperate the interger value from the fractional part do something to one side and then put it back together... like if you had 8.01 and you want to add to the '8' part in one way (ordinary decimal) and add to the .01 part modulo something .. like say

Very simple finite automaton (?)

2009-09-22 Thread kpp9c
Very simple finite automaton (?) I am not sure if this is and example of Finite Automaton or a Finite State Machine or perhaps it is related to a transition table or markov process. I am not a math person so i am not sure what it is called. I googled around and got lots of super complicated gobble