Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Yes. As far as I can see it does not contain any thing which concerns the volume of sound. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:42 AM, Mark Lawrence wrote: > On 13/09/2012 00:57, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> The Beep attribute of winsound module is useful. But the volume is f

Re: [Tutor] Sigh first real python task

2012-09-12 Thread Mike S
Sorry, hit send a bit too fast there: here is the output: session setup failed: NT_STATUS_LOGON_FAILURE /bin/sh: put: command not found On Wed, Sep 12, 2012 at 8:14 PM, Steven D'Aprano wrote: > On 13/09/12 13:06, Mike S wrote: > > Now, I'm having to change the remote host and pass both the u

Re: [Tutor] Sigh first real python task

2012-09-12 Thread Steven D'Aprano
On 13/09/12 13:06, Mike S wrote: Now, I'm having to change the remote host and pass both the username and pass but cannot get it to work. Since we don't have access to your machine to try it, would you care to tell us what happens when you try, or shall we just guess? -- Steven _

[Tutor] Sigh first real python task

2012-09-12 Thread Mike S
So, trying to modify a python script that when invoked copies a local file to a remote host. Previously this was done with only needing to pass a username. try: ret = subprocess.call("smbclient //metricsmachine/reports/; put %s\" -U metrics%%" % (fileName), shell=True) if ret

Re: [Tutor] Print List

2012-09-12 Thread Steven D'Aprano
On 13/09/12 10:57, bob gailer wrote: On 9/12/2012 11:36 AM, Ashley Fowler wrote: I am trying to complete the following below: You also need to write a function "printList" of one parameter that takes a list as its input and neatly prints the entire contents of the list in a column. Any Suggestio

Re: [Tutor] Print List

2012-09-12 Thread bob gailer
On 9/12/2012 11:36 AM, Ashley Fowler wrote: I am trying to complete the following below: You also need to write a function "printList" of one parameter that takes a list as its input and neatly prints the entire contents of the list in a column. Any Suggestions or Corrections? I would correct the

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 13/09/2012 00:57, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: The Beep attribute of winsound module is useful. But the volume is feeble. Is there anyway to control the loudness. Have you read http://docs.python.org/library/winsound.html ? -- Cheers. Mark Lawrence. _

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
One can ofcourse increase the volume by adjusting master volume. But one needs ability to program volume level in order to produce sounds of different volume levels in a piece of music. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:27 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: >

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
The Beep attribute of winsound module is useful. But the volume is feeble. Is there anyway to control the loudness. -- regards, Sarma. On Thu, Sep 13, 2012 at 4:45 AM, Alan Gauld wrote: > On 12/09/12 14:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> My OS is Windows XP. I have Python 2.7.3(32 bit).

Re: [Tutor] Print List

2012-09-12 Thread akleider
> On 12/09/12 16:36, Ashley Fowler wrote: > >> def printList(lists): >> print("First Name\tLast Name\tCredits\tGPA") >> for i in lists: >> print (i) >> >> >> Any Suggestions or Corrections? > > The input parameter is called 'lists' which implies that the input is > more than one

Re: [Tutor] How to print a variable from an if/else statement

2012-09-12 Thread Dave Angel
On 09/12/2012 12:38 PM, bob gailer wrote: > > > /Python has statements/./ /if // is a ///statement./So is > /def. > > What's with the attempted italics? This is a text mailing list, and the text version of your html message was thoroughly mangled. It'd be much better to just send t

Re: [Tutor] Print List

2012-09-12 Thread Alan Gauld
On 12/09/12 16:36, Ashley Fowler wrote: def printList(lists): print("First Name\tLast Name\tCredits\tGPA") for i in lists: print (i) Any Suggestions or Corrections? The input parameter is called 'lists' which implies that the input is more than one list. Try to make your

Re: [Tutor] Musical note on python

2012-09-12 Thread Alan Gauld
On 12/09/12 17:01, Dwight Hutto wrote: If you have Windows, then you should be on the pywin32 list, I usually assume linux on this list, but both get answered. Just to be clear the tutor list is not OS biased. Windows, MacOS or Linux are all equally welcome (and indeed MVS or OpenVMS if neces

Re: [Tutor] Musical note on python

2012-09-12 Thread Alan Gauld
On 12/09/12 14:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: My OS is Windows XP. I have Python 2.7.3(32 bit). My question is are there any commands in Python which directly allow me to produce a pure note Have a look at the audioop, wave and winsound modules. Also PyGame has some tools that try to do

Re: [Tutor] setting a timer

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 1:56 PM, Matthew Ngaha wrote: > i have a way to set a timer for creating new objects copied from a > book but as i have started my next exercise in a very different way, i > want to avoid that math method/formula as it will cause me to > rearrange some classes totally... >

Re: [Tutor] setting a timer

2012-09-12 Thread Matthew Ngaha
> Get a slower computer. > > I expect that if you find an old Commodore 64 from 1982, or perhaps > an 1984 Apple Macintosh, it might be slow enough for your count down > idea to work. But with modern computers, counting up to, or down from, > 5 is more or less instantaneous in human terms. > >

Re: [Tutor] setting a timer

2012-09-12 Thread Steven D'Aprano
On 13/09/12 03:56, Matthew Ngaha wrote: class Game(object): interval = 0 def play(self): Game.interval = 40 while Game.interval> 0: self.count_down() def count_down(self): Game.interval -= 1 so the play() method gives interval a

Re: [Tutor] How to print a variable from an if/else statement

2012-09-12 Thread Joel Goldstick
On Wed, Sep 12, 2012 at 12:38 PM, bob gailer wrote: > Precision in terminology is good. > > Python has keywords. if, and, else are keywords. All keywords are all lower > case. > > Keywords cannot be overridden by assignment. > > Python has statements. if is a statement. So is def. > > Some keywor

[Tutor] setting a timer

2012-09-12 Thread Matthew Ngaha
i have a way to set a timer for creating new objects copied from a book but as i have started my next exercise in a very different way, i want to avoid that math method/formula as it will cause me to rearrange some classes totally... i tried a simple method but its not working. any ideas? heres my

Re: [Tutor] Print List

2012-09-12 Thread Brannon, Terrence
From: Tutor [mailto:tutor-bounces+terrence.brannon=bankofamerica@python.org] On Behalf Of Ashley Fowler Sent: Wednesday, September 12, 2012 11:36 AM To: tutor@python.org Subject: [Tutor] Print List I am trying to complete the following below: You also need to write a function "printLis

Re: [Tutor] Musical note on python

2012-09-12 Thread Jerry Hill
On Wed, Sep 12, 2012 at 8:38 AM, Dwight Hutto wrote: > If you have Windows, then you should be on the pywin32 list, I usually > assume linux on this list, but both get answered. If you're having a problem with either the specific pywin32 module[1], or have questions about accessing the deep dark

Re: [Tutor] How to print a variable from an if/else statement

2012-09-12 Thread bob gailer
Precision in terminology is good. Python has /keywords./ /if, //and, //else /are /keywords. /All keywords are all lower case. Keywords cannot be overridden by assignment. /Python has statements/./ /if // is a ///statement./So is /def. ///Some keywords are part of the structure of

Re: [Tutor] Print List

2012-09-12 Thread Oscar Benjamin
On Sep 12, 2012 4:53 PM, "Ashley Fowler" wrote: > > I am trying to complete the following below: > > > You also need to write a function "printList" of one parameter that > takes a list as its input and neatly prints the entire contents of the > list in a column. Each student in the list should be

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> You have again snipped the entire context so nobody has a clue what you're > replying to. > > Cheers. > > Mark Lawrence. My last post refers to a previous post by eryksun. If you can't look up and read it, that's cool, because you're the only one complaining. And to put it into context that yo

[Tutor] Print List

2012-09-12 Thread Ashley Fowler
I am trying to complete the following below: You also need to write a function "printList" of one parameter that takes a list as its input and neatly prints the entire contents of the list in a column. Each student in the list should be printed using __str__. So far i have: def printList(lis

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
My OS is Windows XP. I have Python 2.7.3(32 bit). My question is are there any commands in Python which directly allow me to produce a pure note of a given frequency, given volume and given duration. Further can we access the different sound channels(sound card) available through Python. -- regar

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 13:43, Dwight Hutto wrote: Also, you try eryksun's solution/example, pyaudio, as well, since it's a mpdule, using different forms for cross compatibility. You have again snipped the entire context so nobody has a clue what you're replying to. -- Cheers. Mark Lawrence. __

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Also, you try eryksun's solution/example, pyaudio, as well, since it's a mpdule, using different forms for cross compatibility. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] convert ascii to binary

2012-09-12 Thread Steven D'Aprano
On 12/09/12 21:20, Aaron Pilgrim wrote: Hello, I am trying to write a small program that converts ascii to binary. Can you explain what you mean by "ascii to binary"? Any of these could be described that way: 'hello world' => '68656c6c6f20776f726c64' => 'begin 666 \n+:&5L;&\\@=V]R;&0 \n \nen

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Please hit reply to all when responding. You should be able to type in 'sudo apt-get install speaker-test' or 'yum speaker-test' wrote: > This is what I got > import os os.system("speaker-test"+"--frequency 2000"+"--period 5000"+"--test sine") It should look like this: import

Re: [Tutor] convert ascii to binary

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 7:20 AM, Aaron Pilgrim wrote: > Hello, > I am trying to write a small program that converts ascii to binary. > > I tried using the python reference library section 18.8 but had > trouble understanding how to make it work. > > Here is the code I am currently trying to use:

Re: [Tutor] convert ascii to binary

2012-09-12 Thread Dave Angel
On 09/12/2012 07:20 AM, Aaron Pilgrim wrote: > Hello, > I am trying to write a small program that converts ascii to binary. > > I tried using the python reference library section 18.8 but had > trouble understanding how to make it work. If you supplied a link, we might be able to figure out what s

Re: [Tutor] convert ascii to binary

2012-09-12 Thread Dave Angel
On 09/12/2012 07:54 AM, Joel Goldstick wrote: > > A couple of thoughts. The section you reference suggests using higher > level modules such as uu. > uu seems to want to read an ascii file and write a uu encoded file. > > I just read the wikipedia article on uuencoding, since I have heard of > i

Re: [Tutor] convert ascii to binary

2012-09-12 Thread Joel Goldstick
On Wed, Sep 12, 2012 at 7:20 AM, Aaron Pilgrim wrote: > Hello, > I am trying to write a small program that converts ascii to binary. > > I tried using the python reference library section 18.8 but had > trouble understanding how to make it work. > > Here is the code I am currently trying to use:

[Tutor] convert ascii to binary

2012-09-12 Thread Aaron Pilgrim
Hello, I am trying to write a small program that converts ascii to binary. I tried using the python reference library section 18.8 but had trouble understanding how to make it work. Here is the code I am currently trying to use: def main(): import binascii myWord = input("E

Re: [Tutor] Musical note on python

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 4:49 AM, Dwight Hutto wrote: > > pyaudio is compatible with python 3.0(just in case the OP has that > version, and it doesn't look like on the main site it has it listed, > nor if it's 64 bit, etc. I'm surprised they don't have an official Python 3 port yet. I see now the

Re: [Tutor] How to print a variable from an if/else statement

2012-09-12 Thread Joel Goldstick
Following up on my earlier reply, ( I let the 'If' slip). Python statements are ALL lowercase. Case matters in python, so If is not if, Print is not print, Else is not else. -- Joel Goldstick ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

[Tutor] How to print a variable from an if/else statement

2012-09-12 Thread Joaquim Santos
> > > > Message: 3 > Date: Wed, 12 Sep 2012 09:32:38 + > From: chrisbv...@gmail.com > To: tutor@python.org > Subject: [Tutor] How to print a variable from an if/else statement > Message-ID: > <2057338575-1347442886-cardhu_decombobulator_blackberry.rim.net- > 2019341514-@b3.c12.bise6.bla

Re: [Tutor] How to print a variable from an if/else statement

2012-09-12 Thread Joel Goldstick
On Wed, Sep 12, 2012 at 5:32 AM, wrote: > Hello, > > I'm very new thanks in advance for your help. > > My If statement is: > > If age < (40): this will work, but python doesn't need the parentheses around the second argument. You can use it to make the logic more clear, but for a single term it

[Tutor] How to print a variable from an if/else statement

2012-09-12 Thread chrisbva81
Hello, I'm very new thanks in advance for your help. My If statement is: If age < (40): Print("you are young.") Else: Print("You look great.") Basically what I want to do is have a sentence using print that includes the results of the If or Else which is based on the users input of age.

Re: [Tutor] Musical note on python

2012-09-12 Thread Joel Goldstick
On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: > On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: >> >> How to produce a musical note of given frequency,volume and duration in >> Python. I've not tried it, but I have seen several references to a game making framework called pygame.

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 4:04 AM, Mark Lawrence wrote: > On 12/09/2012 08:47, Dwight Hutto wrote: >> >> So the following would be the script, except the ability to change >> specific values such as frequency with a scroll widget. >> >> import os >> >> #Variables for system call >> >> command_line_a

Re: [Tutor] Musical note on python

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 1:17 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > How to produce a musical note of given frequency,volume and duration in > Python. Do you just want a sinusoidal, pure tone, or do you need a more complex waveform? For a pure tone you can use math.sin(2 * math.pi * f * dt * n)

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 08:47, Dwight Hutto wrote: So the following would be the script, except the ability to change specific values such as frequency with a scroll widget. import os #Variables for system call command_line_app_for sound = "speaker-test" frequency = " --frequency 2000" length_of_sound_

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 08:41, Dwight Hutto wrote: Where have you forgotten to mention Ubuntu? "I'm sure...", the OP has specifically said "in Python", which implies to me using a Python package or module, hence my question above. Well, I was assuming he would write a command line app like so: Python

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
So the following would be the script, except the ability to change specific values such as frequency with a scroll widget. import os #Variables for system call command_line_app_for sound = "speaker-test" frequency = " --frequency 2000" length_of_sound_ms = " --period 5000" test_type = " --test

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> Where have you forgotten to mention Ubuntu? "I'm sure...", the OP has > specifically said "in Python", which implies to me using a Python package or > module, hence my question above. > Well, I was assuming he would write a command line app like so: Python 2.7.3 (default, Aug 1 2012, 05:16:0

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 07:57, Dwight Hutto wrote: On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: How to produce a musical note of given frequency,volume and duration in Python. __**_ Tutor mail