Discussion:
[Tutor] Tutor Digest, Vol 135, Issue 12
Siya 360
2015-05-05 07:17:52 UTC
Permalink
Hi,

Twice i unsubscribed to this mailing list, and i still continue to get them, why?

Please remove with immediate effect as this course has not served me well too many of my enquires went unanswered so i see no use for it, just flooding my mailbox

Kind Regards,
Siya
Send Tutor mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."
1. Re: Sieve of Erastthotenes without sofisticated tools (Dave Angel)
2. Re: trouble with stringio function in python 3.2 (eryksun)
3. Jacob Kaplan-Moss's keynote at PyCon 2015 (Danny Yoo)
4. Integrating TDD into my current project work-flows (WolfRage)
5. Re: Integrating TDD into my current project work-flows
(Martin A. Brown)
6. Re: Python program malfunction (Jag Sherrington)
----------------------------------------------------------------------
Message: 1
Date: Mon, 04 May 2015 06:00:24 -0400
Subject: Re: [Tutor] Sieve of Erastthotenes without sofisticated tools
Content-Type: text/plain; charset=windows-1252; format=flowed
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 hung, or crashed the OS, or ran out of memory, say so.
I tried and tried
But I'm very isolated and It's hard without consultation with a tutor
<code>from math import sqrt
bigList = [False, False] + [True]*100
print("line 4 - bigList : ", bigList)
print("line 6 - num : ", num)
What did you expect this to do? What is bigList[2] ? What is
bigList[int(sqrt(num)) + 1] ? Are these reasonable values to put into a
range() function?
print("line 8 x : %d"%x)
print("line 10 {0} divise par {1} = {2} ".format(num, x, num/x))
bigList[num] == False
print "bigList[{0} == {1}]".format(num, bigList[num])
bigList[num] == True
bigList[multiple] = False
return(bigList)
print("the last result of bigList {} ".format(holeofStrainer()))</code>
I WANT TO KNOW WHILE THE EXECUTION DO NOT GOING DOWNWARD
--
_______________________________________________
https://mail.python.org/mailman/listinfo/tutor
--
DaveA
------------------------------
Message: 2
Date: Mon, 4 May 2015 09:58:05 -0500
Subject: Re: [Tutor] trouble with stringio function in python 3.2
Content-Type: text/plain; charset=UTF-8
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
ur'abc'
File "<stdin>", line 1
ur'abc'
^
SyntaxError: invalid syntax
------------------------------
Message: 3
Date: Mon, 4 May 2015 10:03:31 -0700
Subject: [Tutor] Jacob Kaplan-Moss's keynote at PyCon 2015
Content-Type: text/plain; charset=UTF-8
Apologies: this is somewhat off-topic, but I thought it might resonate


Both express the experience of being a programmer, on the dangers of
thinking of programming skill as some kind of bi-modal thing. A key
point in both their talks, I think, is that almost all of us aren't
born natural programmers. It's a skill. We stumble, we learn, and we
can get better at it.
I hope that's an encouraging thought.
------------------------------
Message: 4
Date: Mon, 04 May 2015 15:04:31 -0400
Subject: [Tutor] Integrating TDD into my current project work-flows
Content-Type: text/plain; charset=utf-8; format=flowed
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).
Project > develop > Project > Project > __main__.py
tests > __main__.py
Project/develop/Project
as: Python3 -m Project
That currently works.
But executing my tests as: Python3 -m tests
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
do you consider that OK? Is there a better way?
I call it a hack because every testcase file will have to have this line
added to it in order to work.
I am also using coverage.py and it is good but seems to be testing the
coverage of my tests, which is not desired, how can I stop this
behaviour. Or is it really OK.
python3 -m tests
Ran Main.
.
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
Name Stmts Miss Cover Missing
--------------------------------------------------
Project/Project 3 0 100%
tests/test_Project 8 0 100%
--------------------------------------------------
TOTAL 11 0 100%
{FileName = __main__.py}
# -*- coding: utf-8 -*-
import coverage
import unittest
cov = coverage.coverage()
cov.start()
# .. call your code ..
from .test_Project import ProjectTestCase # lint:ok
unittest.main(exit=False)
cov.stop()
cov.save()
import sys
cov.report(file=sys.stdout)
{FileName = test_Project.py}
# -*- coding: utf-8 -*-
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from Project import Project
self.assertTrue(Project.main())
{FileName = __main__.py}
# -*- coding: utf-8 -*-
from . import Project
Project.main()
{FileName = Project.py}
# -*- coding: utf-8 -*-
return True
------------------------------
Message: 5
Date: Mon, 4 May 2015 13:49:44 -0700
Subject: Re: [Tutor] Integrating TDD into my current project
work-flows
Content-Type: text/plain; charset=US-ASCII; format=flowed
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).
Project > develop > Project > Project > __main__.py
tests > __main__.py
Project/develop/Project
as: Python3 -m Project
That currently works.
But executing my tests as: Python3 -m tests
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
Yes, a bit ugly. Have you tried using nose? I have used a
similar project development tree and use nose to run the tests.
Here are a few sample command-lines (I'm on an opensuse-13.2 system
with Python 3.4 and nose for Python-3.4, which is called
nosetests-3.4 -- ./tests/
nosetests-3.4 --with-coverage -- ./tests/
nosetests-3.4 --with-coverage --cover-package=Project -- ./tests/
I like nose because it will discover any unittest and doctest
testing code under the specified files/directories.
do you consider that OK? Is there a better way?
I call it a hack because every testcase file will have to have
this line added to it in order to work.
Agreed, is a hack.
I am also using coverage.py and it is good but seems to be testing
the coverage of my tests, which is not desired, how can I stop
this behaviour. Or is it really OK.
That's precisely what coverage is supposed to do--that is it should
report on how much of the 'code under test' has been exercised by
the testing code. So, in fact, it's better than OK--it's the
primary point!
There are two good things about using coverage.
#1: You see how much more effort you should invest to get
substantial testing coverage of the code under test.
[Though, some code is easy to test and others very difficult.]
#2: You get a report of the lines in the code under test which are
NOT yet tested; handy!
Good luck,
-Martin
--
Martin A. Brown
http://linux-ip.net/
------------------------------
Message: 6
Date: Mon, 4 May 2015 23:08:13 +0000 (UTC)
Subject: Re: [Tutor] Python program malfunction
Content-Type: text/plain; charset=UTF-8
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
BraveArt Multimedia
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 cost unless you do a negative cost first.
Even after you have entered a negative cost and got the results of your positive cost it asks wether you want to do another item if you type "y" you still can't enter a positive amount.
#This program calculates retail prices.
mark_up = 2.5? # The mark up percentage.
another = 'y'? # Variable to control the loop.
# Process one or more items.
That's the same test twice. Is that what you meant?
? ? ? #Get the item 's wholesale cost'
? ? ? wholesale = float(input("Enter the item's wholesale cost: "))
? ? ? # Validate the wholesale cost.
? ? ? ? ? print('ERROR: the cost cannot be negative.')
? ? ? ? ? wholesale = float(input('Enter the correct wholesale cost: '))
? ? ? ? ? #Calculate the retail price.
? ? ? ? ? retail = wholesale * mark_up
? ? ? ? ? #Display the retail price.
? ? ? ? ? print('Retail price: $', format(retail, ',.2f'), sep='')
? ? ? ? ? #Do this again.
? ? ? ? ? another = input('Do you have another item? ' + \
? ? ? ? ? ? ? ? ? ? ? ? ? '(Enter y for yes): ')
Enter the item's wholesale cost: 0.50
Enter the item's wholesale cost:? ? (THIS SEEMS TO BE A PROBLEM)
No problem, its exactly what your program tells it to do.
If the cost is >0 there is nothing else to do so it goes
round the loop a second time.
What did you expect it to do?
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
https://mail.python.org/mailman/listinfo/tutor
------------------------------
Subject: Digest Footer
_______________________________________________
https://mail.python.org/mailman/listinfo/tutor
------------------------------
End of Tutor Digest, Vol 135, Issue 12
**************************************
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Alan Gauld
2015-05-05 08:55:32 UTC
Permalink
Post by Siya 360
Twice i unsubscribed to this mailing list, and i still continue to get them, why?
I don't know. Are you doing it via the web page?
Post by Siya 360
Please remove with immediate effect
The web page is the only way to unsubscribe. Nobody else
on the list can unsubscribe you.
Post by Siya 360
as this course has not served me well too many of my enquires went unanswered
I only see 3 questions posted since the start of 2015, all were answered.

Although 2 of them appear to be Django specific and you were
advised to ask on the Django forum. This list is for questions
about the Python language.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Laura Creighton
2015-05-12 08:58:34 UTC
Permalink
Post by Alan Gauld
Post by Siya 360
Twice i unsubscribed to this mailing list, and i still continue to get them, why?
The web page is the only way to unsubscribe. Nobody else
on the list can unsubscribe you.
This is late. I've been away. Putting on my mailman hat now. :)

Actually, the people who are the owners of the list _can_ do this.
That's you and wescpy. But, of course, it's better to not cave in
to user requests to do this. I just wanted to let people know that
this is not a limitation of mailman 2.x in case they were in the
market for a mailing list.

However, I believe I know what is going on here. The original poster,
not cc'd on this list, was receiving his or her mail as a digest. And,
after you unsubscribe, mailman has to figure out what to do with the
digest that was in the process of being assembled for you. So digest
readers often get one, and in some odd circumstances 2 copies of
the digest they no longer want to receive.

However, it is easy to check if the account is still around if you
are a list admininstrator ... and that is often a good idea, because
people do get into trouble by unsubscribing a different account than
the one where they are receiving mail, with the perfectly reasonable
outcome that the mail keeps on coming.


Best,
Laura
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Loading...