Re: [Tutor] How do I do cubic roots and cubic exponents (and higher roots and exponents) in Python?

2006-05-08 Thread Danny Yoo
> How do I do cubic (and higher) roots and exponents in Python? I already > took a look in Python and didn't find anything. Hi Nathan, I think you're looking for the '**' operator. Like addition and multiplication, it can take in two numbers. ## >>> 2 ** 2 4 >>> 2 ** 3 8 >>> 2 ** 4

[Tutor] How do I do cubic roots and cubic exponents (and higher roots and exponents) in Python?

2006-05-08 Thread Nathan Pinno
Hi all,   How do I do cubic (and higher) roots and exponents in Python? I already took a look in Python and didn't find anything.   Thanks, Nathan Pinno Web Surfer's Store http://www.websurfstore.ca MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 ICQ: 199020705   __

Re: [Tutor] Python media player?

2006-05-08 Thread John Fouhy
On 09/05/06, CPIM Ronin <[EMAIL PROTECTED]> wrote: > Is there such a thing as a Python coded media player? I'm having troble with > my Windows Media Player playing commercial DVDs and can't fathom why it > should be so difficult to debug. I'm hoping the logic would be much clearer > in Python. pyM

[Tutor] Python media player?

2006-05-08 Thread CPIM Ronin
Is there such a thing as a Python coded media player? I'm having troble with my Windows Media Player playing commercial DVDs and can't fathom why it should be so difficult to debug. I'm hoping the logic would be much clearer in Python. RC ___

Re: [Tutor] simple question about numeric types

2006-05-08 Thread Kent Johnson
Emanuele Rocca wrote: > Hello list, > I've got a question partially related to this thread. > > * Gregor Lingl <[EMAIL PROTECTED]>, [2006-05-03 0:24 +0200]: >> v= >> if isinstance(v, int) or isinstance(v, float): >> > > I wonder which is the recommended way to check the type of a value.

Re: [Tutor] web intefaces?

2006-05-08 Thread Chad Crabtree
While everything that Alan Guald said is true, there are a couple of options for you. Provided you know HTML (you must), you could generate html pragmatically but, knowledge of html is still mandatory. Your options are, basically http://www.cherrypy.org Which is an app server that should be fair

Re: [Tutor] simple question about numeric types

2006-05-08 Thread Chad Crabtree
I think isinstance() is probably the best way to do this. I however always do type(x)==TestType: where TestType is a string that is returned from type() or not what ever the case. On 5/8/06, Emanuele Rocca <[EMAIL PROTECTED]> wrote: > Hello list, > I've got a question partially related to this t

Re: [Tutor] using variables as args

2006-05-08 Thread Jerome Jabson
Thank you, Alan! I'll try using POPEN. Jerome --- Alan Gauld <[EMAIL PROTECTED]> wrote: > > I'm trying to start a shell script with 4 > arguments > > from my python script. I'm having problems trying > to > > figure out the best way to do this. > > Use a format string: > > cmd = "myscript %s

Re: [Tutor] using variables as args

2006-05-08 Thread Alan Gauld
> I'm trying to start a shell script with 4 arguments > from my python script. I'm having problems trying to > figure out the best way to do this. Use a format string: cmd = "myscript %s %s %s %s" os.system(cmd % (p1,p2,p3,p4)) OR cmdstr = cmd % p1,p2,p3,p4 os.system(cmdstr) The second form i

Re: [Tutor] simple question about numeric types

2006-05-08 Thread Emanuele Rocca
Hello list, I've got a question partially related to this thread. * Gregor Lingl <[EMAIL PROTECTED]>, [2006-05-03 0:24 +0200]: > v= > if isinstance(v, int) or isinstance(v, float): > I wonder which is the recommended way to check the type of a value. In other words, what should I choos

Re: [Tutor] Should I use generators here?

2006-05-08 Thread Tony C
Thus you should probably do:   try:   fh=open(Onefile, "r")   Filecontents = fh.readlines()  # these files are verysmall,   # other code here   Summary[Onefile] = deepcopy(Stats)# associate each   fh.close()   except IOError:   print("\n

Re: [Tutor] trouble with re

2006-05-08 Thread Ertl, John
Kent, Thanks for the nock on the head, that has bitten me before. Taking out the spaces worked great. Thanks again, John Ertl -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kent Johnson Sent: Monday, May 08, 2006 10:53 AM Cc: tutor@python.

Re: [Tutor] trouble with re

2006-05-08 Thread Kent Johnson
Ertl, John wrote: > I have a file with 10,000 + lines and it has a coma delimited string on each > line. > > The file should look like: > > DFRE,ship name,1234567 > FGDE,ship 2, > ,sdfsf > > The ,sdfsf line is bad data > > p = re.compile('\d{7}$ | [,]$') # this is the line that I can not get

[Tutor] trouble with re

2006-05-08 Thread Ertl, John
I have a file with 10,000 + lines and it has a coma delimited string on each line. The file should look like: DFRE,ship name,1234567 FGDE,ship 2, ,sdfsf The ,sdfsf line is bad data Some of the lines are messed up...I want to find all lines that do not end in a comma or seven digits and do som

Re: [Tutor] python for beginners

2006-05-08 Thread Kent Johnson
Liviu Antoniu wrote: > I want to learn Python and for this I need a good tutorial for > beginners. Please tell where can I find these tutorials. If you are new to programming: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers If you are an experienced programmer new to Python: http://wik

[Tutor] python for beginners

2006-05-08 Thread Liviu Antoniu
I want to learn Python and for this I need a good tutorial for beginners. Please tell where can I find these tutorials.Thank you___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] using variables as args

2006-05-08 Thread Jerome Jabson
Hello, I'm trying to start a shell script with 4 arguments from my python script. I'm having problems trying to figure out the best way to do this. I'm using variables as the arguments to the shell script. I want to use popen3 to keep track of stdin, stdout, and err, but from the docs I only see u

Re: [Tutor] query python mastery via programming exercises

2006-05-08 Thread Kermit Rose
    From: Alan Gauld Date: 05/08/06 06:20:42 To: Kermit Rose; tutor@python.org Subject: Re: [Tutor] query python mastery via programming exercises     The nearest to that is the Python Challenge 'game' web site. It presents a series of challenges to be solved in Python. Each challenge uses a

Re: [Tutor] Should I use generators here?

2006-05-08 Thread Alan Gauld
Hi Tony, One point that jumps out at me is: # -- def ProcessFiletype(Thesefiles, Summary, Stats): # ... try: fh=open(Onefile, "r") except IOError: print("\nFATAL ERROR ocurred opening %s for input" % Onefile) else: try:

Re: [Tutor] query python mastery via programming exercises

2006-05-08 Thread Alan Gauld
Hello again, > Has someone organized a set of exercises that when solved in the > order > presented teaches mastery of Python programming. The nearest to that is the Python Challenge 'game' web site. It presents a series of challenges to be solved in Python. Each challenge uses a specific featur

Re: [Tutor] Should I use generators here?

2006-05-08 Thread Kent Johnson
Tony C wrote: > > I wrote a small Python program to count some simple statistics on a > Visual Basic program thatI am maintaining. > > The Python program counts total lines, whitespace lines, comment lines, > Public & Private Subroutines, Public and Private Functions. > The Python program takes