[Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread anupama srinivas murthy
Hello, My python code needs to run on versions 2.7 to 3.4. To use stringio function as appropriate, the code i use is; if sys.version < '3': dictionary = io.StringIO(u"""\n""".join(english_words)) else: dictionary = io.StringIO("""\n""".join(english_words)) The co

[Tutor] Python program malfunction

2015-05-04 Thread Jag Sherrington
Hi, There appears to be a problem with this program. It is taken from the "Starting out with Python" book third edition. The problem is when the "validate the wholesale cost" is introduced. Without the validator the code works fine, but with it the code won't let you enter a positive wholesale co

[Tutor] Python Help

2015-05-04 Thread Grace Anne St Clair-Bates
I am trying to write a program that uses while and if loops, but my print statements are not going through and showing up when I run the module. I have tried numerous things and changed in the code and cannot for the life of me figure out why it won't print. If someone could help that would be amaz

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread Alan Gauld
On 04/05/15 06:03, anupama srinivas murthy wrote: Hello, My python code needs to run on versions 2.7 to 3.4. To use stringio function as appropriate, the code i use is; if sys.version < '3': dictionary = io.StringIO(u"""\n""".join(english_words)) else: diction

Re: [Tutor] Python program malfunction

2015-05-04 Thread Alan Gauld
On 04/05/15 05:26, Jag Sherrington wrote: Hi, There appears to be a problem with this program. It is taken from the "Starting out with Python" book third edition. The problem is when the "validate the wholesale cost" is introduced. Without the validator the code works fine, but with it the code

Re: [Tutor] Python program malfunction

2015-05-04 Thread Peter Otten
Jag Sherrington wrote: > Hi, > There appears to be a problem with this program. > It is taken from the "Starting out with Python" book third edition. > > The problem is when the "validate the wholesale cost" is introduced. > Without the validator the code works fine, but with it the code won't le

Re: [Tutor] Python Help

2015-05-04 Thread Peter Otten
Grace Anne St Clair-Bates wrote: > I am trying to write a program that uses while and if loops, but my print > statements are not going through and showing up when I run the module. I > have tried numerous things and changed in the code and cannot for the life > of me figure out why it won't print

Re: [Tutor] Python Help

2015-05-04 Thread Alan Gauld
On 04/05/15 06:00, Grace Anne St Clair-Bates wrote: I am trying to write a program that uses while and if loops, but my print statements are not going through and showing up when I run the module. I have tried numerous things and changed in the code and cannot for the life of me figure out why it

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread Chris Warrick
On Mon, May 4, 2015 at 7:03 AM, anupama srinivas murthy wrote: > Hello, > > My python code needs to run on versions 2.7 to 3.4. To use stringio > function as appropriate, the code i use is; > > if sys.version < '3': A better comparison to use would be if sys.version_info[0] == 2: It’s the stand

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread Peter Otten
anupama srinivas murthy wrote: > Hello, > > My python code needs to run on versions 2.7 to 3.4. To use stringio > function as appropriate, the code i use is; > > if sys.version < '3': > dictionary = io.StringIO(u"""\n""".join(english_words)) > else: > dictionary =

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread Peter Otten
Peter Otten wrote: > anupama srinivas murthy wrote: > >> Hello, >> >> My python code needs to run on versions 2.7 to 3.4. To use stringio >> function as appropriate, the code i use is; >> >> if sys.version < '3': >> dictionary = io.StringIO(u"""\n""".join(english_words)) >>

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread anupama srinivas murthy
> On May 4, 2015 2:17 AM, "anupama srinivas murthy" < > anupama.2312.bm...@gmail.com> wrote: > >> Hello, >> >> My python code needs to run on versions 2.7 to 3.4. To use stringio >> function as appropriate, the code i use is; >> >> if sys.version < '3': >> dictionary = io.StringIO(u"""\

[Tutor] Sieve of Erastthotenes without sofisticated tools

2015-05-04 Thread yvan moses Levy
My code is wrong! I tried and tried But I'm very isolated and It's hard without consultation with a tutor from math import sqrt def holeofStrainer(): bigList = [False, False] + [True]*100 print("line 4 - bigList : ", bigList) for num in range(2, 101): print("line 6 - num : ", num) for

Re: [Tutor] Sieve of Erastthotenes without sofisticated tools

2015-05-04 Thread Dave Angel
On 05/04/2015 03:19 AM, yvan moses Levy wrote: My code is wrong! You'd find it a lot easier to get responses if you'd say in what way the code is wrong. If you get an exception, show the full traceback. If you get printed results, show what you expected, and what you got instead. If it hu

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread eryksun
On Mon, May 4, 2015 at 2:46 AM, Chris Warrick wrote: > Python 3.0–3.2 do not support the u'' notation for Unicode strings, it > was restored in Python 3.3 to make it easier to write code compatible > with 2.x and 3.x Whoever restored this forgot about raw literals: >>> ur'abc' File "",

[Tutor] Jacob Kaplan-Moss's keynote at PyCon 2015

2015-05-04 Thread Danny Yoo
Apologies: this is somewhat off-topic, but I thought it might resonate with the audience here: https://www.youtube.com/watch?v=hIJdFxYlEKE It reminds me of Camille Fournier's talk back in 2014 at BangBangCon: https://www.youtube.com/watch?v=sc8sc-ELMhA Both express the experience of bei

[Tutor] Integrating TDD into my current project work-flows

2015-05-04 Thread WolfRage
I would like some help integrating TDD into my current projects. My chosen TDD framework is unittest from the standard library. My system details are: Linux Mint 17.1 64-bit, Python 3.4, bzr(for version control). My projects are structured like: Project > develop > Project > Project > __main__.

Re: [Tutor] Integrating TDD into my current project work-flows

2015-05-04 Thread Martin A. Brown
Hi there, I would like some help integrating TDD into my current projects. My chosen TDD framework is unittest from the standard library. My system details are: Linux Mint 17.1 64-bit, Python 3.4, bzr(for version control). My projects are structured like: Project > develop > Project > Proje

Re: [Tutor] Python program malfunction

2015-05-04 Thread Jag Sherrington
Hi, Alan> Enter the item's wholesale cost: 0.50 (AFTER THIS LINE PRINTS I HIT ENTER AND WOULD EXPECT THE NEXT LINE TO GIVE ME THE RESULT> Enter the item's wholesale cost:    "Retail price: $1.25"  INSTEAD WHEN I HIT ENTER I GET "Enter the item's wholesale cost: " AGAIN AND AGAIN Regards, Jag Bra

Re: [Tutor] Python program malfunction

2015-05-04 Thread Alan Gauld
On 05/05/15 00:08, Jag Sherrington wrote: Hi, Alan > Enter the item's wholesale cost: 0.50 (AFTER THIS LINE PRINTS I HIT ENTER AND WOULD EXPECT THE NEXT LINE TO GIVE ME THE RESULT But why would it? Your print code is all inside a loop that only runs if the price is negative. If you enter a posi

Re: [Tutor] Python program malfunction

2015-05-04 Thread Dave Angel
On 05/04/2015 07:08 PM, Jag Sherrington wrote: Hi, Alan> Please don't top-post. Enter your new message *after* whatever portion of the previous message you're quoting. I'm rearranging the portion of your message to conform to that standard. On Monday, 4 May 2015, 17:35, Alan Ga

Re: [Tutor] Sieve of Erastthotenes without sofisticated tools

2015-05-04 Thread Dave Angel
You accidentally sent your response to me instead of the list. The proper thing to do for nearly all messages is to respond to the list. The main exception for that is if you just want to leave a simple thank-you for a person, and nothing of interest to anyone else. From your email program, u