Ah! nice, thanks, knew I was probably missing something.
On Jan 19, 2008 5:01 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> On Jan 19, 11:02pm, "David Tweet" <[EMAIL PROTECTED]> wrote:
>
> > def Grab(argdict, key, default):
> > """Li
Hello,
Seems to me that setattrs sort of assumes that you want to have all your
initialization arguments set as attributes of the same name. I would think
you'd sometimes want to be able to process the extra arguments inside of each
__init__, assign them to attributes with different names, etc.
>>> "THIS IS A STRING".lower()
'this is a string'
>>> "THIS IS A STRING".title()
'This Is A String'
>>> "this is a string".upper()
'THIS IS A STRING'
You can browse all the string methods by doing
>>> dir(str)
On Dec 14, 2007 1:30 AM, Merrigan <[EMAIL PROTECTED]> wrote:
> Hi There,
>
> I'm sure I
Hello,
You might try using os.path.walk, I think it ends up being much
more flexible than glob for this.
#!/usr/bin/python2.4
import os
def Finder(topdir, file_extension=None, levels=None):
"""Return all filenames in topdir.
Args:
topdir: Top level directory to search
file_extensi
This should work:
python -i myscript.py --cl --cs 5 --ce 6 --bw 7 --set 1
On Dec 5, 2007 6:31 PM, wang frank <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I am debugging a python script which takes a set of paramters. In the
> regular shell, I type:
>
> myscript.py --cl --cs 5 --ce 6 --bw 7 --se
Running this in Python should create a server running on localhost
port 80 that only serves blank pages:
import SimpleHTTPServer
import SocketServer
class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
print >> self.wfile, ""
server = SocketServer.TCPServer(("", 80
Are you opening the file in binary mode ("rb") before doing pickle.load on it?
On 01 Dec 2007 14:13:33 -0800, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> lysdexia <[EMAIL PROTECTED]> writes:
> > self.wordDB[word] = [self.words.count(word), wordsWeights]
>
> what is self.words.coun
To answer indirectly, usually the EAFP (easier to ask forgiveness than
permission) approach works better for this kind of thing.
try:
f = open('e:\\test\\test', 'a')
f.write('abc')
f.close()
except IOError:
print "couldn't write test file, continuing..."
On Dec 1, 2007 1:48 AM, Yann Lebou
You have options:
1) Have the file in your current working directory, in which case
it's just "import odbchelper".
2) Change your PYTHONPATH in your shell, adding a line like this to
your bashrc perhaps:
export PYTHONPATH=$PYTHONPATH:/home/jw/diveintopython-5.4/py
... and do the same
Before calling pygame.init(), you can call pygame.mixer.pre_init.
Make sure the sample rate and sample size matches your audio file.
But most likely the issue is that the default audio buffer size of
1024 doesn't cut it for some sound cards; try increasing to the next
power of two.
Ex.
pygame.mi
10 matches
Mail list logo