On Wed, Aug 3, 2011 at 12:10, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
>>> Richard D. Moores wrote:
>>>
I wrote before that I had pasted the function (convertPath()) from my
initial post into
On Wed, Aug 3, 2011 at 12:16, Steven D'Aprano wrote:
> Richard D. Moores wrote:
>>
>> I wrote before that I had pasted the function (convertPath()) from my
>> initial post into mycalc.py because I had accidentally deleted it from
>> mycalc.py. And that there was no problem importing it from mycalc
Richard D. Moores wrote:
I wrote before that I had pasted the function (convertPath()) from my
initial post into mycalc.py because I had accidentally deleted it from
mycalc.py. And that there was no problem importing it from mycalc.
Well, I was mistaken (for a reason too tedious to go into). Ther
Richard D. Moores wrote:
> On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
>> Richard D. Moores wrote:
>>
>>> I wrote before that I had pasted the function (convertPath()) from my
>>> initial post into mycalc.py because I had accidentally deleted it from
>>> mycalc.py. And that
On 08/03/2011 01:48 PM, Richard D. Moores wrote:
On Wed, Aug 3, 2011 at 10:11, Peter Otten<__pete...@web.de> wrote:
Dave was close, but Steven hit the nail: the string r"C:\Users\Dick\..." is
fine, but when you put it into the docstring it is not a raw string within
another string, it becomes
On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> I wrote before that I had pasted the function (convertPath()) from my
>> initial post into mycalc.py because I had accidentally deleted it from
>> mycalc.py. And that there was no problem importing i
Richard D. Moores wrote:
> I wrote before that I had pasted the function (convertPath()) from my
> initial post into mycalc.py because I had accidentally deleted it from
> mycalc.py. And that there was no problem importing it from mycalc.
> Well, I was mistaken (for a reason too tedious to go into
I wrote before that I had pasted the function (convertPath()) from my
initial post into mycalc.py because I had accidentally deleted it from
mycalc.py. And that there was no problem importing it from mycalc.
Well, I was mistaken (for a reason too tedious to go into). There WAS
a problem, the same o
Richard D. Moores wrote:
But here's a try using the regular command line:
C:\Windows\System32>python
Python 3.2.1 (default, Jul 10 2011, 20:02:51) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
from mycalc import convertPath
Traceba
Ops!
I accidentally erased convertPath() from mycalc.py while trying out
various things. It was my only copy of convertPath that had the
docstring as posted, so I went to my initial post and copy-and-pasted
it into mycalc.py. Now no problem:
from Wing's shell:
Python 3.2.1 (default, Jul 10 2
Steven D'Aprano wrote:
Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that pat
Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that path with forward slashes.
On 08/03/2011 02:07 AM, Richard D. Moores wrote:
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
When I paste that from your email into a file and run Python 2.7 on it, it
behaves fine with no errors. That's in Linux.
I should have said that I'm using Wing IDE Professional 4.0.3-1 (rev
2472
On Wed, Aug 3, 2011 at 8:07 AM, Richard D. Moores wrote:
> On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
>
> > When I paste that from your email into a file and run Python 2.7 on it,
> it
> > behaves fine with no errors. That's in Linux.
>
> I should have said that I'm using Wing IDE Professio
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
> When I paste that from your email into a file and run Python 2.7 on it, it
> behaves fine with no errors. That's in Linux.
I should have said that I'm using Wing IDE Professional 4.0.3-1 (rev
24721), Windows Vista, and Python 3.2.1.
> But the e
On 08/02/2011 10:36 PM, Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that p
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that path with forward slashes.
By Steven D'Aprano 07
[Tim Peters]
>> You would in this case, and that would be wrong. In fp you'd get an
>> approximation to the exact n * (1./5 + 1./5**2 + ...) == n/4. (use
>> the rule for the sum of an infinite geometric series). For example,
>> that way you'd compute that 4! == 24 has 4/4 == 1 trailing zero,
>>
[Tim Peters]
> You would in this case, and that would be wrong. In fp you'd get an
> approximation to the exact n * (1./5 + 1./5**2 + ...) == n/4. (use
> the rule for the sum of an infinite geometric series). For example,
> that way you'd compute that 4! == 24 has 4/4 == 1 trailing zero,
> inste
[Tim Peters]
>> For a fun :-) exercise, prove that the number of trailing zeroes in n!
>> is the sum, from i = 1 to infinity, of n // 5**i (of course as soon as
>> you reach a value of i such that n < 5**i, the quotient is 0 at that i
>> and forever after).
>>
>> In this case,
>>
>> 100 // 5 + 100
Tim Peters wrote:
> [Dick Moores, computes 100 factorial as
>
> 9332621544394415268169923885626670049071596826438162146859296389521753229915608941463976156518286253697920827223758251185210916864
>
> but worries about all the trailing zeros]
>
>> Yes, I'm sure you a
[Dick Moores, computes 100 factorial as
9332621544394415268169923885626670049071596826438162146859296389521753229915608941463976156518286253697920827223758251185210916864
but worries about all the trailing zeros]
> Yes, I'm sure you are. I'd forgotten about all tho
At 04:50 PM 8/18/2006, Christian Tschabuschnig wrote:
> >>
> 9332621544394415268169923885626670049071596826438162146859296389521753229915608941463976156518286253697920827223758251185210916864
> >>> Still not exactly correct! I'm bewildered.
> >>>
> >> The results look t
>> 9332621544394415268169923885626670049071596826438162146859296389521753229915608941463976156518286253697920827223758251185210916864
>>> Still not exactly correct! I'm bewildered.
>>>
>> The results look the same to me
>> why do you think they're not correct?
>> what is
At 04:24 PM 8/18/2006, Luke Paireepinart wrote:
>Dick Moores wrote:
> > But here's the revised precisionFactorial.py:
> >
> >
> > # 1precisionFactorial.py
> >
> > import decimal
> >
> > def d(x):
> > return decimal.Decimal(str(x))
> >
> > def fact(n):
> > product
Dick Moores wrote:
> At 02:41 PM 8/18/2006, Bob Gailer wrote:
>
>> Dick Moores wrote:
>>
>>> As an exercise that I thought would help me understand the decimal
>>> module, I've been trying write a script (precisionFactorial.py)
>>> that uses a modified fact(n) to compute precise factorial
At 02:41 PM 8/18/2006, Bob Gailer wrote:
>Dick Moores wrote:
>>As an exercise that I thought would help me understand the decimal
>>module, I've been trying write a script (precisionFactorial.py)
>>that uses a modified fact(n) to compute precise factorials
>What do you mean by "precise factorials
Dick Moores wrote:
> As an exercise that I thought would help me understand the decimal
> module, I've been trying write a script (precisionFactorial.py) that
> uses a modified fact(n) to compute precise factorials
What do you mean by "precise factorials"? Python's long integer should
handle th
As an exercise that I thought would help me understand the decimal
module, I've been trying write a script (precisionFactorial.py) that
uses a modified fact(n) to compute precise factorials using the
decimal module. I''m getting nowhere fast, and don't understand why.
Here's what I have so far:
29 matches
Mail list logo