On 02/11/2018 03:45, Avi Gross wrote:
> I am not totally up on the exact purposes of this group but have noted how
> many of the questions asked have been frustrating.
Unfortunately that goes with the territory.
We are a list catering to beginners to Python and, frequently,
to programming. As a re
environment needed when you submit a
paper so it can be replicated!
Avi
-Original Message-
From: Tutor On Behalf Of
Mats Wichmann
Sent: Thursday, November 1, 2018 1:54 PM
To: tutor@python.org
Subject: Re: [Tutor] TESTING
On 11/1/18 11:24 AM, Mario Radomirovic wrote:
> All good
>
>
On 11/1/18 11:24 AM, Mario Radomirovic wrote:
> All good
>
> On Thu, 1 Nov 2018 6:17 pm Alan Gauld via Tutor wrote:
>
>> On 01/11/2018 14:01, richard mwenya via Tutor wrote:
>>> Hello.
>>> Everyone is quiet or is it my email thats not working?
>>
>> Just quiet, I've seen nothing in the moderator
All good
On Thu, 1 Nov 2018 6:17 pm Alan Gauld via Tutor wrote:
> On 01/11/2018 14:01, richard mwenya via Tutor wrote:
> > Hello.
> > Everyone is quiet or is it my email thats not working?
>
> Just quiet, I've seen nothing in the moderators queue
> for 5 days. But that happens sometimes.
>
> I g
On 01/11/2018 14:01, richard mwenya via Tutor wrote:
> Hello.
> Everyone is quiet or is it my email thats not working?
Just quiet, I've seen nothing in the moderators queue
for 5 days. But that happens sometimes.
I guess it just means nobody is having any Python issues
right now.
--
Alan G
Lis
Hello,
i'm seeing your message
On Thu, Nov 1, 2018 at 7:03 AM richard mwenya via Tutor
wrote:
> Hello.
> Everyone is quiet or is it my email thats not working?
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
On Mon, Jan 08, 2018 at 12:31:06AM +, Alan Gauld wrote:
> On 07/01/18 23:38, Steven D'Aprano wrote:
> > I've tried emailing in response to the os.path.realpath thread twice,
> > and neither email has made it through.
> >
> > Alan, am I stuck in the moderator queue for some reason?
>
> Nope, n
On Sun, Jan 7, 2018 at 5:38 PM, Steven D'Aprano wrote:
> I've tried emailing in response to the os.path.realpath thread twice,
> and neither email has made it through.
>
> Alan, am I stuck in the moderator queue for some reason?
This one made it through. My original answer to your post last nigh
On 02/10/16 02:46, boB Stepp wrote:
>> case. If I know that the result is always an int I can
>> use the first case if I know its always a tuple I can
>> use the second. But not knowing which is just plain
>> messy.
>
> So in which sorts of scenarios would you use argument unpacking?
Any time a
On Sat, Oct 1, 2016 at 7:19 PM, Alan Gauld via Tutor wrote:
> On 01/10/16 23:08, boB Stepp wrote:
>> On Sat, Oct 1, 2016 at 11:35 AM, Alan Gauld via Tutor
>> wrote:
>>
>>> ... Personally I don't like functions that
>>> sometimes return one and sometimes two results. I'd rather
>>> you returned a
On 01/10/16 23:08, boB Stepp wrote:
> On Sat, Oct 1, 2016 at 11:35 AM, Alan Gauld via Tutor
> wrote:
>
>> ... Personally I don't like functions that
>> sometimes return one and sometimes two results. I'd rather
>> you returned a None first argument in the first case
>> to make it consistent.
>
On Sat, Oct 1, 2016 at 11:35 AM, Alan Gauld via Tutor wrote:
> ... Personally I don't like functions that
> sometimes return one and sometimes two results. I'd rather
> you returned a None first argument in the first case
> to make it consistent.
Why don't you like doing this? What are the plus
On 01/10/16 16:12, boB Stepp wrote:
>>> This module will take a string and right justify it so that the last
>>> character
>>> of the line will fall in column 70 of the display. The results will be
>>> printed to stdout.'''
>>>
>> Do you need print_msgs()?
>> Won't it work the same with
>>
>>
On Sat, Oct 1, 2016 at 2:02 AM, Alan Gauld via Tutor wrote:
> Do you need print_msgs()?
> Won't it work the same with
>
>print(right_justify(input_string))
>
> You are only feeding one line at a time into the print msgs.
>
> You could do it all in a new print_msgs() like:
>
> def prin
On Sat, Oct 1, 2016 at 2:02 AM, Alan Gauld via Tutor wrote:
> On 01/10/16 05:24, boB Stepp wrote:
>
>> ===
>> '''Exerise 3.1 from "Think Python 2" by Allen Downey.
>>
>> This module will take a string and right justify it
On 01/10/16 05:24, boB Stepp wrote:
> ===
> '''Exerise 3.1 from "Think Python 2" by Allen Downey.
>
> This module will take a string and right justify it so that the last character
> of the line will fall in column 70 of
On Sat, Oct 1, 2016 at 12:12 AM, Richard Doksa wrote:
> unsubscibe please
If you wish to unsubscribe, go to the bottom of this page and follow
its instructions:
https://mail.python.org/mailman/listinfo/tutor
boB
___
Tutor maillist - Tutor@python.or
On Fri, Sep 30, 2016 at 5:07 AM, Steven D'Aprano wrote:
[snip]
> and preferably three:
>
> (1) function that does the calculation;
> (2) function that does the output;
> (3) function that calls (1) and then (2)
>
>
> If (1) and (2) are well-designed, then (3) is so trivial it needs no
> tests:
>
On Fri, Sep 30, 2016 at 5:07 AM, Steven D'Aprano wrote:
> On Thu, Sep 29, 2016 at 09:24:51PM -0500, boB Stepp wrote:
>> Second, it seems that prints are often intermingled with the main
>> logic of a function and only serve to pass on a message to the user.
>
> Yeah, you normally shouldn't do tha
On Thu, Sep 29, 2016 at 09:24:51PM -0500, boB Stepp wrote:
> Testing output of print functions (Py 3). First off, is it worth it to do so?
Unless you are writing tests for the Python language itself, you can
assume that print() itself is working.
You should test functions that call print: call
On 22/01/2015 15:40, dw wrote:
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
Using
On 22/01/2015 16:15, dw wrote:
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Thanks for the thanks, but please don't change the subject as it breaks
threading, making it more
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
For each iteration re.findall returns a lis
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Based on your description, I think the best way to do this is:
# remove blank lines
line_array = [line for line in line_array if l
On 21/01/2015 18:14, dw wrote:
Hello Python Friends.
I have a string array, called "line_array".
There may be up to 50 or more elements in the array.
So:
- line_array[1] may contain "01/04/2013 10:43 AM17,410,217
DEV-ALL-01-04-13.rlc\n"
- line_array[2] may contain "01/25/2013 03:21 PM
How large will your array be in production?
If it going to be very large, you may want to consider a database.
You're simulating a collection of records as an in-memory sequence of
flat strings. This design won't scale, so if you are working with a
lot of data, you may want to look into a dedicat
On Wed, Jan 21, 2015 at 10:14:42AM -0800, dw wrote:
> Hello Python Friends.
> I have a string array, called "line_array".
Do you mean a list of strings? "String array" is not a standard Python
term, it could mean something from the array module, from numpy, or
something completely different.
It
On 21/01/15 18:14, dw wrote:
- line_array[1] may contain "01/04/2013 10:43 AM17,410,217
DEV-ALL-01-04-13.rlc\n"
- line_array[2] may contain "01/25/2013 03:21 PM17,431,230
DEV-ALL-01-25-2013.rlc\n"
- line_array[3] may contain "\n"
I want to retain all elements which are valid (
On Sun, Apr 21, 2013 at 9:33 PM, Steven D'Aprano wrote:
>
> it's NOT because you failed to post plain text, since you actually did.
Actually it's a multipart message with both plain text and HTML, with
the digest quoted in each version. It helps that the HTML is using
" " and that map directly t
On 22/04/13 10:49, Alex Baker wrote:
Hello,
I've been lurking tutor for the last couple months and have quite enjoyed it!
Welcome, and congratulations on your first post! Unfortunately I have to start
with a complaint :-( but it's NOT because you failed to post plain text, since
you actually
Dang, forgot to send in plain text! Sorry...
Here is the GitHub link http://github.com/robotsmack/ex48
From: "tutor-requ...@python.org"
To: tutor@python.org
Sent: Sunday, April 21, 2013 6:51 PM
Subject: Tutor Digest, Vol 110, Issue 87
Send Tutor mailing li
On Tue, Jan 10, 2012 at 3:31 PM, Walter Prins wrote:
> Hi,
>
> On 10 January 2012 12:15, Thomas Maier wrote:
>> This code works without py.test or nosetests. For example if I use print
>> instead of 'assert'.
>> Both py.test and nosetests failed to execute this correctly.
>> Or maybe they do exec
Hi,
On 10 January 2012 12:15, Thomas Maier wrote:
> This code works without py.test or nosetests. For example if I use print
> instead of 'assert'.
> Both py.test and nosetests failed to execute this correctly.
> Or maybe they do execute it correctly, I just don't understand it..:)
> They both re
"Katt" wrote
Just a newbie question, but when would you test for an empty list?
When you are processing a list such that you are deleting items as you go.
When the list is empty stop processing!
And Python helps you do that by treating an empty list as a False
boolean value so you can do
2009/10/19 Katt
>
> Hello all,
>
> Just a newbie question, but when would you test for an empty list? Is it
> part of a code error detection or an error check to make sure that there is
> user input?
>
> Couldn't you just use something like:
>
> while len(mylist) > 0:
> continue program
> els
Wayne wrote:
Hi, I think I recall seeing this here, but I wanted to make sure I'm
correct.
Is the best way to test for an empty list just test for the truth value?
I.e.
mylist = [1,2,3]
while mylist:
print mylist.pop()
Thanks,
Wayne
My take is simple: Use the above form if you *know* th
Hi,
please don't top-post.
Todd Matsumoto wrote:
> I don't understand how the while loop efficiently tests if the list is
> empty.
It doesn't. It only tests a condition. And the result of the condition is
determined by the list itself, which knows if it's empty or not.
Stefan
- Original-Nachricht
> Datum: Mon, 19 Oct 2009 04:52:40 -0400
> Von: Dave Angel
> An: Wayne
> CC: "tutor@python.org"
> Betreff: Re: [Tutor] Testing for empty list
>
>
> Wayne wrote:
> > Hi, I think I recall seeing this here, but I wanted to make sur
Wayne wrote:
Hi, I think I recall seeing this here, but I wanted to make sure I'm
correct.
Is the best way to test for an empty list just test for the truth value?
I.e.
mylist = [1,2,3]
while mylist:
print mylist.pop()
Thanks,
Wayne
My take is simple: Use the above form if you *know*
On Mon, Oct 19, 2009 at 2:26 AM, Todd Matsumoto wrote:
> The while loop will print each index of the list.
No it's printing each element of the list, not the index.
> In a way it checks that if the list is empty by printing the items. As far
> as I know there isn't any 'True' or 'False' output
"Todd Matsumoto" wrote
The while loop will print each index of the list.
No, the while does nothing with list indexes, that is entirely
down to the programmer. The while loop simply repeats for
as long as its test expression evaluates to True.
As far as I know there isn't any 'True' or 'Fal
On Mon, Oct 19, 2009 at 3:29 AM, Wayne wrote:
> Hi, I think I recall seeing this here, but I wanted to make sure I'm
> correct.
> Is the best way to test for an empty list just test for the truth value?
> I.e.
> mylist = [1,2,3]
> while mylist:
> print mylist.pop()
Whether it is the 'best' way
The while loop will print each index of the list. In a way it checks that if
the list is empty by printing the items. As far as I know there isn't any
'True' or 'False' output from a list.
If you want to do something if mylist is empty you can check it like this:
if not mylist:
... do someth
On 19-Oct-09, at 7:11 AM, vince spicer wrote:
On Sun, Oct 18, 2009 at 7:29 PM, Wayne wrote:
Hi, I think I recall seeing this here, but I wanted to make sure I'm
correct.
Is the best way to test for an empty list just test for the truth
value? I.e.
mylist = [1,2,3]
while mylist:
p
On Sun, Oct 18, 2009 at 7:29 PM, Wayne wrote:
> Hi, I think I recall seeing this here, but I wanted to make sure I'm
> correct.
> Is the best way to test for an empty list just test for the truth value?
> I.e.
>
> mylist = [1,2,3]
>
> while mylist:
>print mylist.pop()
>
> Thanks,
> Wayne
>
>
Hello Spir!
On Thursday 23 April 2009, spir wrote:
> I would like to refactor tests of an application in a consistent
> form. I have a ton of tests for each module, but they are all ad
> hoc things. doctest looks great. The issue is it seems based on
> command line-like testing:
I have researched
Hello Spir; hello all!
I have a similar question:
For projects with multiple packages (directories) and modules (files);
where do you put your testcode, what framework do you use, and what
design patterns do you employ?
I currently work on a project with one package and several modules. I
us
"spir" wrote
My app is about parsing, which input and output usually both are big
and complicated *strings*. So that I find the command line model
really unappropriate for expressing test cases and their expected
results.
Any hint/pointer/comment welcome,
What about using command line red
On Thu, Apr 23, 2009 at 8:55 AM, spir wrote:
> Hello,
>
> I would like to refactor tests of an application in a consistent form. I have
> a ton of tests for each module, but they are all ad hoc things.
> My app is about parsing, which input and output usually both are big and
> complicated *str
Hello,
On Thu, Apr 23, 2009 at 10:55 PM, spir wrote:
>
> My app is about parsing, which input and output usually both are big and
> complicated *strings*. So that I find the command line model really
> unappropriate for expressing test cases and their expected results.
>
Interesting - haven't r
Andrew Robert wrote:
> Hi everyone,
>
> We have several NFS mounts that are in use.
>
> Occasionally, the NFS mounts seem to go out to lunch.
>
> The mounts appear active but are no longer functional.
>
> Is there a Python module specific to NFS that I might use to
> periodically check its sta
Keo Sophon wrote:
> Hi,
>
> Today i tested u=unicode(str,'utf-8') and u=str.decode('utf-8'). Then in both
> case I used:
>
> if isinstance(u,str):
>print "just string"
> else:
> print "unicode"
>
> the result of both case are "unicode". So it seems u=unicode(str,'utf-8') and
> u=str.deco
Kent Johnson wrote:
> Alex Hunsley wrote:
>>Where do you seasoned pythonites see unittest and doctest in relation to
>>each other? Do you only use one or the other?
>
>
> I think it is mostly personal preference. Doctest is nice where you
> create examples for others, maybe not so nice where you
> I haven't written any code yet, but I was thinking I would like to test
> for either a windows environment (Is an X-Server running) or is this a
> strictly console (no X-server) environment and then do the appropriate
> thing for each environment. I am not sure that is any clearer, but I
> hope i
On Wed, Nov 09, 2005 at 10:00:49PM -, Alan Gauld wrote:
> >How does one test for a running gui in python?
> >
>
> Can you be more specific? A GUI is a feature of a program.
> The GUI is part of the program - although a few programs
> can run in either GUI or Text mode, but they are the except
From: Ken Stevens [mailto:[EMAIL PROTECTED]
> Yes. Under Linux no x-server running? I guess it really wouldn't be
> applicable under a windows enviroment,
OK, I see what you wanted now, ignore my previous message
.
Note that X windows is a protocol and not a GUI.
There are several GUI environme
> How does one test for a running gui in python?
>
Can you be more specific? A GUI is a feature of a program.
The GUI is part of the program - although a few programs
can run in either GUI or Text mode, but they are the exception.
Can you give an example of what you want to test for?
Alan G
__
Alex Hunsley wrote:
> Regards testing, I've been playing with both the unittest
> (http://pyunit.sourceforge.net/pyunit.html) and doctest
> (http://docs.python.org/lib/module-doctest.html). I was wondering what
> peoples thoughts were on the effectiveness and convenience of one versus
> the oth
From: Ken Stevens [mailto:[EMAIL PROTECTED]
> Yes. Under Linux no x-server running? I guess it really wouldn't be
> applicable under a windows enviroment, although I would like my code
> to be transportable. Just under a MS windows enviroment it would
> always be a "gui" environment.
What happens
chinson
Subject: Re: [Tutor] Testing for gui
On Wed, Nov 09, 2005 at 01:16:03PM +1300, Liam Clarke-Hutchinson wrote:
>
> Hi Ken,
>
> How do you mean? I assume you're referring to a non-Windows
> environment? In Linux, I'd imagine that using os.popen("ps") wou
Hi Ken,
How do you mean? I assume you're referring to a non-Windows environment? In
Linux, I'd imagine that using os.popen("ps") would do it.
Cheers,
Liam
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Ken Stevens
Sent: Wednesday, 9 November 2005 1
Colin J. Williams wrote:
> Alex Hunsley wrote:
>
>> Regards testing, I've been playing with both the unittest
>> (http://pyunit.sourceforge.net/pyunit.html) and doctest
>> (http://docs.python.org/lib/module-doctest.html). I was wondering
>> what peoples thoughts were on the effectiveness and co
Alex Hunsley wrote:
>Regards testing, I've been playing with both the unittest
>(http://pyunit.sourceforge.net/pyunit.html) and doctest
>(http://docs.python.org/lib/module-doctest.html). I was wondering what
>peoples thoughts were on the effectiveness and convenience of one versus
>the other.
Shitiz Bansal wrote:
>try:
> import
>except:
>
> import
>
>
>--- Ed Hotchkiss <[EMAIL PROTECTED]> wrote:
>
>
>
Explicit is always better than implicit...
try:
import
except ImportError:# Only catch import errors
import
Cheers,
F.
_
try:
import
except:
import
--- Ed Hotchkiss <[EMAIL PROTECTED]> wrote:
> i have a generic script that is using several
> modules on windows and linux
> boxes. i need to have the scripts test if a module
> is installed, and then if
> not - then to install the module. can anyone give m
Ed Hotchkiss wrote:
> i have a generic script that is using several modules on windows and
> linux boxes. i need to have the scripts test if a module is installed,
> and then if not - then to install the module. can anyone give me a
> headsup on how to test for a module, returning something to i
Ed Hotchkiss wrote:
> i have a generic script that is using several modules on windows and
> linux boxes. i need to have the scripts test if a module is installed,
> and then if not - then to install the module. can anyone give me a
> headsup on how to test for a module, returning something to i
> Also, I hear that optparse is much better than getopt.
this is a true pleasure to work with optparse. It was included in python2.3 and
was primarly called python-optik
Ced.
--
Cedric BRINER
___
Tutor maillist - Tutor@python.org
http://mail.py
>
> If I have arguments, the "different stuff" happens beautifully, thank
> you very much. If I don't have arguments I get this:
>
> if sys.argv[1]:
> IndexError: list index out of range]
>
> So I'm doing something wrong. I looked at getopt, but that seemed to be
> doing what I was already doing,
On May 14, 2005, at 01:30, William O'Higgins wrote:
> if sys.argv[1]:
> do stuff
> else:
> do different stuff
>
> If I have arguments, the "different stuff" happens beautifully, thank
> you very much. If I don't have arguments I get this:
>
> if sys.argv[1]:
> IndexError: list index out
70 matches
Mail list logo