I was thinking of a way I could make writing Python Class Files a
little less painful. I was considering a Ptyhon script that read a
file with a list of property names and method names and then generated
a skeleton class file.
I was even thinking of automatically generating the shell for doc
strin
On Oct 22, 8:02 am, vimal <[EMAIL PROTECTED]> wrote:
> On Oct 22, 5:43 pm, Marco Mariani <[EMAIL PROTECTED]> wrote:
>
> > Py-Fun wrote:
> > > def itforfact(n):
> > > while n<100:
> > > print n
> > > n+1
> > > n = input("Please enter a number below 100")
>
> > You function should
On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> I was thinking of a way I could make writing Python Class Files a
> little less painful. I was considering a Ptyhon script that read a
> file with a list of property names and method names and then generated
> a skeleton class file.
>
> I
Marco Mariani wrote:
> Tim Golden wrote:
>
>>> From the cookbook, this time.
>>> It satisfies the requirements nicely ;)
>>>
>>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691
>> [... snip the ultimate general-purpose answer to the OP's question ...
>>
>> I really hope that's a w
On Oct 22, 7:50 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Py-Fun <[EMAIL PROTECTED]> wrote:
> > I'm stuck trying to write a function that generates a factorial of a
> > number using iteration and not recursion. Any simple ideas would be
> > appreciated.
>
> This version avoids doing anything f
On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I was thinking of a way I could make writing Python Class Files a
> > little less painful. I was considering a Ptyhon script that read a
> > file with a list of
In article <[EMAIL PROTECTED]>,
Py-Fun <[EMAIL PROTECTED]> wrote:
> I'm stuck trying to write a function that generates a factorial of a
> number using iteration and not recursion. Any simple ideas would be
> appreciated.
Well, first think about the recursive implementation:
def fact(n):
Sunburned Surveyor a écrit :
> I was thinking of a way I could make writing Python Class Files
What's a "Python Class File" ?
> a
> little less painful.
If you find writing classes in Python "painful", then either you have no
experience with any mainstream language or you are doing something wr
Gabriel Genellina wrote:
> "I actually do a lot of unit testing. I find it both annoying and highly
> necessary and useful." - Steven Bethard
> http://groups.google.com/group/comp.lang.python/msg/4df60bdff72540cb
That quote is actually due to Dan McLeran. A very good quote though.
Steve
--
h
On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> > On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > I was thinking of a way I could make writing Python Class Files a
> > > little less pa
On Mon, 22 Oct 2007 11:05:52 -0700, Sunburned Surveyor wrote:
> On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>
> You wrote: " can't think of a single reason why you would ever want to
> do this,
> since your "list of method and property names" would be just as
> verbose as just t
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> On Oct 22, 7:50 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
>> Py-Fun <[EMAIL PROTECTED]> wrote:
>> > I'm stuck trying to write a function that generates a factorial of a
>> > number using iteration and not recursion. Any simple ideas would be
>>
The right way is:
import operator
def fact(x):
return reduce(operator.mul, xrange(1,x+1))
On 10/22/07, Paul Rudin <[EMAIL PROTECTED]> wrote:
>
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>
> > On Oct 22, 7:50 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
> >> Py-Fun <[EMAIL PROTECTED]> wro
On 10/20/07, John Nagle <[EMAIL PROTECTED]> wrote:
> Gert-Jan wrote:
> > sophie_newbie schreef:
> >> Hi, I want to store python text strings that characters like "é" "Č"
> >> in a mysql varchar text field. Now my problem is that mysql does not
> >> seem to accept these characters. I'm wondering if
On Oct 22, 11:23 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> > > On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
>
> > > > I was thinking of a way
Sunburned Surveyor wrote:
> Contents of input text file:
>
> [Name]
> Fire Breathing Dragon
>
> [Properties]
> Strength
> Scariness
> Endurance
>
> [Methods]
> eatMaiden argMaiden
> fightKnight argKnight
>
> Generated Python Class File:
>
> def class FireBreathingDragon:
>
>def getStrengt
> You wrote: " can't think of a single reason why you would ever want to
> do this,
> since your "list of method and property names" would be just as
> verbose as just typing the actual python code."
>
> I don't think I understand how this would be the same amount of
> typing. Consider the followi
On Oct 22, 11:43 am, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Sunburned Surveyor wrote:
> > Contents of input text file:
>
> > [Name]
> > Fire Breathing Dragon
>
> > [Properties]
> > Strength
> > Scariness
> > Endurance
>
> > [Methods]
> > eatMaiden argMaiden
> > fightKnight argKnight
>
> > Gene
Sunburned Surveyor wrote:
> I also intended to add statements creating properties from the getter
> and setter methods. I understand that getters and setters aren't
> really necessary if you aren't making a property. I just forgot to add
> the property statements to my example.
You still don't wan
Sunburned Surveyor a écrit :
> On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>
(snip)
>>I can't think of a single reason why you would ever want to do this,
>>since your "list of method and property names" would be just as
>>verbose as just typing the actual python code.
>>
>>Auto
Michael J. Fromberger wrote:
> # Not legal Python code.
> def fact3(n, acc = 1):
> TOP:
> if n > 0
> n = n - 1
> acc = acc * n
> goto TOP
> else:
> return acc
Yes, to write this in legal Python code, you have to write::
from goto import goto
On Oct 22, 11:47 am, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Sunburned Surveyor a écrit :
>
> > On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>
> (snip)
> >>I can't think of a single reason why you would ever want to do this,
> >>since your "list of method and property nam
On Oct 22, 1:35 pm, Paul Rudin <[EMAIL PROTECTED]> wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > On Oct 22, 7:50 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
> >> Py-Fun <[EMAIL PROTECTED]> wrote:
> >> > I'm stuck trying to write a function that generates a factorial of a
> >> > numbe
Hi,
I am parsing an XML file that includes chineses characters, like ^
�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that I get an error like:
UnicodeEncodeerror:'charmap' codec can't encode characters in position
The thing is that I would like to ignore it and parse all the characters
less
Hi all,
I think the latest patch for fixing Issue 708374 (adding offset to mmap)
should be committed to SVN.
I will do it, if nobody opposes the plan. I think it is a very
important addition and greatly increases the capability of the mmap module.
Thanks,
-Travis Oliphant
--
http://mail.p
Hi there.
We're talking about an asyncore-based server.
Just for the heck of it I'd like to set a timeout which will
disconnects the clients if they're inactive (i.e., no command or data
transfer in progress) for a long period of time.
I was thinking about putting the timeout value into an attribut
This works:
def fact(x):
if x == 0 or x == 1:
return 1
else:
return reduce(operator.mul, xrange(1,x+1))
or
def factorial(n):
acc = 1
while n > 1:
acc = acc * n
n = n - 1
return acc
On 10/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> O
> Not exactly - this is the "query string" part of the URI.
> Request and Response are the two messages defined by the HTTP protocol.
> When you type a URL or click on a link or press a button in a page, your
> browser builds the appropiate Request message and sends it to the server.
> After proces
> This preference, in
> turn, is what motivated my original question. The CPython API
> interface itself seems modularized, NOT object oriented (only from
> what I saw).
I suggest you look again, then. Things like PyObject_String,
PyObject_GetAttrString, or PySequence_GetItem all express the
obje
On 22 oct, 20:35, Paul Rudin <[EMAIL PROTECTED]> wrote:
> import operator
> def fact(x):
> return reduce(operator.mul, xrange(1,x))
Maybe:
import operator
def fact(x):
return reduce(operator.mul, xrange(2, x+1), 1)
fact(0)
1
fact(4)
24
--
http://mail.python.org/mailman/listinfo/python
["Followup-To:" header set to comp.lang.functional.]
On Mon, 22 Oct 2007 11:30:51 -0400, George Neuner
wrote:
> On Mon, 22 Oct 2007 05:50:30 -0700, Xah Lee <[EMAIL PROTECTED]> wrote:
[...]
>>5. This is arguable and trivial, but i think TeX judged as a computer
>>language in particular its synta
> def fact(x):
> if x == 0 or x == 1:
> return 1
> else:
> return reduce(operator.mul, xrange(1,x+1))
If obscurity is the name of the game,
>>> from operator import mul
>>> fact = lambda i: i > 1 and reduce(mul, xrange(1,i+1)) or i
>= 0 and 1 or None
>>> for i i
Sunburned Surveyor a écrit :
> On Oct 22, 11:47 am, Bruno Desthuilliers
> <[EMAIL PROTECTED]> wrote:
(snip)
>
> Bruno wrote: "You don't need these getters and setters. Python has
> support for
> computed attributes (look for 'property'), so until you need to
> control
> access, a plain attribute
On Mon, 22 Oct 2007 21:24:40 +0200, Fabian López wrote:
> I am parsing an XML file that includes chineses characters, like ^
> uu啖啖才是w.扉L锍才是 or ヘアアイロン... The problem is that I get an error like:
> UnicodeEncodeerror:'charmap' codec can't encode characters in
> position..
You say you are *parsing*
Steven Bethard a écrit :
(snip)
> In Python, you can use property() to make method calls look like
> attribute access. This could be necessary if you have an existing API
> that used public attributes, but changes to your code require those
> attributes to do additional calculations now.
>
> B
> Is this possible or do I really have to install two complete but
> separate Pythons although most of the files are the same?
That configuration is not explicitly supported in the build process.
Notice that the "Python libraries" are not entirely platform
independent. On Sparc64, the byte code f
George Neuner schrieb:
>> 5. This is arguable and trivial, but i think TeX judged as a computer
>> language in particular its syntax, on esthetical grounds, sucks in
>> major ways.
>
> No one except you thinks TeX is a "computer language".
But it is.
It's Turing-complete.
And yes, it sucks in maj
[EMAIL PROTECTED] writes:
> On 22 oct, 20:35, Paul Rudin <[EMAIL PROTECTED]> wrote:
>
>> import operator
>> def fact(x):
>> return reduce(operator.mul, xrange(1,x))
>
> Maybe:
>
> import operator
> def fact(x):
> return reduce(operator.mul, xrange(2, x+1), 1)
Or just:
reduce(operator.mul
On Oct 22, 1:23 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Steven Bethard a écrit :
> (snip)
>
> > In Python, you can use property() to make method calls look like
> > attribute access. This could be necessary if you have an existing API
> > that used public attributes, but changes to yo
Thanks Mark, the code is like this. The attrib name is the problem:
from lxml import etree
context = etree.iterparse("file.xml")
for action, elem in context:
if elem.tag == "weblog":
print action, elem.tag , elem.attrib["name"],elem.attrib["url"],
elem.attrib["rssUrl"]
And the xml fi
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Oct 22, 4:18 am, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> I'm trying to parse with pyparsing but the grammar I'm using is
>> somewhat
>> unorthodox. I need to be able to pars
On Oct 22, 3:38 pm, Paul Rudin <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
> > On 22 oct, 20:35, Paul Rudin <[EMAIL PROTECTED]> wrote:
>
> >> import operator
> >> def fact(x):
> >> return reduce(operator.mul, xrange(1,x))
>
> > Maybe:
>
> > import operator
> > def fact(x):
> > re
On Oct 22, 3:22 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > def fact(x):
> > if x == 0 or x == 1:
> > return 1
> > else:
> > return reduce(operator.mul, xrange(1,x+1))
>
> If obscurity is the name of the game,
>
>>>> from operator import mul
>>>> fact = lambda i: i
> On Behalf Of Fabian Lopez
> like ^�u�u啖啖才是�w.���扉L锍才是�� or ヘアアイロン... The problem is that
I get
Just thought I'd point out here that the second string is Japanese, not
Chinese.
>From your second post, it appears that you've parsed the text without
problems -- it's when you go to print them out
On Oct 22, 11:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > You wrote: " can't think of a single reason why you would ever want to
> > do this,
> > since your "list of method and property names" would be just as
> > verbose as just typing the actual python code."
>
> > I don't think I un
On Oct 17, 8:00 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Wed, 17 Oct 2007 23:12:15 +, Paul Hankin wrote:
> > 'if x' doesn't test if x exists, it tests if x when cast to a bool is
> > True.
>
> To be pedantic:
>
> Python doesn't have type casts. bool(x) doesn't cast
#Intro
print "*"
print "WELCOME TO THE POPULATION GROWTH CALCULATOR"
print "*"
print "This program will predict the size of a population of organisms."
print
print
organisms=inp
On 22 okt 2007, at 16.45, Robert Rawlins - Think Blue wrote:
> Thanks for your time Gabriel,
>
> That certainly looks to be the type of thing that I'm looking to
> achieve, however, I forgot to mention I'm running this on a Linux
> platform and not a Win32 one :-( Sorry.
>
> I'm sure similar
On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minisall wrote:
> #Intro
> print "*"
> print "WELCOME TO THE POPULATION GROWTH CALCULATOR"
> print "*"
>
> print "This program will predict the size o
On Oct 22, 4:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Oct 22, 3:38 pm, Paul Rudin <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > [EMAIL PROTECTED] writes:
> > > On 22 oct, 20:35, Paul Rudin <[EMAIL PROTECTED]> wrote:
>
> > >> import operator
> > >> def fact(x):
> > >> return reduce(
Hi,
I'm trying to learn regular expressions, but I am having trouble with
this. I want to search a document that has mixed data; however, the
last line of every entry has something like C5H4N4O3 or CH5N3.ClH.
All of the letters are upper case and there will always be numbers and
possibly one .
H
On Oct 22, 5:22 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minisall wrote:
> > #Intro
> > print "*"
> > print "WELCOME TO THE POPULATION GROWTH CALCULATOR"
> > print "**
>> If obscurity is the name of the game,
>>
>>>>> from operator import mul
>>>>> fact = lambda i: i > 1 and reduce(mul, xrange(1,i+1)) or i
>> >= 0 and 1 or None
>>>>> for i in xrange(-2,10): print '%i! = %s' % (i, fact(i))
>>
>> My eyes hurt after reading that...as the order of operat
On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minisall wrote:
> I'm having problems with my for loop here to calculate estimated
> population output to a table.
The code you have posted has inconsistent indentation. It won't run as
you supply it.
> Instead of knowing how much I want to
> loop it,
Travis Oliphant wrote:
> Hi all,
>
> I think the latest patch for fixing Issue 708374 (adding offset to mmap)
> should be committed to SVN.
>
> I will do it, if nobody opposes the plan. I think it is a very
> important addition and greatly increases the capability of the mmap module.
>
> Than
On Oct 16, 9:51 am, Roberto Bonvallet <[EMAIL PROTECTED]> wrote:
> For example, in Spanish, "ü" (u with umlaut) should be represented as
> "u", but in German, it should be represented as "ue".
>
> pingüino -> pinguino
> Frühstück -> Fruehstueck
>
> I'd like that web applications (e.g. blogs
On Mon, 22 Oct 2007 22:29:38 +, patrick.waldo wrote:
> I'm trying to learn regular expressions, but I am having trouble with
> this. I want to search a document that has mixed data; however, the
> last line of every entry has something like C5H4N4O3 or CH5N3.ClH.
> All of the letters are uppe
On Oct 22, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Oct 22, 5:22 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minisall wrote:
> > > #Intro
> > > print "*"
> > >
Robert,
the answer could not have been shorter, but I got exactly the
information I was looking for :-)
Thank you so much!
Just a single followup question:
> > Or do I have to split each problem myself to make use of the
> > parallelism?
>
> Pretty much.
Does "pretty much" imply that actually *som
On Mon, 22 Oct 2007 08:54:02 +, james_027 wrote:
> hi,
>
> i have a function that I could like to call, but to make it more dynamic
> I am constructing a string first that could equivalent to the name of
> the function I wish to call.
That is not the right solution to dynamic functions. The
On Oct 22, 5:39 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> >> If obscurity is the name of the game,
>
> >>>>> from operator import mul
> >>>>> fact = lambda i: i > 1 and reduce(mul, xrange(1,i+1)) or i
> >> >= 0 and 1 or None
> >>>>> for i in xrange(-2,10): print '%i! = %s' % (i, fact(
On Mon, 22 Oct 2007 23:16:38 +, Steven D'Aprano wrote:
>> how could I call a_string as function?
>
> Others have suggested eval() and exec. Both will work, but have MAJOR
> security implications.
Oh, and they are seriously slower too.
>>> import timeit
>>> timeit.Timer('f("2.3")',
... 'f =
Bruno Desthuilliers wrote:
> Steven Bethard a écrit :
> (snip)
>> In Python, you can use property() to make method calls look like
>> attribute access. This could be necessary if you have an existing API
>> that used public attributes, but changes to your code require those
>> attributes to do
[EMAIL PROTECTED] wrote:
> Robert,
> the answer could not have been shorter, but I got exactly the
> information I was looking for :-)
> Thank you so much!
>
> Just a single followup question:
>>> Or do I have to split each problem myself to make use of the
>>> parallelism?
>> Pretty much.
> Does
hi everyone, i'm very new to python and to this forum. i'm actually
just trying to work through the tutorial on webpy.org. so far, so
good, but as i tried to incorporate a postgresql database into the
demo web app i'm receiving this error print out:
Traceback (most recent call last):
File "/us
Hi,
I am sort of in a jam here. I am using the PsycoPG2 library to read
data out of a windows XP based PostGIS / PostGreSQL database but I am
apparently unable to write (update or insert) even though I am able to
read (select)
I am using PsycoPG2 2.0.6 (psycopg2-2.0.6.win32-py2.5-pg8.2.4-
releas
> Still, why do you want None instead of raisng an exception
> (as is the case in other factorial implementations)?
A null value is as good/bad as raising an exception in my book.
Since you can't do math on a None object, any attempt to do so
will raise an exception:
>>> 42 + fact(-1)
I genera
I am trying to use this cool script that some MIT guy wrote and it just
does not work, I get a stream of errors when I try to run it. It is
supposed to visit a URL and snag all of the pictures on the site. Here is
the script:
http://web.mit.edu/pgbovine/www/image-harvester/image-harvester.py
He
Thanks, everyone! Using everyone's suggestions and points, the program
is working great now. Here's the updated code.
:)
import math
def main():
#Declare and initialize variables
#starting number of organisms
organisms = 0
#average daily population increase as %
increase =
On Oct 22, 9:47 pm, Ohmster <[EMAIL PROTECTED]> wrote:
> I am trying to use this cool script that some MIT guy wrote and it just
> does not work, I get a stream of errors when I try to run it. It is
> supposed to visit a URL and snag all of the pictures on the site. Here is
> the script:http://web.
Ohmster wrote:
> I am trying to use this cool script that some MIT guy wrote and it just
> does not work, I get a stream of errors when I try to run it. It is
> supposed to visit a URL and snag all of the pictures on the site. Here is
> the script:
> http://web.mit.edu/pgbovine/www/image-harvest
Try:
$ python image-harvester.py
On 10/23/07, Ohmster <[EMAIL PROTECTED]> wrote:
>
> I am trying to use this cool script that some MIT guy wrote and it just
> does not work, I get a stream of errors when I try to run it. It is
> supposed to visit a URL and snag all of the pictures on the site. Her
On Oct 22, 2007, at 8:06 PM, [EMAIL PROTECTED] wrote:
> hi everyone, i'm very new to python and to this forum. i'm actually
> just trying to work through the tutorial on webpy.org. so far, so
> good, but as i tried to incorporate a postgresql database into the
> demo web app i'm receiving this e
On Oct 22, 2007, at 8:19 PM, David Michael Schruth, wrote:
> Hi,
>
> I am sort of in a jam here. I am using the PsycoPG2 library to read
> data out of a windows XP based PostGIS / PostGreSQL database but I am
> apparently unable to write (update or insert) even though I am able to
> read (select
Ohmster <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Here is my output when I try to run it on my Fedora 6 machine:
>
> [EMAIL PROTECTED] bench]$ image-harvester.py
> http://public.fotki.com/DaGennelman/
> /home/ohmster/scripts/image-harvester.py: line 59: from: command not
> found [E
Microsoft drops appeal of European antitrust case
template_bas
template_bas
The software giant, which faces a $1 billion fine, will make some of
its Windows operating system code available so developers can better
design products for it.
By Jim Puzzanghera, Los Angeles Times Staff Writer
11:43 AM P
Ohmster wrote:
> Here is my output when I try to run it on my Fedora 6 machine:
> [EMAIL PROTECTED] bench]$ image-harvester.py
> http://public.fotki.com/DaGennelman/
> /home/ohmster/scripts/image-harvester.py: line 59: from: command not found
Check line 59 in the python script and you see which c
Hiroshima,Nagasaki,Genocide in Australia and North America
http://countercurrents.org/holt221007.htm
It's The Oil
By Jim Holt
22 October, 2007
London Review Of Books
Iraq is 'unwinnable', a 'quagmire', a 'fiasco': so goes the received
opinion. But there is good reason to think that, from the B
On Oct 22, 9:12?pm, Shawn Minisall <[EMAIL PROTECTED]> wrote:
> Thanks, everyone! Using everyone's suggestions and points, the program
> is working great now.
Actually, it's not. I assume not printing the population
was a copy error.
But, by adding the "if (p>1):", you have now made
day 1 the
Steve Ackman <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
[snip]
> Did you bother reading the comments? If you had, you'd
> know that's not how you run it.
> When run as directed (and common sense dictates),
> it works fine.
[snip]
I figured it out, I have to run python I think fi
John McMonagle <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Your linux shell thinks it is running a shell script (from is not a
> valid command in bash).
>
> To execute this script with the python interpreter type (from a shell
> prompt):
>
> python image-harvester.py http://some.url.
"J.O. Aho" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Check line 59 in the python script and you see which command you are
> missing. I bet you didn't read what it said on the page
> http://web.mit.edu/pgbovine/www/image-harvester.htm
>
> Install the programs that mentioned on the pa
Adam Atlas <[EMAIL PROTECTED]> wrote in news:1193108392.089611.91170
@v29g2000prd.googlegroups.com:
> I think you're executing it as a shell script. Run "python image-
> harvester.py", or add "#!/usr/bin/env python" to the top of the file.
>
Hey that is a cool idea, I think I will try it. I foun
The time of fall
The fake anthrax letters
The absence of pentagon video, the most highly defended building
The thermate residue
The molten metal pools
The pyroclastic flow of dust
The shattering of the whole building into dust and small pieces
The spherical particles of molten iron with sulfur, pot
The time of fall
The fake anthrax letters
The absence of pentagon video, the most highly defended building
The thermate residue
The molten metal pools
The pyroclastic flow of dust
The shattering of the whole building into dust and small pieces
The spherical particles of molten iron with sulfur, pot
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> writes:
> That certainly looks to be the type of thing that I'm looking to
> achieve, however, I forgot to mention I'm running this on a Linux
> platform and not a Win32 one :-( Sorry.
If it's just one file, then yes, stat it in a loop with os.slee
Travis Oliphant <[EMAIL PROTECTED]> writes:
> I think the latest patch for fixing Issue 708374 (adding offset to
> mmap) should be committed to SVN.
I can't figure out what this is about from the issue tracker without
examining the patch. It looks like the patch has been accepted; could
you pleas
Hi,
Is there a way to track external processes launched by python on the
Mac? I am using subprocess module to launch the process.
Thanks
Sunil
--
http://mail.python.org/mailman/listinfo/python-list
In a message dated 10/22/2007 8:46:59 PM Central Daylight Time,
[EMAIL PROTECTED] writes:
> > Still, why do you want None instead of raisng an exception
> > (as is the case in other factorial implementations)?
>
> A null value is as good/bad as raising an exception in my book.
> Since you can'
Trying to figure out how to add login verfication. I believe it is
logging me in, but theres no way to really tell..any ideas? or
tutorials out there that can exaplain this to me?
Thanks
import urllib,urllib2,cookielib
passlst = open(passfile, 'r').readlines()
url="http://somesite";
cj = cookiel
hi:
i have a decorator given below.
def checkdb(web):
def decorator(func):
def proxyfunc(self, args=(), kw=None):
#DO STUFF with web
return func(self, *args, **kw)
return proxyfunc
return
On Oct 23, 3:09 pm, [EMAIL PROTECTED] wrote:
> Hi,
>
> Is there a way to track external processes launched by python on the
> Mac? I am using subprocess module to launch the process.
>
> Thanks
> Sunil
If using Python 2.3/2.4, you can use os.wait().
If using Python 2.5, there is also have os.wait
Fabian López wrote:
> Thanks Mark, the code is like this. The attrib name is the problem:
>
> from lxml import etree
>
> context = etree.iterparse("file.xml")
> for action, elem in context:
> if elem.tag == "weblog":
> print action, elem.tag , elem.attrib["name"],elem.attrib["url"],
101 - 193 of 193 matches
Mail list logo