just read the ne stuuf. i went to DIP right after work anf found in
nice intro to unittest. not to bad (i thinK) now that I can see it work)
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
> Hmm, I believe you are right. I can't see any straight-forward
tutorials
> which use Python. I found a tutorial at onlamp.com, but it doesn't
seem to
> me to explain TDD at all clearly.
Mark Pilgrim's 'Dive Into Python' (http://diveintopython.org/) has a
couple of chapters
Duncan Booth wrote:
fred.dixon wrote:
:) unit test is something on my to-learn list. seems involved and i
haven't seen any straight forward tutorials yet. as yet i still
consider myself a hobbyist at best.
Hmm, I believe you are right. I can't see any straight-forward tutorials
which use Python.
fred.dixon wrote:
>:) unit test is something on my to-learn list. seems involved and i
> haven't seen any straight forward tutorials yet. as yet i still
> consider myself a hobbyist at best.
>
Hmm, I believe you are right. I can't see any straight-forward tutorials
which use Python. I found a t
"fred.dixon" <[EMAIL PROTECTED]> writes:
> :) unit test is something on my to-learn list. seems involved and i
> haven't seen any straight forward tutorials yet. as yet i still
> consider myself a hobbyist at best.
I would recommend "Test Driven Development" by Kent Beck
(Addison-Wesley).
Thoma
:) unit test is something on my to-learn list. seems involved and i
haven't seen any straight forward tutorials yet. as yet i still
consider myself a hobbyist at best.
--
http://mail.python.org/mailman/listinfo/python-list
fred.dixon wrote:
> when i am roughing out my functions and classes i out a pass statement
> as my first line just as a place holder and a convenient place to put a
> break when i am testing. no other good reason.
>
A better idea when roughing out functions and classes is to insert a
docstring
when i am roughing out my functions and classes i out a pass statement
as my first line just as a place holder and a convenient place to put a
break when i am testing. no other good reason.
--
http://mail.python.org/mailman/listinfo/python-list
fred.dixon wrote:
#global1.py
import global2
import global3
import sys
constant = 'dumb'
option = sys.argv[1:]
pass
#global2.func1()
a=global2.class1()
a.func1()
print newvar
#global2.py
import __main__
pass
class class1:
def func1(self):
__main__.newvar = "string"
pass
The othe
this is what i am using to test with.
my program is not much more involved just longer
and with a GUI.
I did test it and everything works, just wondered if there was
something evil and bad about importing main.
#
#global1.py
import global2
import glo
fred.dixon wrote:
ok I'm sorry, I'm not sure what your doing there.
if i have to guess it looks like yo might me modifying the imported
modules dict with another dict.
Yes, this takes all the atrributes of the options object and sets them
as attributes of the module. If you're afraid of __dict__,
it seems that i can import __main__ where i set the global and then
access the var from my local func.
is ther any gotcha's involveld in this ?
--
http://mail.python.org/mailman/listinfo/python-list
ok I'm sorry, I'm not sure what your doing there.
if i have to guess it looks like yo might me modifying the imported
modules dict with another dict.
isn't there a way i can just assign to a var and have it seen no matter
what part of the code is currently executing ?
--
http://mail.python.org/m
fred.dixon wrote:
how would i use the following if OPTIONS was in a module ?
---
from optparse import OptionParser
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
parser.add_option("-d", "--debug", ction="store_true", dest="verbose")
(OPTIONS = parser.parse_arg
how would i use the following if OPTIONS was in a module ?
---
from optparse import OptionParser
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
parser.add_option("-d", "--debug", ction="store_true", dest="verbose")
(OPTIONS = parser.parse_args()
ps
Im not a
fred.dixon wrote:
I want to use OPTIONS as a global var.
In this particular case I am trying to set a global debug constant so I
can have some debug logging happen when my program is run with a
-debug option.
what will actuall end up in OPTIONS is OPTIONS.debug = True as i am
using optparse module.
I want to use OPTIONS as a global var.
In this particular case I am trying to set a global debug constant so I
can have some debug logging happen when my program is run with a
-debug option.
what will actuall end up in OPTIONS is OPTIONS.debug = True as i am
using optparse module.
--
http://mail.
fred.dixon wrote:
i have read the book and searched the group too
--
im not gettin it.
i want to read a global (OPTIONS) from file1 from a class method
(func1) in file2
i want to understand how this works.
--
#f
i have read the book and searched the group too
--
im not gettin it.
i want to read a global (OPTIONS) from file1 from a class method
(func1) in file2
i want to understand how this works.
--
#file1.py
import f
19 matches
Mail list logo