Re: [Tutor] prime factorisation

2018-03-12 Thread Bruce Todd Puls
I think You would do much better if You wrote pseudo code first, i.e. write each step out in words, code is much easier to write following pseudo code Are You trying to factor Prime Numbers? Prime Number factored (Prime Number and 1) https://en.wikipedia.org/wiki/Table_of_prime_factors#1_to_100

[Tutor] vol 166, issue 20, 1. installing python and numpy on the Mac (OSX) (Peter Hodges)

2017-12-24 Thread Bruce Todd Puls
sudo -H python3.6 -m pip install numpy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Todd Purple via Tutor
> On Dec 12, 2015, at 2:03 AM, Jim Gallaher wrote: > > Hi everyone. I'm reading through a beginners Python book and came up with a > super simple program. I'm not getting any errors and everything runs through, > but there's a logical calculation error. What the program does is take an > amo

Re: [Tutor] a puzzle about -3**2 vs (-3)**2

2015-07-31 Thread Todd
On Fri, Jul 31, 2015 at 2:58 AM, D Wyatt wrote: > I just read in a book a little while ago that ** trumps a negative > sign? I am struggling with the audacity of that as -1 is negative 1, > NOT minus 1. How can an arithmetic operation trump an attribute of a > negative integer? It truly makes

Re: [Tutor] Question About Image Processing in Python

2015-05-28 Thread Todd
On Thu, May 28, 2015 at 1:05 PM, Terry Reedy wrote: > On 5/28/2015 6:34 AM, Serge Christian Ibala wrote: > > > I want to use the following package >> >> “numpy, matplotib, mahotas, ipython OpenCV and SciPy" >> > > opencv seems to be the only one not available for 3.x. > > OpenCV 3 (which is in

Re: [Tutor] subprocess.Popen basics

2014-10-28 Thread Todd
Centos has SELinux enabled by default. I dont know if SELinux is causing your problem, but it is always worth looking at. SELinux can keep a process from accessing files or executing another process. Try temporarily disabling SELinux by running setenforce=0 as root. Then see if python does wha

Re: [Tutor] Help please

2013-10-17 Thread Todd Matsumoto
Hello Ruben, You might already know this, but the Python documentation will get you pretty far: http://www.python.org/doc/ Here are some things to lookup that may help you solve the problems. On 10/16/2013 08:49 PM, Pinedo, Ruben A wrote: I was given this code and I need to modify it so that

Re: [Tutor] sqlite question

2013-06-11 Thread Todd Matsumoto
reader: > 6. d[badge]=name > 7. return d > > > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listin

Re: [Tutor] producing PDF files

2013-06-11 Thread Todd Matsumoto
_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Todd Matsumoto ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regarding python function arguments

2013-06-11 Thread Todd Matsumoto
> Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Todd Matsumoto ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Flip the coin 10x and count heads and tails: It works now!

2013-05-26 Thread Todd Matsumoto
ranteed to give either head or tails. So just count the > number of heads, then the number of tails will be ten less the number of > heads. > > > > > -- > Steven > > __**_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription optio

Re: [Tutor] Topic #2 of Tutor Digest

2012-07-28 Thread Todd Tabern
on't care about getting moji-bake, you can pretend that the file is encoded using Latin-1. That will pretty much read anything, although what it gives you may be junk. -- Steven -- Message: 2 Date: Sat, 28 Jul 2012 11:25:30 +0100 From: Mark Lawrence To: tutor@py

[Tutor] Search and replace text in XML file?

2012-07-27 Thread Todd Tabern
I'm looking to search an entire XML file for specific text and replace that text, while maintaining the structure of the XML file. The text occurs within multiple nodes throughout the file. I basically need to replace every occurrence C:\Program Files with C:\Program Files (x86), regardless of

[Tutor] list index out of range

2010-09-12 Thread Todd Ballard
I am attempting to have a cummalative total of the y values and receive a "list index out of range" error message import numpy import matplotlib.pyplot as plt import filereader from filereader import * My_Path="C:\\Python26\\assignment2\\datadownload.txt" My_Data_Type=numpy.dtype([("year","

Re: [Tutor] [SPAM]Re: O'Reilly is offering Learning Python (4th ed.), eBook form for USD 9.99

2010-08-11 Thread Todd Nannie
If you click on the ONE DAY DEAL on the front page it still list the Python book and several others. I just bought the python book for 9.99 Todd -Original Message- From: tutor-bounces+tnannie=strdetail@python.org [mailto:tutor-bounces+tnannie=strdetail@python.org] On Behalf Of

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
I don't understand how the while loop efficiently tests if the list is empty. Why would going through the entire list be a good test to simply see find out if the list is empty or not. Wouldn't you want to test the list itself, rather than the contents of it? Cheers, T Original-Nachr

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
The while loop will print each index of the list. In a way it checks that if the list is empty by printing the items. As far as I know there isn't any 'True' or 'False' output from a list. If you want to do something if mylist is empty you can check it like this: if not mylist: ... do someth

Re: [Tutor] Checking for Python version

2009-10-06 Thread Todd Zullinger
sys.exit(upgrade_msg) except AttributeError: sys.exit(upgrade_msg) I don't have any python 3.x systems to test though. -- ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~ Suppose I wer

[Tutor] Option parser tools

2009-07-22 Thread Todd Matsumoto
Hello Tutors, I'm building a script that now needs a command line interface. I'm aware of optparse, but I'm wondering if there are any other tools that may be better for building the interface. Cheers, T -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http:

Re: [Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
Thanks guys, In the example the __call__ method has *args and **kws as arguments. Is that required? Also when, in what situation would you use callable objects? Cheers, T Original-Nachricht > Datum: Wed, 15 Jul 2009 12:02:05 -0700 > Von: wesley chun > An: vince spicer , tmat

Re: [Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
hi kent, thanks, i read through the link but still haven't got my head around this concept. will read on. cheers, t Original-Nachricht > Datum: Wed, 15 Jul 2009 08:33:33 -0400 > Von: Kent Johnson > An: Todd Matsumoto > CC: tutor@python.org > Betreff: Re

[Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
Hi, Can some one give, or point to some good examples of how @decorators work, and __call__ (able) objects? I'm having trouble getting my head around these techniques (concepts). Cheers, T -- Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://portal

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
ve a value that is a Decimal object something is wrong. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 22:36:14 -0400 > Von: Dave Angel > An: > CC: Todd Matsumoto , tutor@python.org > Betreff: Re: Re: [Tutor] unittests, testing a type > On Tue, J

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
his test-driven development thing. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 15:45:18 +0200 > Von: "A.T.Hofkamp" > An: Todd Matsumoto > CC: "tutor@python.org" > Betreff: Re: [Tutor] unittests, testing a type > Todd Matsumoto

[Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
Hi, Does anyone know how to do a unittest assert for a type? So If you have a program returning a Decimal, lets say Decimal("1"), and you want to make sure that what is returned is a Decimal object. At first I thought of importing Decimal and making my own Decimal("1") and doing an assertEqua

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
Okay, Thanks guys. That explains it. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 00:16:30 -0700 > Von: wesley chun > An: "A.T.Hofkamp" > CC: Todd Matsumoto , "tutor@python.org" > Betreff: Re: [Tutor] While and for loops > &

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
else: if break is False: break Is the above do-able? Is there a better way? T Original-Nachricht > Datum: Tue, 14 Jul 2009 00:05:30 -0700 > Von: wesley chun > An: Todd Matsumoto > CC: tutor@python.org > Betreff: Re: [Tutor] While and for loops >

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
Okay, So how would you break out from this situation? T Original-Nachricht > Datum: Tue, 14 Jul 2009 06:57:41 + > Von: sli1...@yahoo.com > An: "Todd Matsumoto" > Betreff: Re: [Tutor] While and for loops > Your break is for the for loop not the

[Tutor] assigning list to keys

2009-07-14 Thread Todd Matsumoto
Hello, The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this: list = [] dict = {} x = 1 dict['int'] = list.append(x) The result was {'int': None}. Why is the valu

[Tutor] While and for loops

2009-07-13 Thread Todd Matsumoto
Hello, The other day I was playing with a while loop with a for loop nested inside. Within the for loop I had a condition to break the loop, but when loop ran it never existed the loop. I went back and looked in Programming Python to read about loops and I've got two questions (related to each

Re: [Tutor] Please use plain text.

2009-04-07 Thread Todd Zullinger
any HTML messages that are sent are simply dumped as text for me to read. (I know many others that direct all HTML mail to /dev/null.) -- ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~ I a

Re: [Tutor] Please use plain text.

2009-04-06 Thread Todd Zullinger
bob gailer wrote: > Please use plain text rather than formatted text. Was sending this request in an html formatted message intentional? I don't know about most folks, but I consider plain text to mean a content-type of text/plain rather than text/html. :) -- ToddOpenPGP

Re: [Tutor] MP3Info class usage

2008-12-20 Thread Todd Zullinger
ot;Travis Shirk "; > > Someone else will now explain why this is a terrible idea. I don't think it is a bad idea at all. I was going to suggest something similar. If you do that, you should be able to copy the src/eyeD3 directory somewhere in your PYTHONPATH and use it just fine.

Re: [Tutor] MP3Info class usage

2008-12-18 Thread Todd Zullinger
file" makes me think this is Windows. On *nix systems, you run ./configure; make; sudo make install. The ./ in front of configure tells the shell that the program you are trying to run is in the current directory. Otherwise, the shell would look for configure in your $PATH, which does

Re: [Tutor] MP3Info class usage

2008-12-15 Thread Todd Zullinger
quotes around 'ID3_ANY_VERSION'. That's not what you want to do. ID3_ANY_VERSION is defined in eyeD3/__init__.py. If you quote it, you're breaking it. > I'm baffled that I'm having to jump through so many hoops because I > imported eyeD3... is this typical? Wh

Re: [Tutor] MP3Info class usage

2008-12-10 Thread Todd Zullinger
ent/Mutagen -- ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~ A paranoid is someone who knows a little of what's going on. -- William S. Burroughs pgpqn2qXFwKw3.pgp Descrip

Re: [Tutor] Python open of c:\ path Problem

2008-08-23 Thread Todd Zullinger
-slashes as the path separator, e.g.: junkfile = open('c:/tmp/junkpythonfile','w') (Pardon me if I'm completely wrong.) -- ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~ To

[Tutor] IIS and Virtual directories

2006-11-22 Thread Todd Dahl
the right direction. Thank you, -Todd P.S."Hope everyone who reads this has a nice Thanksgiving!" = ## # Description: Use ADSI t

[Tutor] Recursive functions and the windows registry

2006-11-16 Thread Todd Dahl
would be great. I'm getting to the end of my rope. By the way I don't understand why it seems to work inside the ListRegistryKeys function but it doesn't pass all the information back to the parseRegistry function. -Todd #!/usr/bin/env python import _winreg # _winreg

[Tutor] Windows Registry

2006-11-09 Thread Todd Dahl
is search the registry for a list of known keys without knowing their specific locations and then find values of the other keys around it. Hope that makes sence.  Thanks, -Todd ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

[Tutor] GUI with Designer

2006-11-03 Thread Todd Dahl
be used with either. I plan on coding in Windows XP.   Thanks,   -Todd   ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Running multiple version of Python on 1 windows machine

2006-10-30 Thread Todd Dahl
can't even install the module at home. So my question is how do I configure my machine at home so I can have multiple versions of python running so I can run this code. Or is this a bad and/or confusing thing to do. Thanks -Todd ___ Tutor mai

Re: [Tutor] First Try

2006-02-19 Thread Todd Maynard
and for a belated footnote: [1] = http://www.python.org/peps/pep-0008.html Style Guide for python code. --Todd On Sunday 19 February 2006 06:27, Todd Maynard wrote: > Nice Job John. I made a few comments below on a few things I noticed. > > On Sunday 19 February 2006 05:33, Joh

Re: [Tutor] First Try

2006-02-19 Thread Todd Maynard
;_t=21550&_r=endtext&_m=EXT > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor Have some fun with itat least until you win the lottery. --Todd Maynard -- Computers are unreliable, but humans are even more unreliable. Any system which depends on human reliability is unreliable. -- Gilb ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] G'day

2006-02-18 Thread Todd Maynard
John, Just as an FYI, Dive into Python is available in printed form. The http://diveintopython.org website has a link to it on Amazon.com. It might be cheaper than printing it out yourself.. --Todd Maynard -- The world is coming to an end ... SAVE YOUR BUFFERS!!! On Saturday 18

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-22 Thread Todd Maynard
x27;t hear from me in a while, I've probably suffered a caffeine overdose. Thanks for the inspiration, Todd Maynard -- The tao that can be tar(1)ed is not the entire Tao. The path that can be specified is not the Full Path. We declare the names of all variables and functions. Yet the

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-21 Thread Todd Maynard
little better if you could reassure me that I am right, and would sleep even better if you could give me a method to test this. This kinda stuff looks tricky to test with standard unittest methodology Thanks again for the enligntenment all you guys bring to this awesome language

Re: [Tutor] Indexing in a series for a newbie

2006-01-19 Thread Todd Maynard
you can do... word, hint = random.choice(WORDS) >>> WORDS=( ("python","The python hint"),("program","The program hint"), ("code","The code hint") ) >>> word, hint = random.choice(WORDS) >>> word 'code

Re: [Tutor] A Really Quick Question

2005-10-22 Thread Todd Maynard
data than what was requested may be returned, even if no size parameter was given. *** If you want to only read X bytes at a time then read would be more appropriate. Have fun learning, --Todd On Saturday 22 October 2005 10:18, Steve Haley wrote: > Folks, > >