Re: [Tutor] TESTING

2018-11-02 Thread Alan Gauld via Tutor
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

Re: [Tutor] TESTING

2018-11-02 Thread Avi Gross
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 > >

Re: [Tutor] TESTING

2018-11-01 Thread Mats Wichmann
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

Re: [Tutor] TESTING

2018-11-01 Thread Mario Radomirovic
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

Re: [Tutor] TESTING

2018-11-01 Thread Alan Gauld via Tutor
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

Re: [Tutor] TESTING

2018-11-01 Thread Ian Clark
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:

[Tutor] TESTING

2018-11-01 Thread richard mwenya via Tutor
Hello. Everyone is quiet or is it my email thats not working? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing

2018-01-07 Thread Steven D'Aprano
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

Re: [Tutor] Testing

2018-01-07 Thread boB Stepp
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

[Tutor] Testing

2018-01-07 Thread Steven D'Aprano
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? -- Steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscript

Re: [Tutor] More tutor testing required

2017-12-08 Thread Alan Gauld via Tutor
On 05/12/17 16:02, Alan Gauld via Tutor wrote: > address the issues raised and the latest incarnation > should work (although not well with Opera for some reason!) I think I've now got scrolling to work on iOS/Safari and Opera almost works... (a slight glitch when the width is within a particular

Re: [Tutor] More tutor testing required

2017-12-06 Thread Alan Gauld via Tutor
On 05/12/17 16:02, Alan Gauld via Tutor wrote: > address the issues raised and the latest incarnation > should work (although not well with Opera for some reason!) Now better with Opera, although the contents panel is still not quite right on small screens. Still looking for feedback from iOS de

[Tutor] More tutor testing required

2017-12-05 Thread Alan Gauld via Tutor
Folks, A couple of weeks ago I asked for testers for my web tutor. Many thanks to those who helped out. I've now tried to address the issues raised and the latest incarnation should work (although not well with Opera for some reason!) As before I am particularly needful of feedback from Apple use

Re: [Tutor] Testing print

2016-10-02 Thread Alan Gauld via Tutor
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

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-10-01 Thread Alan Gauld via Tutor
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. >

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-10-01 Thread Alan Gauld via Tutor
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 >> >>

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-10-01 Thread Alan Gauld via Tutor
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

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
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: >

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
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

Re: [Tutor] Testing print

2016-09-30 Thread Steven D'Aprano
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

[Tutor] Testing print

2016-09-29 Thread boB Stepp
Testing output of print functions (Py 3). First off, is it worth it to do so? 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. For example, in an earlier thread ( Questions as to how to run the same unit test m

[Tutor] Testing tutor list server

2016-09-20 Thread Alan Gauld via Tutor
Just checkin' -- 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 - Tutor@python.org To

[Tutor] testing, please disregard

2015-08-18 Thread Tim Johnson
I have had some problems with another python.org ML. I am sending this to see if it is received. Please disregard. thanks -- Tim http://www.akwebsoft.com, http://www.tj49.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Testing a string to see if it contains a substring (dw)

2015-01-23 Thread Mark Lawrence
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

Re: [Tutor] Testing a string to see if it contains a substring (Steve and Mark)

2015-01-23 Thread Mark Lawrence
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

Re: [Tutor] Testing a string to see if it contains a substring (dw)

2015-01-23 Thread dw
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

Re: [Tutor] Testing a string to see if it contains a substring (Steve and Mark)

2015-01-23 Thread dw
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

Re: [Tutor] Testing a string to see if it contains a substring

2015-01-21 Thread Mark Lawrence
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

Re: [Tutor] Testing a string to see if it contains a substring

2015-01-21 Thread Danny Yoo
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

Re: [Tutor] Testing a string to see if it contains a substring

2015-01-21 Thread Steven D'Aprano
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

Re: [Tutor] Testing a string to see if it contains a substring

2015-01-21 Thread Alan Gauld
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 (

[Tutor] Testing a string to see if it contains a substring

2015-01-21 Thread dw
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 PM17,431,230 DEV-ALL-01-25-2

Re: [Tutor] Testing a method in a class with nosetests

2013-04-21 Thread eryksun
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

Re: [Tutor] Testing a method in a class with nosetests

2013-04-21 Thread Steven D'Aprano
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

Re: [Tutor] Testing a method in a class with nosetests (Alex Baker)

2013-04-21 Thread Alex Baker
u) Python modules in a systematic way. On the other hand, if you're looking for a syllabus of studying languages (plural), consider     1) a dynamic language     2) a compile one     3) an assembler     4) other    (lisp, Forth, ML, Prolog, ...) Each category is enough different that you hav

[Tutor] Testing a method in a class with nosetests

2013-04-21 Thread Alex Baker
Hello, I've been lurking tutor for the last couple months and have quite enjoyed it! I'm having a problem testing a method using nosetests. The assignment (Learn Python the Hard Way) asks that I write tests for a package using assert_equal and assert_raises. I've conquered the assert_equals but

Re: [Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
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

Re: [Tutor] Testing dymamically created methods

2012-01-10 Thread Walter Prins
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

[Tutor] Testing dymamically created methods

2012-01-10 Thread Thomas Maier
Hi all, I would like to use some existing tool like py.test or nose to run my tests, but I failed to do so. The problem is as follow. I have tests: ### test_methods.py ### def test_one(): assert 1 == 1 def test_two(): assert 1 == 1 # I have abstraction layer that keeps info

[Tutor] Testing, please ignore

2011-08-13 Thread Alan Gauld
Testing from new Ubuntu install... problems with Thunderbird settings... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pytho

Re: [Tutor] Testing for empty list

2009-10-19 Thread Alan Gauld
"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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Rich Lovely
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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Katt
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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Stefan Behnel
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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
- 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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Dave Angel
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*

Re: [Tutor] Testing for empty list

2009-10-19 Thread Luke Paireepinart
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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Alan Gauld
"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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Andre Engels
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

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
if not mylist: ... do something ... T Original-Nachricht > Datum: Sun, 18 Oct 2009 20:29:53 -0500 > Von: Wayne > An: "tutor@python.org" > Betreff: [Tutor] Testing for empty list > Hi, I think I recall seeing this here, but I wanted to make sure I'm

Re: [Tutor] Testing for empty list

2009-10-18 Thread शंतनू
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

Re: [Tutor] Testing for empty list

2009-10-18 Thread vince spicer
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 > >

[Tutor] Testing for empty list

2009-10-18 Thread Wayne
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 -- To be considered stupid and to be told so is more painful than being

Re: [Tutor] testing framework

2009-04-29 Thread Eike Welk
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

Re: [Tutor] Testing Frameworks and Organizations

2009-04-23 Thread Eike Welk
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

Re: [Tutor] testing framework

2009-04-23 Thread Alan Gauld
"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

Re: [Tutor] testing framework

2009-04-23 Thread Kent Johnson
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

Re: [Tutor] testing framework

2009-04-23 Thread Oxymoron
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

[Tutor] testing framework

2009-04-23 Thread spir
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. doctest looks great. The issue is it seems based on command line-like testing: """ This is the "example" module. The example module supplies one f

[Tutor] Testing 321

2008-04-01 Thread Evans Anyokwu
Please ignore, switching email address. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing the status of NFS mounts

2007-01-04 Thread Kent Johnson
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

[Tutor] Testing the status of NFS mounts

2007-01-04 Thread Andrew Robert
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 status? I imagine I could make a script to

Re: [Tutor] testing u=unicode(str, 'utf-8') and u = str.decode('utf-8')

2006-04-06 Thread Kent Johnson
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

[Tutor] testing u=unicode(str, 'utf-8') and u = str.decode('utf-8')

2006-04-05 Thread Keo Sophon
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.decode('utf-8') are the same. How about the pr

Re: [Tutor] testing: doctest and unittest

2005-11-11 Thread Kent Johnson
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

Re: [Tutor] Testing for gui

2005-11-09 Thread Danny Yoo
> 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

Re: [Tutor] Testing for gui

2005-11-09 Thread Ken Stevens
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

Re: [Tutor] Testing for gui

2005-11-09 Thread Alan Gauld
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

Re: [Tutor] Testing for gui

2005-11-09 Thread Alan Gauld
> 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 __

Re: [Tutor] testing: doctest and unittest

2005-11-08 Thread Kent Johnson
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

Re: [Tutor] Testing for gui

2005-11-08 Thread John Fouhy
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

Re: [Tutor] Testing for gui

2005-11-08 Thread Liam Clarke-Hutchinson
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

Re: [Tutor] Testing for gui

2005-11-08 Thread Liam Clarke-Hutchinson
day, 9 November 2005 1:12 p.m. To: tutor@python.org Subject: [Tutor] Testing for gui How does one test for a running gui in python? Thanks, Ken -- A journey of a thousand miles starts under one's feet. -- Lao Tsu ___ Tutor mail

[Tutor] Testing for gui

2005-11-08 Thread Ken Stevens
How does one test for a running gui in python? Thanks, Ken -- A journey of a thousand miles starts under one's feet. -- Lao Tsu ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] testing: doctest and unittest

2005-11-08 Thread Alex Hunsley
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

Re: [Tutor] testing: doctest and unittest

2005-11-08 Thread Colin J. Williams
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.

[Tutor] testing: doctest and unittest

2005-11-08 Thread Alex Hunsley
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. It seems to me that doctes

Re: [Tutor] testing for modules?

2005-10-25 Thread Frank Moore
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. _

Re: [Tutor] testing for modules?

2005-10-25 Thread Shitiz Bansal
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

Re: [Tutor] testing for modules?

2005-10-24 Thread Bill Burns
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

Re: [Tutor] testing for modules?

2005-10-24 Thread Kent Johnson
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

[Tutor] testing for modules?

2005-10-24 Thread Ed Hotchkiss
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 indicate whether or not it is in

Re: [Tutor] Testing for commandline args

2005-05-17 Thread Cedric BRINER
> 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

Re: [Tutor] Testing for commandline args

2005-05-13 Thread Danny Yoo
> > 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,

Re: [Tutor] Testing for commandline args

2005-05-13 Thread Max Noel
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

[Tutor] Testing for commandline args

2005-05-13 Thread William O'Higgins
I am writing a tiny commandline utility (re-writing it from Perl) and I want the behaviour to change based on the presence of arguments. The conditional in Perl looks like this: if (defined $ARGV[0]) { do stuff } else { do different stuff In Python I've nearly been successful, but someth

[Tutor] Testing

2005-01-18 Thread james . homme
Hi, I have not been getting mail, so I thought I'd see what's up. Thanks. Jim James D Homme, Information Design + Development Highmark Inc. [EMAIL PROTECTED] 412-544-0527 "A gentle answer turns away wrath, but a harsh word stirs up anger." ___ Tu