After looking at the Python docs for the wave module, I'm a bit puzzled as
to how to use it.
Does anyone have an example I can browse?
If I write to a wave file, is the data I write actually audible, if I use
Winamp or some other wave player, or is it more complicated than that?
Is the data I w
Hi,
I am not a programmer, but have decided to learn Python. I am
wondering if anyone has used the Activestate ActivePython and what are the
advantages/disadvantages of using it rather than the standard Python
tools.
Robert
___
Tutor maillist -
Terry Carroll wrote:
On Fri, 11 Feb 2005, Bob Gailer wrote:
Whenever you find yourself writing an if statement ask whether this
would be better handled by subclasses. Whenever you find yourself about
to write a global statement, consider making the variables properties of
a class.
Bob --
Brian
On Wed, 16 Feb 2005 21:37:10 +, Chris Bromley
<[EMAIL PROTECTED]> wrote:
> Any help would be greatly appreciated!
Others have already pointed out that we will have a hard time helping
without a bit more information. But I've noticed something odd in
your code -- it probably doesn't have anyt
On Wed, 16 Feb 2005, Bill Mill wrote:
> > I have several thousand files in dBaseIV format that I need to convert
> > to shapefiles for use in ArcGIS. I've written a script (see below) to
> > automate this process but thus far have been unable to get it to work.
> > I suspect that there's a simpl
What are you getting? What are you expecting? Are you getting an
error? If so, what's it telling you? Can you email this stuff up?
I suspect you want to find the pywin documentation and go through that.
Cheers,
Liam Clarke
On Wed, 16 Feb 2005 16:47:26 -0500, Bill Mill <[EMAIL PROTECTED]> wrot
Terry Carroll said unto the world upon 2005-02-16 16:18:
On Fri, 11 Feb 2005, Bob Gailer wrote:
Whenever you find yourself writing an if statement ask whether this
would be better handled by subclasses. Whenever you find yourself about
to write a global statement, consider making the variables pro
Jeff Shannon said unto the world upon 2005-02-16 16:09:
On Tue, 15 Feb 2005 23:48:31 -0500, Brian van den Broek
<[EMAIL PROTECTED]> wrote:
Yes, if you know that you will only have one header per line, then
it's reasonable to process them one line at a time. You could
alternatively have the TP_f
Chris,
On Wed, 16 Feb 2005 21:37:10 +, Chris Bromley
<[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have several thousand files in dBaseIV format that I need to convert to
> shapefiles for use in ArcGIS. I've written a script (see below) to automate
> this process but thus far have been unab
Kent Johnson said unto the world upon 2005-02-16 15:02:
Brian van den Broek wrote:
I had been thinking better to get everything working and then
refactor. Is that an unsound approach? My worry about refactoring now
is that I feel like I am rearranging deck-chairs when I should be
worried about
Dear all,
I have several thousand files in dBaseIV format that I need to convert to
shapefiles for use in ArcGIS. I've written a script (see below) to automate
this process but thus far have been unable to get it to work. I suspect that
there's a simple reason for this, but I'm a complete novi
On Fri, 11 Feb 2005, Bob Gailer wrote:
> Whenever you find yourself writing an if statement ask whether this
> would be better handled by subclasses. Whenever you find yourself about
> to write a global statement, consider making the variables properties of
> a class.
Bob --
Brian already asked
On Tue, 15 Feb 2005 23:48:31 -0500, Brian van den Broek
<[EMAIL PROTECTED]> wrote:
> Jeff Shannon said unto the world upon 2005-02-15 21:20:
> > On Tue, 15 Feb 2005 17:19:37 -0500, Brian van den Broek
> > <[EMAIL PROTECTED]> wrote:
> >
> > For starters, I've made metadata a class attribute rather t
On Wed, 16 Feb 2005 16:50:07 +1300, Liam Clarke <[EMAIL PROTECTED]> wrote:
> Oops, you probably want to do this then-
>
> for i in range( 0, 3 ):
> oThread = Thread( target=mainFunction ).start()
>
> while oThread:
> print 'sleeping 3 seconds'
> time.sleep( 3 )
Brian van den Broek wrote:
As for the code smell thing, I have a follow-up question. I now get the
point of the type-based conditional being a smell for classes. (I get it
due to a previous thread that an over-enthusiastic inbox purge prevents
me from citing with certainty, but I think it was Bi
Brian van den Broek said unto the world upon 2005-02-16 14:04:
Kent Johnson said unto the world upon 2005-02-16 05:58:
if 'text' == self.document_type:
self.do_text_stuff()
if 'RTF' == self.document_type:
self.do_RTF_stuff()
Conditionals on a 'type' flag are a code smell that suggests using
Kent Johnson said unto the world upon 2005-02-16 05:58:
Brian van den Broek wrote:
Also, I know the general security concerns about things like exec.
They make me nervous in using it, even though I am (as yet) the sole
user. Am I right in thinking that the constrained way I am using it
here pro
At 11:40 PM 2/15/2005, Alan Gauld wrote:
Is there a better way for raw_input to accept both caps and lower
case letters than:
def aFunction():
action = raw_input("Perform an action?(y,n): ")
action = raw_input("Perform an action?(y,n): ").upper()
if action == 'y' or action == 'Y':
On Wed, 16 Feb 2005 11:34:55 +0100, Roel Schroeven
<[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
> > However, where will it be pointing in 16 hours? Well, in 12 hours it
> > will be at the one, then four more hours later it will be pointing at
> > the five. This can be represented as:
> >
> > 1 + (
. Sm0kin'_Bull wrote:
wrote this, It's a bit lame though
I = "Allen"
me = "Allen"
my = "Allen's"
print \
"""
%s woke up early in the morning. But, it was unusal by %s. %s pillow
was with %s. %s didn't want to wake up But, %s tried my best and woke
up.
it was so amazing!""" % (I,me,
I wrote this to add 2 numbers...print "Please input data"number1 = int(raw_input(" "))number2 = int(raw_input("+ "))total = number1 + number2print totalraw_input("")I want to make output like this...1 + 1 = 2But, actually... it looks like this...1+ 12
Express yourself instantly with MSN Messenger!
wrote this, It's a bit lame thoughI = "Allen"me = "Allen"my = "Allen's"print \"""%s woke up early in the morning. But, it was unusal by %s. %s pillowwas with %s. %s didn't want to wake up But, %s tried my best and woke up.it was so amazing!""" % (I,me,my,me,I,I)raw_input("\n\\t\t\t- The End -")Bu
Not to beat a dead horse, but
Liam Clarke wrote:
Oops, you probably want to do this then-
for i in range( 0, 3 ):
oThread = Thread( target=mainFunction ).start()
Thread.start() looks like it returns None.
#
In [23]: from threading import Thread
In [24]: impo
Kent Johnson wrote:
Another way to do this is to use dispatch methods. If you have extra
processing to do for each tag, this might be a good way to go.
I'm going to assume that your data lines have the form 'tag=data'. Then
your Node class might have methods that look like this:
class Node:
.
You might find these threads on comp.lang.python interesting:
http://tinyurl.com/5zmpn
http://tinyurl.com/6mxmb
Peter Kim wrote:
Which method is best and most pythonic to scrape text data with
minimal formatting?
I'm trying to read a large html file and strip out most of the markup,
but leaving the
Brian van den Broek wrote:
My Node class defines a _parse method which separates out the node
header, and sends those lines to a _parse_metadata method. This is where
the elif chain occurs -- each line of the metadata starts with a tag
like "dt=" and I need to recognize each tag and set the appr
Or
name = raw_input("Hi. What's your name? ")
called = "%s " % name
On Wed, 16 Feb 2005 11:46:09 +0100, Pierre Barbier de Reuille
<[EMAIL PROTECTED]> wrote:
> Mmmhh ... one very simple way would be to replace your first line by :
>
> name = raw_input("Hi. What's your name? ") + " "
>
> But
On Feb 16, 2005, at 10:26, . Sm0kin'_Bull wrote:
it prints like...
John GoodmanJohn GoodmanJohn GoodmanJohn GoodmanJohn Goodman
But i want to print it like...
John Goodman John Goodman John Goodman John Goodman John Goodman
How can I do it?
Try replacing the called = name * 5 line w
Mmmhh ... one very simple way would be to replace your first line by :
name = raw_input("Hi. What's your name? ") + " "
But if you want to keep the name as it is, I bet the best way is to
replace your second line by :
called = " ".join([ name for i in xrange(5) ])
The advantage of this second m
. Sm0kin'_Bull wrote:
Hi, I got a problem with this program.
name = raw_input("Hi. What's your name? ")
called = name * 5
called = ' '.join([name]*5)
print "\nIf a small child were trying to get your attention, " \
"your name would become:"
print called
When i input the name like "John G
Bill Mill wrote:
> However, where will it be pointing in 16 hours? Well, in 12 hours it
> will be at the one, then four more hours later it will be pointing at
> the five. This can be represented as:
>
> 1 + (16 % 12) = 1 + 4 = 5
Correcter is
(1 + 16) % 12 = 17 % 12 = 5
> In general, the hour a
Hi, I got a problem with this program.
name = raw_input("Hi. What's your name? ")called = name * 5print "\nIf a small child were trying to get your attention, " \ "your name would become:"print called
When i input the name like "John Goodman"
it prints like...
John GoodmanJohn Goodman
32 matches
Mail list logo