I'm trying to write a string formatting demo, just for things like
%.4f, %.3e, and %.3g.
Here's what I have, but of course it doesn't work. What should the print
statement be?
x = raw_input("enter a float: ")
if x == "":
print "x will be the default 1234.56789"
Dick Moores said unto the world upon 2005-04-10 03:38:
I'm trying to write a string formatting demo, just for things like
%.4f, %.3e, and %.3g.
Here's what I have, but of course it doesn't work. What should the print
statement be?
x = raw_input("enter a float: ")
if x
Hello list,
Is it possible to change the width of an Entry widget -
or not? I am using Tkinter, GUI - and have an Entry widget that accepts a
number. I just don't want it to extend the width of the column. I have
tried width = - but get an error.
Maybe a text widget would be preferable
Brian van den Broek said unto the world upon 2005-04-10 03:58:
Dick Moores said unto the world upon 2005-04-10 03:38:
I'm trying to write a string formatting demo, just for things like
%.4f, %.3e, and %.3g.
Here's what I have, but of course it doesn't work. What should the
print statement be?
Brian van den Broek wrote at 01:09 4/10/2005:
Hi Dick,
why not replace th last line with the following 2:
print_value = ('%' + s ) %x
print "%f formatted with '%s' is %s" %(x, s, print_value)
HTH,
Brian vdB
Sorry, half asleep: I should also have said that I don't think it is
wise to call your user
Hello Brian
I think the source of your problem is that the second instance of
Wall_clock doesn't get deleted in the interval doctest. This is
critical, because the is_instanced attribute is reset by __del__.
> def interval(self, interval_name = None):
> '''
> >>> # print "Testing in
Joseph Quigley wrote on Fri, 08 Apr 2005 16:58:37 -0600:
> import is handy. But my questions are:
> is there a type of unimport or something to unload a module?
Things which are not used are cleaned up automatically at some point. What
would you like to do do that this mechanism doesn't provide?
-
I have apparent interference between doctests embedded in the
docstrings of different methods, and this interference also appears to
be influenced by seemingly irrelevant things such as whether the
module has a (non-doctest-containing) docstring or not.
I, and what hair I've not yet torn out, woul
John Ridley said unto the world upon 2005-04-10 10:05:
Hello Brian
I think the source of your problem is that the second instance of
Wall_clock doesn't get deleted in the interval doctest. This is
critical, because the is_instanced attribute is reset by __del__.
def interval(self, interval_name =
On Sun, 10 Apr 2005 18:07:48 +1000
"Diana Hawksworth" <[EMAIL PROTECTED]> wrote:
> Hello list,
>
> Is it possible to change the width of an Entry widget - or not? I am using
> Tkinter, GUI - and have an Entry widget that accepts a number. I just don't
> want it to extend the width of the colum
Lee Harr said unto the world upon 2005-04-10 10:21:
I have apparent interference between doctests embedded in the
docstrings of different methods, and this interference also appears to
be influenced by seemingly irrelevant things such as whether the
module has a (non-doctest-containing) docstring o
Joseph Quigley wrote:
> Well, I'm importing a custom module, and I can't loop back to the module
I imported (the modules are different modes of the program. Someone
suggested classes, but I have no idea how to use them.
I'm not sure I understand you, but it sounds like you have two versions of a
As John Ridley suggests, you have to balance creation and deletion of Wall_clock instances. But
unfortunately del wc does not necessarily call Wall_clock.__del__() immediately.
See below for more...
Brian van den Broek wrote:
def check_point(self, check_point_name = None):
'''Creates
Kent Johnson said unto the world upon 2005-04-10 15:11:
As John Ridley suggests, you have to balance creation and deletion of
Wall_clock instances. But unfortunately del wc does not necessarily call
Wall_clock.__del__() immediately.
Hi Kent and all,
OK, the delay between the statement del(wc) an
--- Brian van den Broek <[EMAIL PROTECTED]> wrote:
> But: it still leaves me wondering why removing either a) the one-line
> no-doctest-containing docstring of the Wall_clock class or b) the
> unreferenced Wall_clock.stop_interval method made my original test
> code pass without needing to effec
John Ridley said unto the world upon 2005-04-10 19:19:
--- Brian van den Broek <[EMAIL PROTECTED]> wrote:
But: it still leaves me wondering why removing either a) the one-line
no-doctest-containing docstring of the Wall_clock class or b) the
unreferenced Wall_clock.stop_interval method made my o
Brian van den Broek wrote:
[text and code snipped]
FWIW, I ran your code using python 2.3.4 on linux with the following
modifications, and it worked fine (no failing tests out of 9):
1- added 'from sets import Set as set' since set() isn't built in in 2.3
2- changed True back to False in the foll
Brian van den Broek wrote:
I've not fully grokked the doctest code (which I delved into after Lee
Harr suggested I do so), but I would have thought that each doctest
had its own copy of the Wall_clock class from copying globals. But
here, I surely have more work to do myself :-)
doctest makes a sha
Hi all,
A little while ago, when I tried to pick up Python, I ran into an
article that has a script to add up all numbers in a text file (email
message, for example). I want to use that script now, but I could not
find (recalled) the URL to the article. If you have a point, please
let me know. App
Quoting Kenny Li <[EMAIL PROTECTED]>:
> A little while ago, when I tried to pick up Python, I ran into an
> article that has a script to add up all numbers in a text file (email
> message, for example). I want to use that script now, but I could not
> find (recalled) the URL to the article. If you
Joseph Quigley gmail.com> writes:
> Well, I'm importing a custom module, and I can't loop back to the module I
> imported (the modules are different modes of the program. Someone suggested
> classes, but I have no idea how to use them.
So you have two modules which implement the same function
Thanks Michael. Your suggestions did the trick! I did mean to include my
code - but obviously did not do that. Appreciate your help. Diana
- Original Message -
From: "Michael Lange" <[EMAIL PROTECTED]>
To:
Sent: Monday, April 11, 2005 1:49 AM
Subject: Re: [Tutor] Entry widgets
> On Su
22 matches
Mail list logo