On Aug 3, 4:07 am, Terry Reedy wrote:
> Peter Otten wrote:
> > Steven D'Aprano wrote:
[...]
Fantastic question, answer & explanation, guys. Well done.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 2, 2009, at 5:36 AM, Steven D'Aprano wrote:
I have a series of subclasses like this:
class A(object):
def method(self, *args):
print "Lots of work gets done here in the base class"
class B(A):
def method(self, *args):
print "A little bit of work gets done in B"
The ninth PyWeek challenge will run between:
Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC)
The PyWeek challenge invites entrants to write a game in one week from
scratch either as an individual or in a team. Entries must be developed
in Python, during the challenge, and must
Mohan Parthasarathy schrieb:
I am a newbie and about a month old with Python. There is a wealth of
material about Python and I am really enjoying learning Python.
One thing that could have helped Python documentation is that instead of the
very "raw" doc string, it could have used something like
On Aug 2, 2:18 pm, Fred Atkinson wrote:
> On Sun, 02 Aug 2009 08:53:50 -0700, Scott David Daniels
>
> wrote:
> >Fred Atkinson wrote:
> >> How does one seed the rand() generator when retrieving random
> >> recordings in MySQL?
>
> >It is not entirely clear what you are asking. If you are
> On Fri, Jul 31, 2009 at 1:10 PM, kj wrote:
>> I'm pretty new to Python, and I like a lot overall, but I find the
>> documentation for Python rather poor, overall.
>>
>> I'm sure that Python experts don't have this problem: they have
>> internalized some good ways to access the documentation, are
I am a newbie and about a month old with Python. There is a wealth of
material about Python and I am really enjoying learning Python.
One thing that could have helped Python documentation is that instead of the
very "raw" doc string, it could have used something like PythonDoc (java doc
style) so
Diez B. Roggisch wrote:
> You should consider using setuptools. Then you get an egg that people
> can install, and you can define "console_scripts"-entry-points which
> will be installed into /usr/local/bin or similar locations.
Interesting, I think I need to have a play with that. The cross pl
On 8/2/2009 10:43 AM, Christian Heimes wrote:
Marcus Wanner wrote:
I believe that python is buffer overflow proof. In fact, I think that
even ctypes is overflow proof...
No, ctypes isn't buffer overflow proof. ctypes can break and crash a
Python interpreter easily.
Christian
I see. I thoug
Hi;
How do I search and replace something like this:
aLine = re.sub('[<]?[p]?[>]?[<]?[b]?[>]?', '', aLine)
where RE *only* looks for the possibility of "" at the beginning of the
string; that is, not the individual components as I have it coded above, but
the entire 3-character block?
TIA,
Victor
-
In <09bf4f17-40a5-4bad-81d3-1950545b7...@g6g2000vbr.googlegroups.com>
Carl Banks writes:
Thanks. Your remarks at least confirm that my impression was not
simply due to my noob ignorance: the keyboard-accessible docs are
indeed as poor as they look.
kynn
--
http://mail.python.org/mailman/list
What is the function to obtain the client browser's IP
address?
Fred
--
http://mail.python.org/mailman/listinfo/python-list
> MRAB (M) wrote:
>M> I wonder whether one of the workers is raising an exception, perhaps due
>M> to lack of memory, when there are large number of jobs to process.
But that wouldn't prevent the join. And you would probably get an
exception traceback printed.
I wonder if something fishy is
On Sun, 02 Aug 2009 08:11:22 -0700, Scott David Daniels
wrote:
>Piet van Oostrum wrote:
>>> Scott David Daniels (SDD) wrote:
>>> SDD> Stephen Cuppett (should have written in this order):
> "Fred Atkinson" wrote ...
>> Is there a pre-defined variable that returns the GET line...
On Sun, 02 Aug 2009 08:53:50 -0700, Scott David Daniels
wrote:
>Fred Atkinson wrote:
>> How does one seed the rand() generator when retrieving random
>> recordings in MySQL?
>
>It is not entirely clear what you are asking. If you are talking about
>MySQL's random number generator, you are
In article ,
MRAB wrote:
>Nobody wrote:
>> On Thu, 30 Jul 2009 10:29:09 -0700, rurpy wrote:
>>
regex = re.compile(r'[\w\-\.]+\.(?:us|au|de)')
>>> You might also want to consider that some country
>>> codes such as "co" for Columbia might match more than
>>> you want, for example:
>>>
>>>
Peter Chant schrieb:
Krishnakant wrote:
Have you considered creating a deb or rpm package for your application?
Most of the documentation for deb or rpm will talk about make files.
But even a distutil based python package (with a setup.py) can be made
into a deb package.
Then the your requirem
Krishnakant wrote:
> Have you considered creating a deb or rpm package for your application?
> Most of the documentation for deb or rpm will talk about make files.
> But even a distutil based python package (with a setup.py) can be made
> into a deb package.
> Then the your requirement will be sa
On Sun, 2009-08-02 at 20:21 +0100, Peter Chant wrote:
> What is a good way to do this? There are instructions on making modules at:
>
> http://docs.python.org/distutils/setupscript.html
>
> however, what do you do if you don't want a module? I'm thinking of where
> I'd like to split the code in
> NighterNet (N) wrote:
>N> Here the full code.
>N> flashpolicy.xml
>N> [[[
>N>
>N>
>N>
>N>
>N> ]]]
>N> flashpolicytest_server3x.py
>N> [[[
>N> #!/usr/local/bin/python
>N> '''
>N> Still under testing...
>N> python version 3.x.x
>N> '''
>N> import socket
>N> import threading
>N> impor
What is a good way to do this? There are instructions on making modules at:
http://docs.python.org/distutils/setupscript.html
however, what do you do if you don't want a module? I'm thinking of where
I'd like to split the code into several files and have a build / setup
script put it together a
> golu (g) wrote:
>g> Hi,
>g> i started learning cgi few days ago in python and everything went
>g> fine until i started getting the follwing error
>g> "
>g> The server encountered an internal error and was unable to complete
>g> your request. Either the server is overloaded or there was an
> Fred Atkinson (FA) wrote:
>FA>What is the function to obtain the client browser's IP
>FA> address?
You mean in a web server?
The following should work (and was posted by me not long ago):
from os import getenv
ip = (getenv("HTTP_CLIENT_IP") or
getenv("HTTP_X_FORWARDED_FOR")
ma3mju wrote:
On 2 Aug, 15:48, ma3mju wrote:
On 31 July, 11:34, MRAB wrote:
ma3mju wrote:
Hi all,
I'm having trouble with multiprocessing I'm using it to speed up some
simulations, I find for large queues when the process reaches the
poison pill it does not exit whereas for smaller queues
Maybe your python2.5 not working good!?
But, I use python 2.6 , and i use this for your problem:
import urllib
html = urllib.urlopen("http://www.rediff.com/";).read()
print html
If you want use authenticate then...
You make working urllib2 and use this
>>>auth = urllib2.Request(auth_uri, authreq_d
Peter Otten wrote:
Steven D'Aprano wrote:
I'm looking for a way to hide the generation of objects from the caller,
so I could do something like this:
from Module import factory() as a # a == "Object #1"
from Module import factory() as b # b == "Object #2"
except of course that syntax is il
On 2 Aug, 15:48, ma3mju wrote:
> On 31 July, 11:34, MRAB wrote:
>
>
>
> > ma3mju wrote:
> > > Hi all,
>
> > > I'm having trouble with multiprocessing I'm using it to speed up some
> > > simulations, I find for large queues when the process reaches the
> > > poison pill it does not exit whereas fo
Fred Atkinson wrote:
How does one seed the rand() generator when retrieving random
recordings in MySQL?
It is not entirely clear what you are asking. If you are talking about
MySQL's random number generator, you are talking in the wrong newsgroup.
If you are talking about Python's, d
On Sun, 02 Aug 2009 13:50:14 +, Jizzai wrote:
> Is a _pure_ python program buffer overflow proof?
It's supposed to be.
> For example in C++ you can declare a char[9] to hold user input. If the
> user inputs 10+ chars a buffer overflow occurs.
>
> In python, I cannot seem to find a way to de
Piet van Oostrum wrote:
Scott David Daniels (SDD) wrote:
SDD> Stephen Cuppett (should have written in this order):
"Fred Atkinson" wrote ...
Is there a pre-defined variable that returns the GET line...
os.environment('QUERY_STRING')
SDD> Maybe you mean:
SDD> os.environ['USER']
Let's t
On 31 July, 11:34, MRAB wrote:
> ma3mju wrote:
> > Hi all,
>
> > I'm having trouble with multiprocessing I'm using it to speed up some
> > simulations, I find for large queues when the process reaches the
> > poison pill it does not exit whereas for smaller queues it works
> > without any problems
On 31 July, 11:27, Piet van Oostrum wrote:
> > ma3mju (m) wrote:
> >m> Hi all,
> >m> I'm having trouble with multiprocessing I'm using it to speed up some
> >m> simulations, I find for large queues when the process reaches the
> >m> poison pill it does not exit whereas for smaller queues it w
Marcus Wanner wrote:
I believe that python is buffer overflow proof. In fact, I think that
even ctypes is overflow proof...
No, ctypes isn't buffer overflow proof. ctypes can break and crash a
Python interpreter easily.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
On 8/2/2009 9:42 AM, Fred Atkinson wrote:
How does one seed the rand() generator when retrieving random
recordings in MySQL?
Regards,
Fred
something like:
import random, time
random.seed(time.time())
#not actual record access code:
sqlite3.recordaccessfuction(recordid =
On 8/2/2009 9:50 AM, Jizzai wrote:
Is a _pure_ python program buffer overflow proof?
For example in C++ you can declare a char[9] to hold user input.
If the user inputs 10+ chars a buffer overflow occurs.
In python, I cannot seem to find a way to define/restrict a string length.
This is probabl
"PAK WEB"
www.pak-web-pages.blogspot.com
"PAK WEB TV"
www.pak-web-pages.blogspot.com
"PAK WEBSITES"
www.pak-web-pages.blogspot.com
"PAK WEB DIRECTORY"
www.pak-web-pages.blogspot.com
"PAK WEB HOSTING"
www.pak-web-pages.blogspot.com
"PAK WEB HOST"
www.pak-web-pages.blogspot.com
"PAK
Is a _pure_ python program buffer overflow proof?
For example in C++ you can declare a char[9] to hold user input.
If the user inputs 10+ chars a buffer overflow occurs.
In python, I cannot seem to find a way to define/restrict a string length.
This is probably by design and raises the topic in
Call for Papers and ParticipationIFL 2009Seton Hall UniversitySOUTH ORANGE, NJ, USAhttp://tltc.shu.edu/blogs/projects/IFL2009/Register at: http://tltc.shu.edu/blogs/projects/IFL2009/registration.html* NEW *Registration and talk submission extended to August 23, 2009! ***The 21st
In article ,
Jean-Michel Pichavant wrote:
>Nobody wrote:
>> On Fri, 10 Jul 2009 09:23:54 +, garabik-news-2005-05 wrote:
>>
>>
> I would like to learn a way of changing the colour of a particular
> part of the output text. I've tried the following
>
On Unix operating systems t
In article ,
J. Cliff Dyer wrote:
>On Fri, 2009-07-17 at 20:53 +, Albert van der Horst wrote:
>> Because unlike in algol 68 in python whitespace is relevant,
>> we could get by with requiring whitespace:
>> x= -q # okay
>> a> 8 ** -2
Michael M Mason wrote:
I'm running Python 3.1 on Vista and I can't figure out how to add my own
directory to sys.path.
The docs suggest that I can either add it to the PYTHONPATH environment
variable or to the PythonPath key in the registry. However, PYTHONPATH
doesn't exist, and updating t
On Sun, Aug 2, 2009 at 5:36 AM, Steven
D'Aprano wrote:
> I have a series of subclasses like this:
>
> class A(object):
> def method(self, *args):
> print "Lots of work gets done here in the base class"
>
> class B(A):
> def method(self, *args):
> print "A little bit of work gets
How does one seed the rand() generator when retrieving random
recordings in MySQL?
Regards,
Fred
--
http://mail.python.org/mailman/listinfo/python-list
I have a series of subclasses like this:
class A(object):
def method(self, *args):
print "Lots of work gets done here in the base class"
class B(A):
def method(self, *args):
print "A little bit of work gets done in B"
super(B, self).method(*args)
class C(B):
d
wrote:
KNode cannot parse your From-string correctly. Strange.
> Peter Otten <__pete...@web.de> writes:
>> >>> import sys
>> >>> sys.modules["yadda"] = A()
>
> OMG wow. I bow to you. But I'm not sure whether that's bowing in
> awe or in terror.
I don't know who invented it, but it's an o
On 8/1/2009 9:31 PM, sturlamolden wrote:
- Python and C programmers use lists and arrays similarly.
I'm guessing that's because of the brackets...
Marcus
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten <__pete...@web.de> writes:
> >>> import sys
> >>> sys.modules["yadda"] = A()
OMG wow. I bow to you. But I'm not sure whether that's bowing in
awe or in terror.
--
http://mail.python.org/mailman/listinfo/python-list
Michael M Mason wrote:
"Mark Lawrence" wrote in message
news:mailman.4130.1249203322.8015.python-l...@python.org...
Be careful, I'm screwed things up on several occasions by placing a
file on PYTHONPATH that overrides a file in the standard library,
test.py being my favourite!
Thanks. Sure
On Sun, 02 Aug 2009 12:33:03 +0200, Peter Otten wrote:
> How about
[snip]
import sys
sys.modules["yadda"] = A()
Perfect! That's exactly the sort of thing I'm looking for.
Thanks for everyone who answered.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> I would like to generate a new object each time I import a name from a
> module, rather than getting the same object each time. For example,
> currently I might do something like this:
>
> # Module
> count = 0
> def factory():
> # Generate a unique object each time th
sturlamolden wrote:
On 20 Jul, 18:27, Phillip B Oldham wrote:
We're not looking to start any arguments or religious wars and we're
not asking that python be changed into something its not. We'd simply
like to understand the decision behind the lists and tuple structures.
We feel that in n
Simon wrote:
Okay I will fix my code and include "self" and see what happens. I
know I tried that before and got another error which I suspect was
another newbie error.
The idea behind the init_Pre is that I can put custom code here to
customize the __init__ instead of creating a new subclass.
Barak, Ron wrote:
Hi Dave,
It seems like I don't understand your solution.
I use the (appatched) soapAPI.py as the wrapper to parsing.pyc.
However, if I do (for instance):
$ python -u parsing.pyc -U aaa
The last line of the output is (as expected):
return_code: 12 ; params: {'username': 'aaa'
"Mark Lawrence" wrote in message
news:mailman.4130.1249203322.8015.python-l...@python.org...
Be careful, I'm screwed things up on several occasions by placing a file
on PYTHONPATH that overrides a file in the standard library, test.py being
my favourite!
Thanks. Sure enough, I've already got
Steven D'Aprano writes:
> I'm looking for a way to hide the generation of objects from the caller,
> so I could do something like this:
>
> from Module import factory() as a # a == "Object #1"
> from Module import factory() as b # b == "Object #2"
>
> except of course that syntax is illegal.
Michael M Mason wrote:
"Dave Angel" wrote in message
news:mailman.4120.1249172970.8015.python-l...@python.org...
Michael M Mason wrote:
I'm
running Python 3.1 on Vista and I can't figure out how to add my own
directory to sys.path.
Thanks to Jon, Piet, David and Dave for the responses.
> -Original Message-
> From: Dave Angel [mailto:da...@dejaviewphoto.com]
> Sent: Thursday, July 30, 2009 20:08
> To: Barak, Ron
> Cc: 'python-list@python.org'
> Subject: Re: Run pyc file without specifying python path ?
>
> Barak, Ron wrote:
> > Hi Dave,
> >
> > On second thoughts, I may
On Aug 2, 12:35 am, Steven D'Aprano wrote:
>
> I'm looking for a way to hide the generation of objects from the caller,
> so I could do something like this:
>
> from Module import factory() as a # a == "Object #1"
> from Module import factory() as b # b == "Object #2"
>
Explicit is better than
I would like to generate a new object each time I import a name from a
module, rather than getting the same object each time. For example,
currently I might do something like this:
# Module
count = 0
def factory():
# Generate a unique object each time this is called
global count
coun
On Sun, Aug 2, 2009 at 12:18 AM, Steven
D'Aprano wrote:
> On Sat, 01 Aug 2009 21:46:35 -0700, Chris Rebert wrote:
>
>>> Is there any way to install a custom type as a namespace?
>>
>> For classes/objects, yes, using metaclasses. See the __prepare__()
>> method in PEP 3115: http://www.python.org/dev
On Sat, 01 Aug 2009 21:46:35 -0700, Chris Rebert wrote:
>> Is there any way to install a custom type as a namespace?
>
> For classes/objects, yes, using metaclasses. See the __prepare__()
> method in PEP 3115: http://www.python.org/dev/peps/pep-3115/
Looks good, but that's Python 3 only, yes?
A
On Aug 1, 11:11 pm, golu wrote:
> Hi,
> i started learning cgi few days ago in python and everything went
> fine until i started getting the follwing error
> "
> The server encountered an internal error and was unable to complete
> your request. Either the server is overloaded or there was an err
"Dave Angel" wrote in message
news:mailman.4120.1249172970.8015.python-l...@python.org...
Michael M Mason wrote:
I'm running
Python 3.1 on Vista and I can't figure out how to add my own directory to
sys.path.
Thanks to Jon, Piet, David and Dave for the responses.
sys.path gets its values
"Fred Atkinson" wrote:
What is the function to obtain the client browser's IP
address?
Do you mean the external public IP to the Internet? When I wanted to log the
dynamic IP that my ADSL connection gets, I used whatismyip.com like this:
import urllib2
QUERY_URL = 'http://www.whatismy
64 matches
Mail list logo