Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Andreas Perstinger
On 16.01.2013 01:23, Scurvy Scott wrote: > After playing with your example I keep being told that list has no > attribute int_to_note. I know what the problem is, I just don't know > how to fix it. [SNIP] > So right now my code is: > > import mingus.core.notes as notes

Re: [Tutor] text files

2013-01-15 Thread Dave Angel
On 01/15/2013 09:31 PM, Gina wrote: I have version 3 I am trying to read a text file ("the_file.txt") and then write a new file where the characters are in uppercase but i don't know how/where i should use the .upper I think i should use it where the ** is, but i got errors when i tried t

[Tutor] text files

2013-01-15 Thread Gina
I have version 3 I am trying to read a text file ("the_file.txt") and then write a new file where the characters are in uppercase but i don't know how/where i should use the .upper I think i should use it where the ** is, but i got errors when i tried that text_file = open("the_file.txt

[Tutor] reading from text files

2013-01-15 Thread Gina
I have version 3 I am trying to read a text file ("the_file.txt") and then write a new file where the characters are in uppercase but i don't know how/where i should use the .upper I think i should use it where the ** is, but i got errors when i tried that text_file = open("the_file.txt

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
>> So here I extract out of your code (untested!) a generator which produces >> an infinite series of Fibonacci numbers, one at a time: >> >> def fib(): >> >> a, b = 0, 1 >> while True: >> yield b >> >> a, b = b, a+b >> >> >> This is untested, I may have got it wrong. >> >>

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
On Tue, Jan 15, 2013 at 4:01 PM, Steven D'Aprano wrote: > On 16/01/13 10:40, Scurvy Scott wrote: > [...] > >> Anyways, the problem I'm having is I'm not really sure how to search a >> list >> for multiple elements and remove just those elements. Below is my code so >> far, and information y'all co

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:53, Scurvy Scott wrote: >> > Anyways, the problem I'm having is I'm not really sure how to search a list >> > for multiple elements and remove just those elements. Below is my code so >> > far, and information y'all could provide would be appreciated. Thanks. >> [SNIP] > > Wh

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Steven D'Aprano
On 16/01/13 10:40, Scurvy Scott wrote: [...] Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information y'all could provide would be appreciated. Thanks. Actually, your problem so far

Re: [Tutor] Assigning multi line value to a variable

2013-01-15 Thread Prasad, Ramit
Rohit Mediratta wrote: > > Hi, >    I am using Centos 6.3 and python 2.6.6. > > When I try to assign a variables value inside a multiple line message, it > does not work. > > >>>cardName = "ActualCardName" > >>>data = """ >     """ > >>> print data >   >     > > > I would like %car

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:40, Scurvy Scott wrote: [SNIP] > > Anyways, the problem I'm having is I'm not really sure how to search a list > for multiple elements and remove just those elements. Below is my code so > far, and information y'all could provide would be appreciated. Thanks. Perhaps you'd l

Re: [Tutor] Assigning multi line value to a variable

2013-01-15 Thread Steven D'Aprano
On 16/01/13 10:12, Rohit Mediratta wrote: Hi, I am using Centos 6.3 and python 2.6.6. When I try to assign a variables value inside a multiple line message, it does not work. cardName = "ActualCardName" data = """ """ print data I would like %cardName to be r

Re: [Tutor] Assigning multi line value to a variable

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:12, Rohit Mediratta wrote: > Hi, >I am using Centos 6.3 and python 2.6.6. > > When I try to assign a variables value inside a multiple line message, it > does not work. > cardName = "ActualCardName" data = """ > """ print data > > > > > I

[Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
Hello guys, I'm using Ubuntu 12.10 and Python 2.7 right now. I'm working on code using the Mingus module but this question isn't specific to this module, per se. What I'm trying to do is to generate the fibonacci numbers up to a given N and then do modulo 12 on each number in order to create a lis

[Tutor] Assigning multi line value to a variable

2013-01-15 Thread Rohit Mediratta
Hi, I am using Centos 6.3 and python 2.6.6. When I try to assign a variables value inside a multiple line message, it does not work. >>>cardName = "ActualCardName" >>>data = """ """ >>> print data I would like %cardName to be replaced by "actualCardName". As you can s

Re: [Tutor] new user question

2013-01-15 Thread Alan Gauld
On 13/01/13 16:10, Adel Afzal wrote: contains the text "dogs chase cats" contains the text "cats chase birds" contains the text "birds don't bother anyone" I'd like to know how to search the content of those three pages for the string "cats" in the text body. Look at the urllib modules in t

Re: [Tutor] UnicodeWarning: Comparing String

2013-01-15 Thread Prasad, Ramit
ialec...@gmail.com wrote: > Hi, > > I am trying to check if a Unicode string matches data from an Easygui > "enterbox". I spent one hour looking > online how to solve this problem and I'm still stuck because I don't > understand all of the explanations I find. > Lots of trial and error didn't he

[Tutor] UnicodeWarning: Comparing String

2013-01-15 Thread -
Hi, I am trying to check if a Unicode string matches data from an Easygui "enterbox". I spent one hour looking online how to solve this problem and I'm still stuck because I don't understand all of the explanations I find. Lots of trial and error didn't help either. I use Python 2.5.1. ===T

Re: [Tutor] How to run multiline shell command within python

2013-01-15 Thread Matty Sarro
Have you looked a the pexpect class? It works like gangbusters, especially if you're trying to run something with an interactive shell. http://www.noah.org/wiki/pexpect On Thu, Jan 10, 2013 at 9:25 AM, Karim wrote: > On 10/01/2013 09:31, Hugo Arts wrote: > > On Thu, Jan 10, 2013 at 7:01 AM, K

[Tutor] new user question

2013-01-15 Thread Adel Afzal
Hi, I am new to Python, and my interest in learning is to make a Python script that can do something like what I describe below. Could you please provide some advice, or direct me to some resources that may help me along in this process? Lets say there are three pages: http://bob.com/dogs