Re: Need Billy the Kid modul for windows

2006-07-07 Thread alex23
There is a nice modul called BtK at http://home.student.utwente.nl/g.v.berg/btk/ Has someone a link for btk-python on windows? Hey spooky, I haven't seen a Windows version of BtK anywhere. Have you seen these alternative wrappers around libpcap? Could they help you out? * pylibpcap:

Re: web app breakage with utf-8

2006-07-07 Thread Justin Ezequiel
replacing connection.character_set_name instance method seems to work but is this the correct/preferred way? import MySQLdb MySQLdb.get_client_info() '4.1.8' import sys sys.version '2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]' sys.platform 'win32' cred = {'passwd':

Re: How to increase the window sinze in python?

2006-07-07 Thread Fredrik Lundh
arvind wrote: i want to inctrease the window size in python and make it as big as normal window. at the same time i want to change the background colour of the screen. what's the solution? what window is this ? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Python SOAP and XML-RPC performance extremely low?

2006-07-07 Thread Fredrik Lundh
Jack wrote: When I try TooFPy with the SOAP and XML-RPC sample client code provided in TooFPy tutorials, a log entry shows up quickly on web server log window, but it takes a long time (5 seconds or longer) okay, 5 seconds... No, I'm not using any accelerator. The code is extremely simple

Help Needed !!! Browsing and Selecting More Than One File

2006-07-07 Thread Kilicaslan Fatih
Thank you very much for your indications. I've just subscribed for the group and even I don't know how to reply directly through mailing list. I will try to answer some of the questions you have asked about my program. Question: What has it to do with running your program with several file names

Re: Solution for XML-RPC over a proxy

2006-07-07 Thread Laszlo Nagy
Andrew R írta: All, I couldn't get my xml-rpc script to work via a corporate proxy. I noticed a few posts asking about this, and a very good helper script by jjk on starship. That script didn't work for me, and I think its a little old -- but it was very helpful to figure it out. The

switching users in cgi

2006-07-07 Thread s99999999s2003
hi i am developing cgi script that read a unix user name and password, After authentication, i need to switch the environment to that of that user and display his/her files in her/his home directory. As my web server runs as nobody , it cannot have access to files in the user's home. What is a

Re: Need Billy the Kid modul for windows

2006-07-07 Thread spooky
Hey, Have you seen these alternative wrappers around libpcap? Could they help you out? * pylibpcap: http://pylibpcap.sourceforge.net/ * Pcapy: http://oss.coresecurity.com/projects/pcapy.html There's also libdnet, which has Python bindings: * libdnet: http://libdnet.sourceforge.net/ Hope

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Fredrik Lundh
Antoon Pardon wrote: have any of your my mental model of how Python works is more important than how it actually works ever had a point ? Be free to correct me. But just suggesting that I'm wrong doesn't help me in changing my mental model. over the years, enough people have wasted enough

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Piet van Oostrum
Terry Reedy [EMAIL PROTECTED] (TR) wrote: TR Antoon Pardon [EMAIL PROTECTED] wrote in message TR news:[EMAIL PROTECTED] And if Nested variables are harmfull, TR I don't know if anyone said that they were, but Guido obviously does not TR think so, or he would not have added them. So skip

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Piet van Oostrum
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 the lefthand variable AP depends on whether the lefthand side is a simple variable or AP more complicated. What do you mean with `the

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Fredrik Lundh
Antoon I'm no nincompoop, but I play one on the internet Pardon wrote: I don't see the contradiction. That Namespaces and names lookup are fundamentel parts of the Python language, doesn't mean that the right behaviour can't be implemented in multiple ways and doesn't contradict that a

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Fredrik Lundh
Piet van Oostrum wrote: There is no big difference I think. Only Python doesn't have syntax for the former. Older versions of Python didn't even have nested scopes. arbitrarily nested scopes, at least. the old local/global/builtin approach (the LGB rule) is of course a kind of nesting; the

know reference name in instance

2006-07-07 Thread pipehappy
Hello: Is it possible for an instance know its name used by other part of program. I mean like this: class test: def __init__(self): pass when some one writes x = test() then one of attribute of x contain the name x Is it possible? I expect someone can tell me how to do it. --

Re: know reference name in instance

2006-07-07 Thread Fredrik Lundh
pipehappy wrote: Is it possible for an instance know its name used by other part of program. I mean like this: class test: def __init__(self): pass when some one writes x = test() then one of attribute of x contain the name x Is it possible? not really. and what

Re: Solution for XML-RPC over a proxy

2006-07-07 Thread Stefan Krah
* Andrew R [EMAIL PROTECTED] wrote: All, I couldn't get my xml-rpc script to work via a corporate proxy. I noticed a few posts asking about this, and a very good helper script by jjk on starship. That script didn't work for me, and I think its a little old -- but it was very helpful

Announcement : Octavia

2006-07-07 Thread sreekant
Hi folks I just released a text to midi converter. Have a look at http://sourceforge.net/projects/octavia http://sourceforge.net/project/showfiles.php?group_id=171815 It uses a text description of music and runs the body of the music source file in python, leaving full facilities of python in

Re: Python SOAP and XML-RPC performance extremely low?

2006-07-07 Thread Jack
Ha! Thanks Fredrik for the big hint :) I wasn't careful when reading that page. Was in too much of a hurry to try the code :) and a 5 as the second argument in the greeting call. I wonder what that does ? ;-) (if you need a hint, look for waits the given number of seconds on this page:

Re: poplib Q

2006-07-07 Thread SuperHik
Neil Hodgson wrote: SuperHik: I did ofc, but I noticed something strange... *my* socket module really doesn't have SSL object, even tho it's listed in the documentation... (not the online docs, but docs that came with my Python version) ffs how can that be! You are probably using

Re: I thought I'd 'got' globals but...

2006-07-07 Thread meridian
Thanks Bruno. Not only do you give solutions to my problem but also throw in great MVC tutorials too. You're a gent. I'm using controller - A CherryPy app views - Cheetah Templating for the html data model - mostly SQLite DB using pysqlite also Config It's only a desk-web app for single-user,

multinormal distribution

2006-07-07 Thread TG
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 taken from a multinormal

How to increase the window sinze in python?

2006-07-07 Thread arvind
hi all, i want to inctrease the window size in python and make it as big as normal window. at the same time i want to change the background colour of the screen. what's the solution? -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a time series analysis package in python - advice or assistance sought

2006-07-07 Thread bearophileHUGS
Ray Tomes: My package will have the following capabilities: 1. Able to read time series data in a variety of formats. 2. Able to create, manipulate and save time series files. 3. Able to do vector arithmetic on time series, including dozens of functions. 4. Loop and macro facilities to

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Bruno Desthuilliers
Antoon Pardon wrote: On 2006-07-06, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Antoon Pardon wrote: On 2006-07-05, Piet van Oostrum [EMAIL PROTECTED] wrote: It's not about finding a name/identifier, it's about the difference between (re)binding a name and mutating an object. AP The two

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Jack
I just did some testing between CherryPy's web server and lighttpd. My test was very simple and I used ab.exe for this purpose. CherryPy web server can serve about 140 simple request / second, while lighttpd can handle around 400 concurrent requests. You haven't really said much about your

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Bruno Desthuilliers
Piet van Oostrum wrote: (snip) There is no big difference I think. Only Python doesn't have syntax for the former. Older versions of Python didn't even have nested scopes. maybe it was a mistake to add them. Certainly not. Nested scopes allow closures, which allow decorators and lot of *very*

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Bruno Desthuilliers
Antoon Pardon wrote: On 2006-07-06, Piet van Oostrum [EMAIL PROTECTED] wrote: AP Aren't we now talking about implementation details? Sure the compilor AP can set things up so that local names are bound to the local scope and AP so the same code can be used. But it seems somewhere was made the

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Fredrik Lundh
Bruno Desthuilliers wrote: Certainly not. Nested scopes allow closures, which allow decorators and lot of *very* useful things. decorators can be trivially implemented as classes, of course. it's a bit unfortunate that many people seem to think that decorators *have* to be implemented as

Re: I thought I'd 'got' globals but...

2006-07-07 Thread Bruno Desthuilliers
meridian wrote: Thanks Bruno. Not only do you give solutions to my problem but also throw in great MVC tutorials too. You're a gent. (blush) I'm using controller - A CherryPy app views - Cheetah Templating for the html data model - mostly SQLite DB using pysqlite also Config It's

Re: handling unicode data

2006-07-07 Thread Filipe
Dennis Lee Bieber wrote: If I interpret a short Google search, DB-Library might date back to the original Sybase core from which M$ SQL Server was spawned. M$'s site recommends /not/ using DB-Library but to use ODBC/OLEDB methods instead -- something about ODBC being extensible. Could be

Re: know reference name in instance

2006-07-07 Thread pipehappy
Fredrik Lundh wrote: pipehappy wrote: Is it possible for an instance know its name used by other part of program. I mean like this: class test: def __init__(self): pass when some one writes x = test() then one of attribute of x contain the name x Is it

Re: setting variables from a tuple NEWB

2006-07-07 Thread Steven D'Aprano
On Thu, 06 Jul 2006 04:20:01 -0700, manstey wrote: Hi, If I have a tuple like this: tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh')) is it possible to write code using tupGlob that is equivalent to: VOWELS = 'aeiou' CONS = ''bcdfgh' Why don't you just do that? VOWELS = 'aeiou' CONS

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Antoon Pardon
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 the lefthand variable AP depends on whether the lefthand side is a simple

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Antoon Pardon
On 2006-07-07, Fredrik Lundh [EMAIL PROTECTED] wrote: Antoon I'm no nincompoop, but I play one on the internet Pardon wrote: I don't see the contradiction. That Namespaces and names lookup are fundamentel parts of the Python language, doesn't mean that the right behaviour can't be

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Antoon Pardon
On 2006-07-07, Fredrik Lundh [EMAIL PROTECTED] wrote: Antoon Pardon wrote: have any of your my mental model of how Python works is more important than how it actually works ever had a point ? Be free to correct me. But just suggesting that I'm wrong doesn't help me in changing my mental

Re: Making a time series analysis package in python - advice or assistance sought

2006-07-07 Thread beliavsky
Ray Tomes wrote: Hi Folks I am an old codger who has much experience with computers in the distant past before all this object oriented stuff. Also I have loads of software in such languages as FORTRAN and BASIC, QBASIC etc that is very useful except that it really doesn't like to run on

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Tim Williams
On 07/07/06, Jack [EMAIL PROTECTED] wrote: I just did some testing between CherryPy's web server and lighttpd. My test was very simple and I used ab.exe for this purpose. CherryPy web server can serve about 140 simple request / second, while lighttpd can handle around 400 concurrent requests.

COM Makepy Question

2006-07-07 Thread gregarican
Using Pythonwin's COM Makepy utility I created a COM wrapper around an OCX file that's used to communicate with a magstripe card reader. The wrapper was created without incident and I can invoke any get type of method without a problem. But whenever I attempt to invoke any of the set type of

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Bruno Desthuilliers
Fredrik Lundh wrote: Bruno Desthuilliers wrote: Certainly not. Nested scopes allow closures, which allow decorators and lot of *very* useful things. decorators can be trivially implemented as classes, of course. it's a bit unfortunate that many people seem to think that decorators

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Gerard Flanagan
Tim Williams wrote: On 07/07/06, Jack [EMAIL PROTECTED] wrote: I just did some testing between CherryPy's web server and lighttpd. My test was very simple and I used ab.exe for this purpose. CherryPy web server can serve about 140 simple request / second, while lighttpd can handle around

Re: multithreading and shared dictionary

2006-07-07 Thread placid
Stéphane Ninin wrote: Hello, Probably a stupid question, but I am not a multithreading expert... I want to share a dictionary between several threads. Actually, I will wrap the dictionary in a class and want to protect the sensitive accesses with locks. The problem is I am not sure which

Re: wxPython and Linux dependencies

2006-07-07 Thread Frithiof Andreas Jensen
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Error message cannot find wx infact I have wxpython in /usr/lib/ I installed it using the rpms given on the wxPython website. Do I need to set some path or something. I vaguely remember that wxWindows changed name to wxWidgets and

Re: searching for strings (in a tuple) in a string

2006-07-07 Thread Steven D'Aprano
On Thu, 06 Jul 2006 04:45:35 -0700, manstey wrote: Hi, I often use: a='yy' tup=('x','yy','asd') if a in tup: ... but I can't find an equivalent code for: a='xfsdfyysd asd x' tup=('x','yy','asd') if tup in a: ... Of course you can't. Strings don't contain tuples, since

RE: COM Makepy Question

2006-07-07 Thread Stefan Schukat
It seems that the ocx only works in a GUI environment. Perhaps you could try to embed the ocx in a pythonwin dialog which you create invisible since the dialog is then a control container see Python24\Lib\site-packages\pythonwin\pywin\Demos\ocx\ocxtest.py Stefan -Original

Re: eval to dict problems NEWB going crazy !

2006-07-07 Thread Steven D'Aprano
On Thu, 06 Jul 2006 03:34:32 -0700, manstey wrote: Hi, I have a text file called a.txt: # comments [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})] [('recId', 5), ('parse', {'pos': u'np', 'gen': u'm'})] [('recId', 7 ), ('parse', {'pos': u'np', 'gen': u'm'})] I read it using

Re: COM Makepy Question

2006-07-07 Thread gregarican
Gotcha. That makes perfect sense looking at the container references others made during my Googling adventures. Thanks! Stefan Schukat wrote: It seems that the ocx only works in a GUI environment. Perhaps you could try to embed the ocx in a pythonwin dialog which you create invisible since the

Re: wxPython and Linux dependencies

2006-07-07 Thread John Salerno
Nick Vatamaniuc wrote: To see where Python is looking for libraries open an interactive Python prompt and type import sys print sys.path After doing this you will see something like 'C:\\Python24\\lib\\site-packages\\wx-2.6-msw-ansi' (from my system) in the list, otherwise it isn't finding

Re: How to increase the window sinze in python?

2006-07-07 Thread John Salerno
Fredrik Lundh wrote: arvind wrote: i want to inctrease the window size in python and make it as big as normal window. at the same time i want to change the background colour of the screen. what's the solution? what window is this ? /F and what does as big as a normal window mean?

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Tim Williams
On 7 Jul 2006 06:27:43 -0700, Gerard Flanagan [EMAIL PROTECTED] wrote: Tim Williams wrote: On 07/07/06, Jack [EMAIL PROTECTED] wrote: I just did some testing between CherryPy's web server and lighttpd. My test was very simple and I used ab.exe for this purpose. CherryPy web server can

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Gregory Piñero
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? I guess you'd just copy however Java applets work? But run faster ;-) On 7/7/06, Shane Hathaway [EMAIL

Re: Making a time series analysis package in python - advice or assistance sought

2006-07-07 Thread Cameron Laird
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Ray Tomes wrote: Hi Folks I am an old codger who has much experience with computers in the distant past before all this object oriented stuff. Also I have loads of software in such languages as FORTRAN and BASIC, QBASIC etc that is very

Re: XML-RPC + SimpleHTTPServer question

2006-07-07 Thread jbrewer
Thank you very much, Fredrik. Your code and suggestion worked perfectly. I haven't benchmarked the plain HTTP post vs Binary wrapper, but strangely even using the naive Binary wrapper in Python sends files much faster than how Java + Axis wraps byte arrays in SOAP messages. Jeremy --

Re: wxPython and Linux dependencies

2006-07-07 Thread diffuser78
Let me explain and give you some more details. When I type python at the command prompt it shows the following info. python 2.3.4 (#Feb 01 2005), GCC 3.4.3 20041212 Red Hat 3.4.3-9.EL4 on linux2 In /usr/lib/ there are two directories called python 2.3 and python 2.4 In

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Gregory Piñero
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

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Rob Knapp
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? At a

Re: Launching multiple instances of a program with win32com.client.Dispatch?

2006-07-07 Thread tyler . schlosser
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 =

Re: Python SOAP and XML-RPC performance extremely low?

2006-07-07 Thread skip
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

Re: what's wrong here? (search script)

2006-07-07 Thread Michael Fisher
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 respective

Re: Python SOAP and XML-RPC performance extremely low?

2006-07-07 Thread Fredrik Lundh
[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

Re: Error type for shelve.open()

2006-07-07 Thread Simon Forman
[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: Traceback (most

how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
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

Re: how can I avoid abusing lists?

2006-07-07 Thread Rob Cowie
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 function

Re: eval to dict problems NEWB going crazy !

2006-07-07 Thread Ant
[('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

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Jack
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

Re: how can I avoid abusing lists?

2006-07-07 Thread Ant
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:...except: Likewise

Publishing ODBC database content as PDF

2006-07-07 Thread vasudevram
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.

Re: Python SOAP and XML-RPC performance extremely low?

2006-07-07 Thread skip
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 waiting 5

Re: how can I avoid abusing lists?

2006-07-07 Thread Simon Forman
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 will

Re: Publishing ODBC database content as PDF

2006-07-07 Thread vasudevram
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

Re: how can I avoid abusing lists?

2006-07-07 Thread Tim Chase
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:

Re: how can I avoid abusing lists?

2006-07-07 Thread Justin Azoff
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 very

Re: how can I avoid abusing lists?

2006-07-07 Thread Bruno Desthuilliers
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 increment(1)

Re: eval to dict problems NEWB going crazy !

2006-07-07 Thread Fredrik Lundh
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 scripts

Re: how can I avoid abusing lists?

2006-07-07 Thread [EMAIL PROTECTED]
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 will

pyXLWriter - grid lines and if formula

2006-07-07 Thread Luis P. Mendes
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

IRC questions!!

2006-07-07 Thread bruce
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 --

Re: How can I avoid abusing lists?

2006-07-07 Thread Klaus Alexander Seistrup
[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

Re: eval to dict problems NEWB going crazy !

2006-07-07 Thread Fredrik Lundh
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 untested

Re: how can I avoid abusing lists?

2006-07-07 Thread Peter Otten
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 will actually

template is calling 2 times

2006-07-07 Thread sanjeevdivekar
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

Re: IRC questions!!

2006-07-07 Thread Jon Clements
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 familiar with

Re: Error type for shelve.open()

2006-07-07 Thread aomighty
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

Re: pyXLWriter - grid lines and if formula

2006-07-07 Thread Gregory Piñero
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 what

Re: Amara: Where's my attribute?

2006-07-07 Thread uche . ogbuji
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

Parsing HTML--looking for info/comparison of HTMLParser vs. htmllib modules.

2006-07-07 Thread Kenneth McDonald
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.

Idea/request for new python mailing list/newsgroup.

2006-07-07 Thread Kenneth McDonald
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

Re: import

2006-07-07 Thread David Jackson
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

Re: how can I avoid abusing lists?

2006-07-07 Thread Jon Ribbens
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 enough

Re: Idea/request for new python mailing list/newsgroup.

2006-07-07 Thread Simon Forman
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. * Request

Re: multinormal distribution

2006-07-07 Thread Robert Kern
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 taken from

Re: how can I avoid abusing lists?

2006-07-07 Thread Simon Forman
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. key to

RE: IRC questions!!

2006-07-07 Thread bruce
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

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread fumanchu
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 line)

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Istvan Albert
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 need to

Re: how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
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

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread Jack
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'

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Terry Reedy
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 --

Re: pyXLWriter - grid lines and if formula

2006-07-07 Thread John Machin
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- how to

[ANNOUNCE] Thirty-third release of PythonCAD now available

2006-07-07 Thread Art Haas
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

Re: how can I avoid abusing lists?

2006-07-07 Thread Rob Cowie
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

  1   2   >