Re: [Tutor] python internet archive API?

2007-04-25 Thread Luke Paireepinart
Switanek, Nick wrote: > > I’m a novice Python programmer, and I’ve been looking for a way to > collect archived web pages. I would like to use the data on Internet > Archive, via the “Wayback Machine”. Look, for example, at > http://web.archive.org/web/*/http://www.python.org >

Re: [Tutor] sys.path, managing modules and packages

2007-04-25 Thread Rikard Bosnjakovic
On 4/26/07, Switanek, Nick <[EMAIL PROTECTED]> wrote: > Can someone help me better understand how I ought to manage the modules and > packages that I download? I often find that I can't use the code I've just > downloaded, despite putting it into Lib/site-packages. Often I've added the > subdirect

Re: [Tutor] Averaging a list of lists with a listcomp?

2007-04-25 Thread John Fouhy
On 26/04/07, Terry Carroll <[EMAIL PROTECTED]> wrote: > I have a list (of arbitrary length) of lists, each sublist having a fixed > number N of items, all integers. > > I would like to produce a list of N items, each item of which is an > integer which is the average of the elements in the same pos

[Tutor] Averaging a list of lists with a listcomp?

2007-04-25 Thread Terry Carroll
I have a list (of arbitrary length) of lists, each sublist having a fixed number N of items, all integers. I would like to produce a list of N items, each item of which is an integer which is the average of the elements in the same position of each of the sublists of the original list. I realiz

[Tutor] sys.path, managing modules and packages

2007-04-25 Thread Switanek, Nick
Can someone help me better understand how I ought to manage the modules and packages that I download? I often find that I can't use the code I've just downloaded, despite putting it into Lib/site-packages. Often I've added the subdirectory path via sys.path.append, but this seems to go only one lev

[Tutor] python internet archive API?

2007-04-25 Thread Switanek, Nick
I'm a novice Python programmer, and I've been looking for a way to collect archived web pages. I would like to use the data on Internet Archive, via the "Wayback Machine". Look, for example, at http://web.archive.org/web/*/http://www.python.org .

Re: [Tutor] best search/replace method?

2007-04-25 Thread John Washakie
Excellent. Thanks Luke, that seems to be working On 4/25/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > John Washakie wrote: > > Tested. Failed... > > > > I thought it would be something like that, but that doesn't work.. > > perhaps because 'ImagePathReplaceMe' isn't separate from the res

Re: [Tutor] best search/replace method?

2007-04-25 Thread Luke Paireepinart
John Washakie wrote: > Tested. Failed... > > I thought it would be something like that, but that doesn't work.. > perhaps because 'ImagePathReplaceMe' isn't separate from the rest of > the path??? It doesn't matter what surrounds the string to be replaced in the target string. Refer to my other e-

Re: [Tutor] best search/replace method?

2007-04-25 Thread Luke Paireepinart
Rikard Bosnjakovic wrote: > On 4/25/07, John Washakie <[EMAIL PROTECTED]> wrote: > > >> cat raw.html | >> sed 's/ImagePathReplaceMe/NewPathToImage/g' | >> sed 's/TitleReplaceMe/NewTitle/g' > new.html >> > > One line's sufficient: > > sed -e 's/ImagePathReplaceMe/NewPathToImage/g;s/TitleRepl

Re: [Tutor] best search/replace method?

2007-04-25 Thread John Washakie
Tested. Failed... I thought it would be something like that, but that doesn't work.. perhaps because 'ImagePathReplaceMe' isn't separate from the rest of the path??? Maybe replace has some options... I'll look into that. . On 4/25/07, Rikard Bosnjakovic <[EMAIL PROTECTED]> wrote: > On 4/25/07, J

Re: [Tutor] best search/replace method?

2007-04-25 Thread Rikard Bosnjakovic
On 4/25/07, John Washakie <[EMAIL PROTECTED]> wrote: > cat raw.html | > sed 's/ImagePathReplaceMe/NewPathToImage/g' | > sed 's/TitleReplaceMe/NewTitle/g' > new.html One line's sufficient: sed -e 's/ImagePathReplaceMe/NewPathToImage/g;s/TitleReplaceMe/NewTitle/g' raw.html > new.html > However, t

[Tutor] best search/replace method?

2007-04-25 Thread John Washakie
Folks, I'm writing a program which will read in an html file, and then replace certain elements, such as the title, and various paths defined for images. I can make a 'source' file with ImagePathReplaceMe and TitleReplaceMe text in it, then search for that and replace it. With sed my script would

Re: [Tutor] 100 Programs?

2007-04-25 Thread Rohan Deshpande
Well there's always pythonchallenge.com, but it's both a riddle and a programming exercise. And, they're not entirely python specific (except for a couple), but it's a start. -Rohan On 4/25/07, Alex Dering <[EMAIL PROTECTED]> wrote: Can anyone recommend a list of progressively harder Python p

[Tutor] 100 Programs?

2007-04-25 Thread Alex Dering
Can anyone recommend a list of progressively harder Python programming assignments for the self-learner? My suspicion is that if I arrive at a point where I am proficient in Python, I still won't trust myself to be the judge of that. So I'm trying to get a list of specific tasks/problems/projects

Re: [Tutor] Custom objects throw what exception?

2007-04-25 Thread Kent Johnson
Thanos Panousis wrote: > The tutor list is definately helping me perform my OO-python babysteps. > > I want to ask this. Say I have some objects of my own, and using the > example I posted in a previous post, say I have a person object with a > instance variable called hairColor. > > The hairColo

Re: [Tutor] how to stop a function

2007-04-25 Thread Dmitry Dzhus
Maybe `return`? -- Happy Hacking. Dmitry "Sphinx" Dzhus http://sphinx.net.ru ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Custom objects throw what exception?

2007-04-25 Thread Thanos Panousis
The tutor list is definately helping me perform my OO-python babysteps. I want to ask this. Say I have some objects of my own, and using the example I posted in a previous post, say I have a person object with a instance variable called hairColor. The hairColor property is set via an exotic funct