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
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
> 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
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
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
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
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
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
_
> 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
> 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
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
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
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
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","
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
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
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
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
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:
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
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
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
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
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
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
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
> &
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
>
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
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
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
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
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
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.
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
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
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
-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
the right
direction.
Thank you,
-Todd
P.S."Hope everyone who reads this has a nice Thanksgiving!"
=
##
# Description: Use ADSI t
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
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
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
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
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
;_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
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
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
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
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
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,
>
>
49 matches
Mail list logo