Does anybody know if there is a precision difference when I use mpmath and
take an expression:
from mpmath import *
mp.dps = 100
mu0 = [mpf('4') * pi * power(10, -7)
rather then:
mu0 = fprod([mpf('4'), pi, power(10, -7)])
?
Thanks,
-- Bernd
___
Tutor
Hi
I am trying to read data from a file that has format
item_name num_items item_type items
eg
TIME 1 0.0
DISTANCE 10 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
TIME 1 1.0
DISTANCE 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0
I can read this if the data are in ASCII format us
Hello,
I'd like to match any line that does not start with FOO. (Using just a reg-ex
rule)
1) What is the effective difference between:
(?!^FOO).*
^(?!FOO).*
2) Is there a better way to do this?
Thanks,
:)
___
Tutor maillist - Tutor
wrote>
I am trying to read data from a file that has format
item_name num_items item_type items
eg
TIME 1 0.0
DISTANCE 10 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
Where is the item_type?
I can read this if the data are in ASCII format using
in_file = open("my_file.dat",
On Mon, 2009-02-02 at 11:31 +, etrade.griffi...@dsl.pipex.com wrote:
> Hi
>
> I am trying to read data from a file that has format
>
> item_name num_items item_type items
>
> eg
>
> TIME 1 0.0
> DISTANCE 10 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
> TIME 1 1.0
> DISTANCE
# program to find square root
square = input ('Please enter a number to be rooted, ')
square = square * 1.0
guess = input('Please guess at the root, ')
guess = guess * 1.0
newguess = 0.
while guess**2 != square:
# Newton's formula
newguess = guess - (guess * guess - square) / (gue
"WM." wrote
square = input ('Please enter a number to be rooted, ')
square = square * 1.0
Use raw_input() instead of input() and don't multiply
by 1.0 - instead convert to float using float():
square = float( raw_input ('Please enter a number to be rooted, '))
guess = input('Please guess a
On Tue, Feb 3, 2009 at 9:46 AM, Bernard Rankin wrote:
> Hello,
>
>
> I'd like to match any line that does not start with FOO. (Using just a
> reg-ex rule)
>
> 1) What is the effective difference between:
>
> (?!^FOO).*
>
> ^(?!FOO).*
>
> 2) Is there a better way to do this?
>
myline = 'FOO thin
I have a client who is hosting under virtual domain services that do not
provide python.
He has unlimited disk space available ( or so the hoster says) and they
would allow installation of binaries in the virtual domain via ftp.
It's a linux 'box' with a /private folder under the domain root. giv
2009/2/3 Tim Johnson :
> I have a client who is hosting under virtual domain services that do not
> provide python.
> He has unlimited disk space available ( or so the hoster says) and they
> would allow installation of binaries in the virtual domain via ftp.
>
> It's a linux 'box' with a /private
On Mon, Feb 2, 2009 at 6:50 PM, WM. wrote:
># Newton's formula
>newguess = guess - (guess * guess - square) / (guess * 2)
>guess = newguess
or
guess = (guess + square/guess)/2
Kent
___
Tutor maillist - Tutor@python.org
http:/
On Monday 02 February 2009, John Fouhy wrote:
> 2009/2/3 Tim Johnson :
> > I have a client who is hosting under virtual domain services that do not
> > provide python.
> > He has unlimited disk space available ( or so the hoster says) and they
> > would allow installation of binaries in the virtual
2009/2/3 Tim Johnson :
>> - wrong libraries
> how do we resolve paths to libraries?
Well, like I suggested, you could try building a staticly-linked
version. Then it doesn't matter.
Otherwise, I'm not sure. Maybe you could figure out what libraries
you need, upload them, and play around with
# program to find square root
square = float(raw_input ("Please enter a number to be rooted, "))
guess = input("Please guess at the root, ")
i = 0
while guess**2 != square:
i+=1
# Newton's formula
guess = guess - (guess * guess - square) / (guess * 2)
print i
print
> > I'd like to match any line that does not start with FOO. (Using just a
> > reg-ex
> rule)
> >
> > 1) What is the effective difference between:
> >
> > (?!^FOO).*
> >
> > ^(?!FOO).*
> >
> > 2) Is there a better way to do this?
> >
>
> myline = 'FOO things in line'
>
> >>> myline.startswi
Hi All,
As I am getting a little older, I sometimes take small naps to recharge
my batteries:) Is this while loop OK? What kind of error checking should
I use?
thanks
-david
#!/usr/bin/python
import time
import subprocess
import sys
doit = 1
alarmhour = int(raw_input("Please enter the hour
2009/2/3 David :
> while(doit):
>mytime = list(time.localtime())
>hour = mytime[3]
>minute = mytime[4]
>if hour == alarmhour and minute == alarmmin:
>subprocess.call('mplayer -loop 9 ring.wav', shell=True)
>sys.exit()
Hi David,
What
17 matches
Mail list logo