Re: [Tutor] specifying precision with scientific notation

2010-10-05 Thread Andre' Walker-Loud
Hi Wayne, Yes - that helps. I missed the correct combination of parentheses. Now I am trying to improve my aesthetics, as Evert suggested earlier > Personally, I would print this as 7.63e-03 +- 0.83e-03, which shows the > precision a bit better. But that's just a matter of aesthetics, and woul

Re: [Tutor] specifying precision with scientific notation

2010-10-05 Thread Andre' Walker-Loud
Hi Alan, The point I can not get to work is > fmt = "%.%de + %.1e" % n else: when I try this, I get (python 2.6.5, OS X 10.6) > n = 3; fmt = "%.%de + %.1e" % n; fmt '%de + 3.0e+00' But something like the "%.%de " %n is exactly what I am looking for - if I could get it to work. Thanks, Andr

Re: [Tutor] perl or python

2010-10-05 Thread R. Alan Monroe
> Is it better to learn Perl or Python since i can manage only writing > simple bash shell scripts. > Please suggest/guide. Do you already have both installed (seeing bash, I bet you're on some version of Linux, so it's likely you do). You could try writing a very simple "guess my number" game

Re: [Tutor] creating a class

2010-10-05 Thread Alan Gauld
"T MURPHY" wrote how do i go about creating a class in python. class C: pass is the simplest way. But it's not very useful, being empty. But most tutorials discuss OOP, which one are you using? -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ __

Re: [Tutor] specifying precision with scientific notation

2010-10-05 Thread Alan Gauld
"Andre' Walker-Loud" wrote a = 0.00762921383941 ea = 0.000830132912068 a / ea 9.190352205653852 By default, I will print the uncertainty ("ea") with two significant digits. In this example, the central value is about 10 times larger than the uncertainty, so I want to print it with 3 signifi

Re: [Tutor] creating a class

2010-10-05 Thread James Mills
On Wed, Oct 6, 2010 at 4:16 AM, T MURPHY wrote: > how do i go about creating a class in python. By using the "class" keyword. Example: class Fruit(object): def __init__(self, name) self.name = name class Apple(Fruit): def __init__(self): super(Apple, self).__init__("apple")

[Tutor] creating a class

2010-10-05 Thread T MURPHY
how do i go about creating a class in python. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] specifying precision with scientific notation

2010-10-05 Thread Evert Rol
> I want to print scientific numbers with a specified number of decimal places. > However, I want the number printed to be dynamically determined by the data. > Example: > >> a = 0.00762921383941 >> ea = 0.000830132912068 >> a / ea > 9.190352205653852 > > By default, I will print the uncertai

[Tutor] specifying precision with scientific notation

2010-10-05 Thread Andre' Walker-Loud
Hi All, I want to print scientific numbers with a specified number of decimal places. However, I want the number printed to be dynamically determined by the data. Example: > a = 0.00762921383941 > ea = 0.000830132912068 > a / ea 9.190352205653852 By default, I will print the uncertainty ("ea

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-05 Thread Alan Gauld
"Susana Iraiis Delgado Rodriguez" wrote it throws me that "C:/Archivos" is not recognized as an executable external or internal command, programm or file. You can only use / in paths used by Python. You are passing this to the CMD processor via os.system so CMD complains. It expects / to

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-05 Thread Walter Prins
Thank you for taking the time to answer. I already changed my os.system() for your code. I got an error, when I executed this: > os.system(" 'C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe ' "+arg1 > +" -where "+arg2 +" " +arg3) > it throws me that "C:/Archivos" is not recognized as an exec

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-05 Thread Susana Iraiis Delgado Rodriguez
Hello, I already solved the problem, I change all the code, instead of using os.system I changed to subprocess.Popen() and it worked fine: import shlex, subprocess def process(): print "Ingresa en el siguiente orden:" print "Nombre del nuevo mapa.shp Nombre de la capa Nombre del mapa ori

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-05 Thread Susana Iraiis Delgado Rodriguez
Hello Norman: Thank you for taking the time to answer. I already changed my os.system() for your code. I got an error, when I executed this: os.system(" 'C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe ' "+arg1 +" -where "+arg2 +" " +arg3) it throws me that "C:/Archivos" is not recognized as

Re: [Tutor] perl or python

2010-10-05 Thread Steven D'Aprano
On Tue, 5 Oct 2010 09:54:42 pm Kaushal Shriyan wrote: > Hi > > Is it better to learn Perl or Python since i can manage only writing > simple bash shell scripts. > Please suggest/guide. This is a mailing list for Python, filled with people who like and use Python. What do you think we're going to

[Tutor] perl or python

2010-10-05 Thread Kaushal Shriyan
Hi Is it better to learn Perl or Python since i can manage only writing simple bash shell scripts. Please suggest/guide. Thanks and Regards Kaushal ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyth