Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Ryan Waples
>>> >>> If you copy those files to a different device (one that has just been >>> scrubbed and reformatted), then copy them back and get different results >>> with your application, you've found your problem. >>> >>> -Bill >> >> Thanks for the insistence, I'll check this out. If you have any >>

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread Mark Lawrence
On 19/07/2012 06:41, wolfrage8...@gmail.com wrote: On Thu, Jul 19, 2012 at 12:16 AM, Dave Angel wrote: On 07/18/2012 05:07 PM, Jordan wrote: OK so I have been trying for a couple days now and I am throwing in the towel, Python 3 wins this one. I want to convert a string to binary and back a

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Steven D'Aprano
On Wed, Jul 18, 2012 at 04:33:20PM -0700, Ryan Waples wrote: > I've included 20 consecutive lines of input and output. Each of these > 5 'records' should have been selected and printed to the output file. I count only 19 lines. The first group has only three lines. See below. There is a blank l

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread wolfrage8...@gmail.com
On Thu, Jul 19, 2012 at 12:16 AM, Dave Angel wrote: > On 07/18/2012 05:07 PM, Jordan wrote: > > OK so I have been trying for a couple days now and I am throwing in the > > towel, Python 3 wins this one. > > I want to convert a string to binary and back again like in this > > question: Stack Over

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Ryan Waples
On Wed, Jul 18, 2012 at 8:23 PM, Lee Harr wrote: > >> grep ^TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT$> with no results > > How about: > grep TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT outfile > Just in case there is some non-printing character in there... There are many instances of that sequence of ch

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Ryan Waples
On Wed, Jul 18, 2012 at 8:04 PM, William R. Wing (Bill Wing) wrote: > On Jul 18, 2012, at 10:33 PM, Ryan Waples wrote: > >> Thanks for the replies, I'll try to address the questions raised and >> spur further conversation. >> >>> "those numbers (4GB and 64M lines) look suspiciously close to the fi

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Lee Harr
>   grep ^TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT$> with no results How about: grep TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT outfile Just in case there is some non-printing character in there... Beyond that ... my guess would be that you are either not readingthe file you think you are, or not writi

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread William R. Wing (Bill Wing)
On Jul 18, 2012, at 10:33 PM, Ryan Waples wrote: > Thanks for the replies, I'll try to address the questions raised and > spur further conversation. > >> "those numbers (4GB and 64M lines) look suspiciously close to the file and >> record pointer limits to a 32-bit file system. Are you sure you

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Ryan Waples
Thanks for the replies, I'll try to address the questions raised and spur further conversation. >"those numbers (4GB and 64M lines) look suspiciously close to the file and >record pointer limits to a 32-bit file system. Are you sure you aren't >bumping into wrap around issues of some sort?" My

Re: [Tutor] writing function changeColor

2012-07-18 Thread Lee Harr
> I learned python so that if I were to put in 0.9, it'd decrease red by 10%.> > The way this function needs to be written, -0.1 decreases red by 10% It sounds like you have something like ... def f1(color, redchange=0, bluechange=0, greenchange=0):    # some code here to make the changes    ret

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread William R. Wing (Bill Wing)
On Jul 18, 2012, at 7:33 PM, Ryan Waples wrote: > I'm seeing some unexpected output when I use a script (included at > end) to iterate over large text files. I am unsure of the source of > the unexpected output and any help would be much appreciated. > > Background > Python v 2.7.1 > Windows 7 3

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Abhishek Pratap
Hi Ryan One quick comment I dint get through all your code to figure out the fine details but my hunch is you might be having issues related to linux to dos EOF char. Could you check the total number of lines in your fastq# are same as read by a simple python file iterator. If not then it is

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Steven D'Aprano
On Wed, Jul 18, 2012 at 04:33:20PM -0700, Ryan Waples wrote: > I'm seeing some unexpected output when I use a script (included at > end) to iterate over large text files. I am unsure of the source of > the unexpected output and any help would be much appreciated. It may help if you can simplify y

[Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Ryan Waples
I'm seeing some unexpected output when I use a script (included at end) to iterate over large text files. I am unsure of the source of the unexpected output and any help would be much appreciated. Background Python v 2.7.1 Windows 7 32bit Reading and writing to an external USB hard drive Data fi

Re: [Tutor] writing function changeColor

2012-07-18 Thread Steven D'Aprano
On Wed, Jul 18, 2012 at 05:37:17PM -0400, Aditi Pai wrote: > Hey, > > Do you know how to take your post off the discussion board? Do you mean taking a previous post off the discussion list? You can't. Once a post has been made, you can't delete it. It is public knowledge, archived on a dozen d

Re: [Tutor] writing function changeColor

2012-07-18 Thread Steven D'Aprano
Coming back to your original question... On Wed, Jul 18, 2012 at 01:10:51PM -0400, Aditi Pai wrote: > Hello, > > I am trying to write a function changeColor for an assignment. Two things > that I am unsure about for this assignment are how to assign different > colors to integers so that, red wi

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread Steven D'Aprano
On Wed, Jul 18, 2012 at 10:22:43PM +, Prasad, Ramit wrote: > I forgot to say, that once you have the integer equivalents, > you can then convert that easily to binary using bin. > I used ast.literal_eval to convert from binary string > (as returned from bin) to number, but there might be bet

Re: [Tutor] writing function changeColor

2012-07-18 Thread Steven D'Aprano
On Wed, Jul 18, 2012 at 05:31:00PM -0400, Aditi Pai wrote: > Ramit told me not to "top post," and I looked it up and I think I am doing > that same thing again, so if I am let me know how to avoid that. This kind > of discussion board is something I haven't interacted with before. In your email pr

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread Prasad, Ramit
> > I think your basic problem is too much conversion because you do not > understand the types. A string is represented by a series of bytes > which are binary numbers. Do you understand the concept behind ASCII? > Each letter has a numeric representation that are sequential. > So the string 'abc

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread Dave Angel
On 07/18/2012 05:07 PM, Jordan wrote: > OK so I have been trying for a couple days now and I am throwing in the > towel, Python 3 wins this one. > I want to convert a string to binary and back again like in this > question: Stack Overflow: Convert Binary to ASCII and vice versa > (Python) >

Re: [Tutor] string to binary and back... Python 3

2012-07-18 Thread Prasad, Ramit
> OK so I have been trying for a couple days now and I am throwing in the > towel, Python 3 wins this one. > I want to convert a string to binary and back again like in this > question: Stack Overflow: Convert Binary to ASCII and vice versa > (Python) >

Re: [Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Hey, Do you know how to take your post off the discussion board? Devin is right! I was looking for links or online resources but people keep trying to help me, which is awesome, but I'd like to do my own research. Thanks!! On Wed, Jul 18, 2012 at 5:31 PM, Aditi Pai wrote: > Ramit told me not to

Re: [Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Ramit told me not to "top post," and I looked it up and I think I am doing that same thing again, so if I am let me know how to avoid that. This kind of discussion board is something I haven't interacted with before. Steven, thank you for trying to help me. I thought my response to Bob was complet

Re: [Tutor] writing function changeColor

2012-07-18 Thread Devin Jeanpierre
On Wed, Jul 18, 2012 at 3:20 PM, Aditi Pai wrote: > I am trying my best to learn and your attitude was not welcome. If you don't > want to answer my question, I understand. I'm doing research elsewhere too > and because I am new at this, my familiarity with key terms and search words > is also imp

[Tutor] string to binary and back... Python 3

2012-07-18 Thread Jordan
OK so I have been trying for a couple days now and I am throwing in the towel, Python 3 wins this one. I want to convert a string to binary and back again like in this question: Stack Overflow: Convert Binary to ASCII and vice versa (Python)

Re: [Tutor] writing function changeColor

2012-07-18 Thread Steven D'Aprano
Aditi Pai wrote: Emile, So far I have started with def changeColor(pict,scale,color): I was told to make different names for the float and integer (float = scale and color= integer) and then I kept everything else the same, just to test it out and see if that would work. So it looks like this

Re: [Tutor] writing function changeColor

2012-07-18 Thread Steven D'Aprano
Emile van Sebille wrote: On 7/18/2012 12:07 PM Aditi Pai said... Hey Emile! Thanks for the advice. I think maybe I should have combined the two parts of my email. The function is just called changeColor. I don't actually want to change the color as much as alter the color. I'm not sure there's

Re: [Tutor] writing function changeColor

2012-07-18 Thread Prasad, Ramit
Please do not top post. > I am trying my best to learn and your attitude was not welcome. If you don't > want to answer my question, I understand. I'm doing research elsewhere too and > because I am new at this, my familiarity with key terms and search words is > also improving, yet at a slower pa

Re: [Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Emile, So far I have started with def changeColor(pict,scale,color): I was told to make different names for the float and integer (float = scale and color= integer) and then I kept everything else the same, just to test it out and see if that would work. So it looks like this: def changeColor(

Re: [Tutor] writing function changeColor

2012-07-18 Thread Emile van Sebille
On 7/18/2012 12:07 PM Aditi Pai said... Hey Emile! Thanks for the advice. I think maybe I should have combined the two parts of my email. The function is just called changeColor. I don't actually want to change the color as much as alter the color. I'm not sure there's a difference... I'm wor

Re: [Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Dear Bob, I am trying my best to learn and your attitude was not welcome. If you don't want to answer my question, I understand. I'm doing research elsewhere too and because I am new at this, my familiarity with key terms and search words is also improving, yet at a slower pace. My goal is to find

Re: [Tutor] writing function changeColor

2012-07-18 Thread bob gailer
On 7/18/2012 1:10 PM, Aditi Pai wrote: Hello, I am trying to write a function changeColor for an assignment. Is this a class assignment or job-related? Point us to the assignment, Learn to ask meaningful questions. Otherwise you waste your time and ours. "assign different colors to integers s

Re: [Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Hey Emile! Thanks for the advice. I think maybe I should have combined the two parts of my email. The function is just called changeColor. I don't actually want to change the color as much as alter the color. I'm working off of this example: def decreaseRed(picture): for p in getPixels(picture): v

Re: [Tutor] writing function changeColor

2012-07-18 Thread Emile van Sebille
On 7/18/2012 10:10 AM Aditi Pai said... Hello, I am trying to write a function changeColor for an assignment. I'd look in the documentation of whatever it is you're trying to change the color of. It should be explained there how to set and change colors. You're going to end up with somethi

[Tutor] writing function changeColor

2012-07-18 Thread Aditi Pai
Hello, I am trying to write a function changeColor for an assignment. Two things that I am unsure about for this assignment are how to assign different colors to integers so that, red will be 1, blue will be 2, etc. Also, I learned python so that if I were to put in 0.9, it'd decrease red by 10%.

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Alexandre Zani
On Wed, Jul 18, 2012 at 7:44 AM, Steven D'Aprano wrote: > Alexandre Zani wrote: >> >> On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano >> wrote: >>> >>> Alexandre Zani wrote: >>> What you want to write is this: elif name == "John Cleese" or name == "Michael Palin": >>> >>> >>> elif

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Steven D'Aprano
Alexandre Zani wrote: On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano wrote: Alexandre Zani wrote: What you want to write is this: elif name == "John Cleese" or name == "Michael Palin": elif name in ("John Cleese", "Michael Palin"): is better. Better how? It's shorter, you don't ha

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Alexandre Zani
On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano wrote: > Alexandre Zani wrote: > >> What you want to write is this: >> >> elif name == "John Cleese" or name == "Michael Palin": > > > elif name in ("John Cleese", "Michael Palin"): > > is better. > > > -- > Steven > > >

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Steven D'Aprano
Alexandre Zani wrote: What you want to write is this: elif name == "John Cleese" or name == "Michael Palin": elif name in ("John Cleese", "Michael Palin"): is better. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub