Thanks Tim and Gerard for recommending karrigell.
I just checked it out. It is indeed a nice package. However, I didn't find
it
easier to learn or use than CherryPy though. I read through CherryPy
tutorials
and have got a good idea how to use it. I also read Karrigell docs. The way
Karrigell use
Alex Biddle wrote:
> Ah, so separate downloads then. At least now I know.
>
> Ergh... I checked the version of Python my current host is running and its
> 2.2.
>
> ...ergh
This is why you really want a VPS (virtual private server). The cost is
similar to a web host but you get to choose yo
Gregory Piñero wrote:
> I was just idley curious on what it would take to make a web plug-in
> for Pygame. I'm picturing it working the way my browser currently
> shows flash games. Is such an idea even possible? Has anyone
> attempted this?
I once played with a similar idea. Yes, it's possibl
I'm using CherryPy 2.2.1.
I just ran benchmark.py multiple times. The fastest it got is 195 req/sec,
with
50 threads. Python was taking 50+% CPU when the test was running.
> It would be good to know which version of CherryPy you are using. That
> wiki page is talking about the CP 2.0 branch; 2.1
Mike Kent wrote:
> [EMAIL PROTECTED] wrote:
> > Hello,Im using Python 2.4.2 and I'm starting a few very basic
> > programs,but theres two problems I've not found the answers for.
> > My first problem is I need code that will count the number of letters
> > in a string and return that number to a v
Alex Biddle wrote:
> Ah, so separate downloads then. At least now I know.
>
> Ergh... I checked the version of Python my current host is running and its
> 2.2.
>
> ...ergh
This is why you really want a VPS (virtual private server). The cost is
similar to a web host but you get to choose yo
Gregory Piñero wrote:
> Are there security issues too? Would you remove potentially harmful
> Python libraries for the plugin, not allow system calls, etc? Would
> you only allow file system access in one area?
Ah, so you also want to distribute untrusted Python code. That's fairly
hard. There
nagy wrote:
> I do the following. First create lists x,y,z. Then add an element to x
> using the augumented assignment operator. This causes all the other
> lists to be changed also.
> But if I use the assignment x=x+[4] instead of using the augumented
> assignment, the y and z lists do not change.
i have a short script that allows users to upload files, but when i try
to check for a valid filesize (using fileitem) i get '-1' i can't find
information about using filesize anywhere. any ideas?
code:
form = cgi.FieldStorage()
fileitem = form["datafile"]
print str(fileitem.filesize)
-h3m4n
I do the following. First create lists x,y,z. Then add an element to x
using the augumented assignment operator. This causes all the other
lists to be changed also.
But if I use the assignment x=x+[4] instead of using the augumented
assignment, the y and z lists do not change.
Why is that?
This doe
hi...
i'm trying to get the pages from a site "axess.stanford.edu", and i'm
running into problems. i've got some test code that allows me to get the 1st
few pages. i'm having an issue when i run into a page that somehow
interprets a url from a src of a frameset. i can't seem to mimic/implement
thi
Istvan Albert <[EMAIL PROTECTED]> wrote:
> Stéphane Ninin wrote:
>
> > Is a lock required in such a case ?
>
> I believe that assignment is atomic and would not need a lock.
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact a
John Machin wrote:
> Injecting a "private" method into a particular instance is not much more
> complicated:
>
> >>> def own(self, arg):
> ...print "own"
> ...self.ozz = arg
> ...
> >>> p = K()
> >>> import types
> >>> p.metho = types.MethodType(own, p)
> >>> p.metho("plugh")
> own
>
On Fri, 07 Jul 2006 09:39:38 -0700, Ant wrote:
>
>> [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})]
>> [('recId', 5), ('parse', {'pos': u'np', 'gen': u'm'})]
>> # line injected by a malicious user
>> "__import__('os').system('echo if I were bad I could do worse')"
>> [('recId', 7 ), ('pars
I need to detect whether the operating system I am running on (not the
Python version) is 64bit or 32bit. One requirement is that I need to
include support for non-Intel/AMD architectures.
The 2 ways I have thought detecting 64bit are:
1. struct.calcsize("P") == 8
2. '64' in os.uname()[4]
I'm
[EMAIL PROTECTED] wrote:
> Hello,Im using Python 2.4.2 and I'm starting a few very basic
> programs,but theres two problems I've not found the answers for.
> My first problem is I need code that will count the number of letters
> in a string and return that number to a variable.
Do you mean like t
On 8/07/2006 11:01 AM, tac-tics wrote:
> Experimenting, I found that
>
x.fun = lambda: fun(x)
>
> works as well. Any comments on this way?
>
Appears to work. Less typing for a no-argument method, but you need to
specify the argument list *twice* compared with *zero* times with the
types
Jim Anderson wrote:
> I'm running Kubuntu a derivative of Debian Linux. I'm using
> Python 2.4 and tcl/tk 8.4. I'm running Tkinter programs and
> they were running about a month ago. When I tried them again
> yesterday, I got the following message:
>
> > python ~/prog/python/iodef/iodef.py
> > Tr
Bump...not sure if it's bad etiquette here, I apologize if it is.
[EMAIL PROTECTED] wrote:
> Hi Roger,
>
> Thanks for the response, but DispatchEx seems to do the exact same
> thing as Dispatch in my case; there is still only one processID and one
> instance of my program (I forgot to mention tha
Experimenting, I found that
>>> x.fun = lambda: fun(x)
works as well. Any comments on this way?
--
http://mail.python.org/mailman/listinfo/python-list
Markus Wankus wrote:
> On Fri, 07 Jul 2006 19:41:36 -0400, Luis M. González <[EMAIL PROTECTED]>
> wrote:
> .
> .
> > OK, so I should include the global only if I plan to modify it.
> > Otherwise, I don't need to include it. Am I right?
> >
>
> Correct. Globals are always available to read from.
On 8/07/2006 9:29 AM, tac-tics wrote:
> Python is a crazy language when it comes to object versatility. I know
> I can do:
>
class test:
> ...def __init__(self):
> ... pass
x = test()
def fun():
> ... print "fun"
x.fun = fun
x.fun()
> fun
>
> However, expe
On Fri, 07 Jul 2006 19:57:02 +0200, Fredrik Lundh wrote:
> Steven D'Aprano wrote:
>
>> Personally, I would never use eval on any string I didn't write myself. If
>> I was thinking about evaluating a user-string, I would always write a
>> function to parse the string and accept only the specific s
[EMAIL PROTECTED] a écrit :
> I'm working with the following code. I included some tests to make it
> easy to see--if you run the code--what troubles I'm having.
>
> Can some one *please* splain me why str(obj) works but not print obj,
May have something to do with escape chars... I tried with:
On Fri, 07 Jul 2006 19:41:36 -0400, Luis M. González <[EMAIL PROTECTED]>
wrote:
.
.
> OK, so I should include the global only if I plan to modify it.
> Otherwise, I don't need to include it. Am I right?
>
Correct. Globals are always available to read from. You need to declare
them if you wan
In article <[EMAIL PROTECTED]>,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>while in most cases, the time needed for a handler thread to read the
>request line from the socket is below 1 millisecond, there are some
>cases this time is over severl thousand (or even higher) milliseconds.
>I'm j
> Functions are descriptors[1], and their __get__ method is used to bind
> them to a particular instance::
Thank you muchly.
--
http://mail.python.org/mailman/listinfo/python-list
> OK, so I should include the global only if I plan to modify it.
> Otherwise, I don't need to include it. Am I right?
I guess you could say that's true. I'm hardly an expert so I couldn't
say there aren't other potential ramifications. (anyone?)
But, as a rule I would declare the global varia
tac-tics wrote:
> Python is a crazy language when it comes to object versatility. I know
> I can do:
>
class test:
> ...def __init__(self):
> ... pass
x = test()
def fun():
> ... print "fun"
x.fun = fun
x.fun()
> fun
>
> However, experimenting shows that t
nate wrote:
> try this:
>
> gname = 'nate'
> def test():
>gname = 'amy'
>print gname
>
> test()
> print gname
>
> outputs:
> 'amy'
> 'nate'
>
> whereas this:
> gname = 'nate'
> def test():
>global gname
>gname = 'amy'
>print gname
>
> test()
> print gname
>
> outputs:
> 'amy'
>
try this:
gname = 'nate'
def test():
gname = 'amy'
print gname
test()
print gname
outputs:
'amy'
'nate'
whereas this:
gname = 'nate'
def test():
global gname
gname = 'amy'
print gname
test()
print gname
outputs:
'amy'
'amy'
Luis M. González wrote:
> Bruno Desthuilliers wrote:
Peter Otten a écrit :
(snip)
> I don't think your code is ugly. Anyway, here are two more alternatives:
>
>
types = [0] * 3
dispatch = [0, 0, 2, 0, 1]
for value in [1, 1, 0, 4]:
> ... types[dispatch[value]] += 1
> ...
>
types
>
> [3, 1, 0]
I wonder why I'm still pretendin
Python is a crazy language when it comes to object versatility. I know
I can do:
>>> class test:
...def __init__(self):
... pass
>>> x = test()
>>> def fun():
... print "fun"
>>> x.fun = fun
>>> x.fun()
fun
>>>
However, experimenting shows that these attached functions are not
bou
> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote:
>AP> On 2006-07-07, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote:
>>>
>AP> Could you maybe clarify what problem we are discussing? All I wrote
>AP> was that with an assignment the search for t
Bruno Desthuilliers wrote:
>
> def doIt(name=None):
> global gname
> if name is None:
> name = gname
> else:
> gname = name
>
Sorry for this very basic question, but I don't understand why I should
add the global into the function body before using it.
This function works even if I
[EMAIL PROTECTED] wrote:
> Hello,Im using Python 2.4.2 and I'm starting a few very basic
> programs,but theres two problems I've not found the answers for.
> My first problem is I need code that will count the number of letters
> in a string and return that number to a variable.
>>> s = "hello"
>
hi jon
i can sortof connect
however, to join "irc.freenode.net", it states i have to register...
the docs that i've seen say i have to :
/msg nickserv register
if my nickname is tom, do i do
/msg tom register(if foo is the passwd i want)
-or-
/msg tom register foo
or is there s
from HTMLParser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.TokenList = []
def handle_data( self,data):
data = data.strip()
if data and len(data) > 0:
self.TokenList.append(data)
Hello,Im using Python 2.4.2 and I'm starting a few very basic
programs,but theres two problems I've not found the answers for.
My first problem is I need code that will count the number of letters
in a string and return that number to a variable.
My second problem stems from the first as I need a f
> Nomen Nescio <[EMAIL PROTECTED]> (NN) wrote:
>NN> Thanks, I used the popen function which did some of what I want. Here is
>NN> the code I used:
>NN> from subprocess import *
>NN> output = Popen(["gpg", "--output", "--verify", "sigtest"],
>stdout=PIPE).communicate()[0]
You need a filenam
> > Is there some easy way to split a line, keeping together double-quoted
> > strings?
> import re
> rex = re.compile(r'(".*?"|\S)')
> sub = 'a b c "d e"'
> res = [x for x in re.split(rex, sub) if not x.isspace()][1:-1]
> print res # -> ['a', 'b', 'c', '"d e"']
instead of slicing the result out,
Just thought I'd mention it. As stated in some posts I put on the list
in the last few days, I'm working on a FastCGI server for python. Of
course its not as fast as lighttpd, but I think it still has many
applications. I've currently got a *very* simple prototype, but I
expect the finished module
Jim wrote:
> Is there some easy way to split a line, keeping together double-quoted
> strings?
>
> I'm thinking of
> 'a b c "d e"' --> ['a','b','c','d e']
> . I'd also like
> 'a b c "d \" e"' --> ['a','b','c','d " e']
> which omits any s.split('"')-based construct that I could come up with.
sorry, i didn't read all your post.
def test(s):
res = ['']
in_dbl = False
escaped = False
for c in s:
if in_dbl:
if escaped:
res[-1] += c
if c != '\\':
escaped = False
else:
res[-1]
I'm running Kubuntu a derivative of Debian Linux. I'm using
Python 2.4 and tcl/tk 8.4. I'm running Tkinter programs and
they were running about a month ago. When I tried them again
yesterday, I got the following message:
> python ~/prog/python/iodef/iodef.py
> Traceback (most recent call last):
Jim wrote:
> Is there some easy way to split a line, keeping together double-quoted
> strings?
using the re module I find this to probably be the easiest but in no
way is this gospel :)
import re
rex = re.compile(r'(".*?"|\S)')
sub = 'a b c "d e"'
res = [x for x in re.split(rex, sub) if not x.iss
I'm working with the following code. I included some tests to make it
easy to see--if you run the code--what troubles I'm having.
Can some one *please* splain me why str(obj) works but not print obj,
and why obj.__int__() works, but not int(obj). I just don't get it. :(
BTW: The reason I'm going
import re
re.findall('\".*\"|\S+', raw_input())
Jim wrote:
> Is there some easy way to split a line, keeping together double-quoted
> strings?
>
> I'm thinking of
> 'a b c "d e"' --> ['a','b','c','d e']
> . I'd also like
> 'a b c "d \" e"' --> ['a','b','c','d " e']
> which omits any s.split
On Tue, 04 Jul 2006 19:00:23 +0200, Dennis Benzinger wrote:
> Nomen Nescio wrote:
>> I'm running gpg in python to verify a signature. I can see that it is
>> working, because gpg is displaying the results.
>>
>> But I need a way to let the python script know this. According to the
>> gpg manual t
Stéphane Ninin wrote:
> Is a lock required in such a case ?
I believe that assignment is atomic and would not need a lock.
yet most of the other dictionary use cases are not threadsafe. For
example I suspect that you'd get an error if you were iterating through
the dictionary while another threa
Is there some easy way to split a line, keeping together double-quoted
strings?
I'm thinking of
'a b c "d e"' --> ['a','b','c','d e']
. I'd also like
'a b c "d \" e"' --> ['a','b','c','d " e']
which omits any s.split('"')-based construct that I could come up with.
Thank you,
JIm
--
http:
sanjeevdivekar a écrit :
> hi,
>
> i am newbie to python so i am trying to learn mod_python as my new
> development kit for my small web apps.
>
> i am getting strange result
Nothing strange here AFAICT.
> can anybody explain me.
> index.py
>
Thomas Nelson wrote:
> Thanks to everyone who posted. First, I don't think my question was
> clear enough: Rob Cowie, Ant, Simon Forman, [EMAIL PROTECTED], and Jon
> Ribbens offered solutions that don't quite work as-is, because I need
> multiple values to map to a single type. Tim Chase and Brun
No, your question was clear. With hindsght and a more thorough read of
your post I see my error ;^)
--
http://mail.python.org/mailman/listinfo/python-list
On 8/07/2006 3:43 AM, Luis P. Mendes wrote:
> Hi,
>
> I know that pyExelerator is the supported project now, but I can't use
> it because I'd need it to generate files from a web platform. Since I
> can not save a file to a file-like object, I have to use pyXLWriter.
>
> The problems are:
> 1- ho
Hi.
I'm pleased to announce the thirty-third development release of PythonCAD,
a CAD package for open-source software users. As the name implies,
PythonCAD is written entirely in Python. The goal of this project is
to create a fully scriptable drafting program that will match and eventually
exceed
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> others might be helped if you took the trouble of explaining
> what was wrong.
Aside from F., I tried to explain what I think you said wrong. Did you
read it? Did it help any?
tjr
--
http://mail.python.org/mai
You are right. Load test can be complicated because of the various patterns
of web applications and usages. The simple tests I mentioned and conducted
just
give myself some idea about the performance. Given the same set up, some
numbers should be comparable and reveal some aspects on web servers'
Thanks to everyone who posted. First, I don't think my question was
clear enough: Rob Cowie, Ant, Simon Forman, [EMAIL PROTECTED], and Jon
Ribbens offered solutions that don't quite work as-is, because I need
multiple values to map to a single type. Tim Chase and Bruno
Destuilliers both offer ver
> >> I will have to install lighttpd or other web servers.
> If it is a Python web server, it would be nice to extend it by putting code
> right into the web server. The performance should be better than FastCGI
> because it removes the cost to send the requests/replies back and forth.
you'll nee
Jack wrote:
> I wrote the last posting at late late night and I didn't know what I was
> typing at that time ;-p
>
> I didn't mean the test with CherryPy was not concurrent
> connections, or the test with lighttpd was all concurrent
> connections. I actually tried both concurrent (-c in ab command
given that nothing appears to be connecting..
should i have anything in the "group" window/dialog of the server setting...
-bruce
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf
Of Jon Clements
Sent: Friday, July 07, 2006 10:57 AM
To: python-list@python.org
S
Tim Chase wrote:
>
> You'll notice that the OP's code had multiple references to the
> same counter (0, 1, and 3 all mapped to type1)
>
> The OP's method was about as good as it gets. One might try to
D'oh! Didn't notice that.
Yeah, Thomas, if you really do want more than "type code" (i.e. k
TG wrote:
> hi there.
>
> I'm struggling with a function of numpy. Here it is :
>
> import numpy as NP
> mean = NP.array([0,0])
> cov = NP.array([[1,0.25],[0.25,1]])
> v = NP.random.multivariate_normal(mean,cov)
>
> Quite simple code : it is supposed to generate an array of two random
> values t
Kenneth McDonald wrote:
> Would a mailing list and newsgroup for "python contributions" be of
> interest? I currently have a module which is built on top of, and is
...
> I'd very much likes a ML/newsgroup wherein potential python contributors
> could
>
> * Post alphas/betas and seek feedback.
> *
In article <[EMAIL PROTECTED]>, Thomas Nelson wrote:
> This is exactly what I want to do: every time I encounter this kind of
> value in my code, increment the appropriate type by one. Then I'd like
> to go back and find out how many of each type there were. This way
> I've written seems simple e
Indeed you are correct...that is indeed TWO underscores and everything works
fine now. Thanks for pointing out the obvious...I thought it was a simple
problem. --DJ
"faulkner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> that should be __init__.py [TWO underscores].
> and you
Would a mailing list and newsgroup for "python contributions" be of
interest? I currently have a module which is built on top of, and is
intended to semantically replace, the 're' module. I use it constantly
to great advantage, but have not made it public for the following reasons:
* The API sh
I'm writing a program that will parse HTML and (mostly) convert it to
MediaWiki format. The two Python modules I'm aware of to do this are
HTMLParser and htmllib. However, I'm currently experiencing either real
or conceptual difficulty with both, and was wondering if I could get
some advice.
T
AdSR wrote:
> [EMAIL PROTECTED] wrote:
> > What is the actual problem you're trying to solve? If you just want to
> > force a namespace declaration in output (this is sually to support
> > QNames in content) the most well-known XML hack is to create a dummy
> > attribute with the needed prefix and
On 7/7/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I know that pyExelerator is the supported project now, but I can't use
> it because I'd need it to generate files from a web platform. Since I
> can not save a file to a file-like object, I have to use pyXLWriter.
I don't really know w
Yes, the problem was that I hadn't imported anydbm.error... it's
working now.
As for the AttributeError at the end, I talked to someone else, and he
looked at the source and said it was a bug in shelve. I think I will
report it to python.org.
Anyway, thanks :).
Simon Forman wrote:
> [EMAIL PROTEC
bruce wrote:
> hi...
>
> i'm trying to figure out what i have to do to setup mIRC to get the #python
> channel on IRC!!
>
> any pointers. the mIRC docs didn't get me very far.
>
> is there an irc.freenode.net that i need to connect to? how do i do it?
>
> thanks..
>
> -bruce
Assuming you're famil
hi,
i am newbie to python so i am trying to learn mod_python as my new
development kit for my small web apps.
i am getting strange result can anybody explain me.
*
index.py
Thomas Nelson wrote:
> I have this code:
> type1 = [0]
> type2 = [0]
> type3 = [0]
> map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is
> longer than this
>
> def increment(value):
> map[value][0] += 1
>
> increment(1)
> increment(1)
> increment(0)
> increment(4)
> #increment
Steven D'Aprano wrote:
> Personally, I would never use eval on any string I didn't write myself. If
> I was thinking about evaluating a user-string, I would always write a
> function to parse the string and accept only the specific sort of data I
> expected. In your case, a quick-and-dirty unteste
[EMAIL PROTECTED] wrote:
> if histogram.has_key(s):
> histogram[s] += 1
> else:
> histogram[s] = 1
I wonder if
histogram[s] = histogram.get(s, 0) + 1
would be more efficient...
Cheers,
--
Klaus Alexander Seistrup
hi...
i'm trying to figure out what i have to do to setup mIRC to get the #python
channel on IRC!!
any pointers. the mIRC docs didn't get me very far.
is there an irc.freenode.net that i need to connect to? how do i do it?
thanks..
-bruce
--
http://mail.python.org/mailman/listinfo/python-lis
Hi,
I know that pyExelerator is the supported project now, but I can't use
it because I'd need it to generate files from a web platform. Since I
can not save a file to a file-like object, I have to use pyXLWriter.
The problems are:
1- how to turn off/on the grid lines of each sheet?
2- I tried to
Thomas Nelson wrote:
> I have this code:
> type1 = [0]
> type2 = [0]
> type3 = [0]
> map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is
> longer than this
>
> def increment(value):
> map[value][0] += 1
>
> increment(1)
> increment(1)
> increment(0)
> increment(4)
> #incre
Ant wrote:
> It seems that there must be a way to use eval safely, as there are
> plenty of apps that embed python as a scripting language - and what's
> the point of an eval function if impossible to use safely, and you have
> to write your own Python parser!!
embedding python != accepting scrip
Thomas Nelson wrote:
> I have this code:
> type1 = [0]
> type2 = [0]
> type3 = [0]
> map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2}
Warning : you're shadowing the builtin map() function.
> # the real map is
> longer than this
>
> def increment(value):
> map[value][0] += 1
>
> incre
Thomas Nelson wrote:
> This is exactly what I want to do: every time I encounter this kind of
> value in my code, increment the appropriate type by one. Then I'd like
> to go back and find out how many of each type there were. This way
> I've written seems simple enough and effective, but it's ve
> Just forget the lists...
>
> counters = {0:0, 1:0, 2:0, 3:0, 4:0}
You'll notice that the OP's code had multiple references to the
same counter (0, 1, and 3 all mapped to type1)
The OP's method was about as good as it gets. One might try to
redo it with an accumulator class of some sort:
cl
Oops: The source indentation - tabs - is removed in the blog post, by
the LiveJournal software. You will need to insert them at the
appropriate places, for which you will need to know Python and
understand the code, at least the overall logic. I'll post the code as
a zip file (with some other sampl
Thomas Nelson wrote:
> I have this code:
> type1 = [0]
> type2 = [0]
> type3 = [0]
> map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is
> longer than this
>
> def increment(value):
> map[value][0] += 1
>
> increment(1)
> increment(1)
> increment(0)
> increment(4)
> #increm
>> As someone else noted though, a five-second delay for such a small
>> example doesn't seem to be an XML-RPC problem. A simple round-trip
>> to my XML-RPC server running on the localhost takes about 5
>> *milli*seconds.
Fredrik> even if the service you're connecting is wait
Publishing ODBC database content as PDF:
A blog post by me on how to do this, using my PDF conversion toolkit,
xtopdf.
This is sample code from my next upcoming release of xtopdf, which will
support more input formats, such as CSV, XLS, TDV and ODBC data.
http://jugad.livejournal.com/2006/07/07/
Rob Cowie wrote:
> Just forget the lists...
> counters = {0:0, 1:0, 2:0, 3:0, 4:0}
Or perhaps just use a list:
>>> counters = [0,0,0,0]
>>> def inc(v):
... counters[v] += 1
...
>>> inc(1)
>>> inc(1)
>>> inc(3)
>>> counters
[0, 2, 0, 1]
> The increment function should probably include a try:..
I wrote the last posting at late late night and I didn't know what I was
typing at that time ;-p
I didn't mean the test with CherryPy was not concurrent
connections, or the test with lighttpd was all concurrent
connections. I actually tried both concurrent (-c in ab command line)
and non-concurren
> [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})]
> [('recId', 5), ('parse', {'pos': u'np', 'gen': u'm'})]
> # line injected by a malicious user
> "__import__('os').system('echo if I were bad I could do worse')"
> [('recId', 7 ), ('parse', {'pos': u'np', 'gen': u'm'})]
I'm curious, if you
Just forget the lists...
counters = {0:0, 1:0, 2:0, 3:0, 4:0}
def increment(value):
counters[value] += 1
increment(1)
increment(1)
increment(3)
increment(4)
print counters[0]
>>> 0
print counters[1]
>>> 2
print coutners[2]
>>> 0
print counters[3]
>>> 1
print coutners[4]
>>> 1
The increment
I have this code:
type1 = [0]
type2 = [0]
type3 = [0]
map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is
longer than this
def increment(value):
map[value][0] += 1
increment(1)
increment(1)
increment(0)
increment(4)
#increment will actually be called many times through
[EMAIL PROTECTED] wrote:
> I tried what you said and it looked like maybe AttributeError, but that
> didn't work either.
>
> This code snippet:
>
> import shelve
> from traceback import format_exc
>
> try:
>db = shelve.open("meh", "r")
> except:
>print format_exc()
>
> Gave me this output:
[EMAIL PROTECTED] wrote:
> As someone else noted though, a five-second delay for such a small example
> doesn't seem to be an XML-RPC problem. A simple round-trip to my XML-RPC
> server running on the localhost takes about 5 *milli*seconds.
even if the service you're connecting is waiting 5 seco
Brendan Fay wrote:
> I figured it out. Is there any way to delete your own posts?
>
> Brendan Fay wrote:
>> Dear Someone:
>>
>> I have written a script that accesses the googleAPI through
>> pygoogle and saves each of the ten documents as a .txt file by using a
>> specific function for each
Jack> No, I'm not using any accelerator. The code is extremely simple
Jack> (from toofpy):
...
To use sgmlop, just download and install it. Your code doesn't need to
change. The xmlrpclib module detects its presence and uses it
automatically.
As someone else noted though, a five-se
Hi Roger,
Thanks for the response, but DispatchEx seems to do the exact same
thing as Dispatch in my case; there is still only one processID and one
instance of my program (I forgot to mention that I also need two unique
processID's to keep track of them).
I have also tried:
###
AB1 =
pythoncom
On Thu, 2006-07-06 at 14:24 -0400, Gregory Piñero wrote:
> Hi guys,
>
> I was just idley curious on what it would take to make a web plug-in
> for Pygame. I'm picturing it working the way my browser currently
> shows flash games. Is such an idea even possible? Has anyone
> attempted this?
>
A
Shane Wrote:
> Ah, so you also want to distribute untrusted Python code. That's fairly
> hard. There's a discussion about it on Python-Dev right now.
Well, I want to write a game in Pygame, and people can just go to my
website and play it within their browser. I guess that would be
untrusted co
1 - 100 of 152 matches
Mail list logo