Re: need some advice on x y plot

2005-10-21 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > i am running a query on a database and making a list of time, value > pairs > kinda like this > plot_points = ([time, value], [time, value], [time, value]) > gnuplot complains that it needs a float for one of the values. > i can plot just the value, and it shows up ( no x

subprocess exiting in an incomprehensible fashion

2005-10-21 Thread Will
I have this bit of code: #!/usr/bin/python import subprocess calc = subprocess.Popen("dc", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) max = 5 for value in range(1, max): calcout, calcerr = calc.communic

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steven Bethard
Andrew Jaffe wrote: > Hi, > > I have a class with various class-level variables which are used to > store global state information for all instances of a class. These are > set by a classmethod as in the following (in reality the setcvar method > is more complicated than this!): > > class sup(

Re: Binding a variable?

2005-10-21 Thread Mike Meyer
Paul Dale <[EMAIL PROTECTED]> writes: > Hi everyone, > > Is it possible to bind a list member or variable to a variable such that > > temp = 5 > > list = [ temp ] > > temp == 6 > > list > > would show > > list = [ 6 ] No. You need to either put a mutable in the list, or subclass list so that inde

Re: Python vs Ruby

2005-10-21 Thread Tom Anderson
On Fri, 21 Oct 2005, vdrab wrote: > You can tell everything is well in the world of dynamic languages when > someone posts a question with nuclear flame war potential like "python > vs. ruby" and after a while people go off singing hymns about the beauty > of Scheme... +1 QOTW > I love this p

Re: Searching for txt file and importing to ms access

2005-10-21 Thread J Correia
"Mark Line" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello! > > > I've also managed to connect to my access database, and just print out a > field in a table, but I cant find anywhere on the web that will help me to > import data? Any help would be great?! > > Another meth

Re: need some advice on x y plot

2005-10-21 Thread nephish
the time is DateTime.DateTime object from a mySQLdb query. the value is a number anywhere between 0 and 15. the datetime is formatted like 2005-10-20 08:40:34 i could strip it and make a timestamp out of it. but reading the number of seconds since january of 1970 doesn't make a neat chart. any su

Re: Binding a variable?

2005-10-21 Thread David Wahler
Paul Dale wrote: > Hi everyone, > > Is it possible to bind a list member or variable to a variable such that > > temp = 5 > > list = [ temp ] > > temp == 6 > > list > > would show > > list = [ 6 ] > > Thanks in advance? > > Paul Python doesn't have "variables" -- a statement like "temp = 5" just b

Re: How to get a raised exception from other thread

2005-10-21 Thread WalterHoward
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Nevermind. I found a better solution. I used shared memory to create > > a keep-alive flag. I then use the select function with a specified > > timeout, and recheck the keep-alive flag after each timeout. > > As Dennis points out, your original

Re: Binding a variable?

2005-10-21 Thread Tom Anderson
On Fri, 21 Oct 2005, Paul Dale wrote: > Is it possible to bind a list member or variable to a variable such that > > temp = 5 > list = [ temp ] > temp == 6 > list > > would show > > list = [ 6 ] As you know by now, no. Like any problem in programming, this can be solved with a layer of abstracti

Re: Help with language, dev tool selection

2005-10-21 Thread vasilijepetkovic
Further clarification: The pages will have to be pure static html pages (so no datasource will be driving generation of the pages). Therefore, I'd have to create 30,000 files. It's my understanding that almost every host should be able to serve a simple and static html code. Best, Vasa -- h

Re: need some advice on x y plot

2005-10-21 Thread William Park
[EMAIL PROTECTED] wrote: > the time is DateTime.DateTime object from a mySQLdb query. > the value is a number anywhere between 0 and 15. > the datetime is formatted like 2005-10-20 08:40:34 > > i could strip it and make a timestamp out of it. but reading the > number of seconds since january of 19

Re: Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve Holden wrote: > I'm trying to copy data from an Access database to PostgreSQL, as the > latter now appears to work well in the Windows environment. However I'm > having trouble with date columns. [...] > Here's the problem in a nutshell: > >

Re: Would there be support for a more general cmp/__cmp__

2005-10-21 Thread Christopher Subich
Antoon Pardon wrote: > It would be better if cmp would give an indication it > can't compare two objects instead of giving incorrect > and inconsistent results. If two objects aren't totally comparable, then using 'cmp' on them is ill-defined to begin with. The Standard Thing To Do is throw an

Re: Execute C code through Python

2005-10-21 Thread [EMAIL PROTECTED]
Grant Edwards wrote: > On 2005-10-21, Ernesto <[EMAIL PROTECTED]> wrote: > > > Thanks. Can anyone provide an example of using *subprocess* to run > > helloWorld.C through the python interpreter. > > No. You can't run a .C file Unless you have a C interpreter installed. e.g.: import os os.sy

Re: [python-win32] findwindow by its class name

2005-10-21 Thread Paul Moore
On 10/21/05, Steve Holden <[EMAIL PROTECTED]> wrote: > > Is there any way to know this windows' class name? I need to find it by [...] > I'm not saying it can'ty be done (which is a pity for you, because > that's usually a cue for someone to contradict me) but it's expecting > quite a lot of win32g

Shelve: got DBRunRecoveryError

2005-10-21 Thread Nemesis
Hi all, I'm having a problem with a shelve. I got (almost randomly) this error: Traceback (most recent call last): File "xpn.py", line 1082, in view_article self.remove_from_unreads(article_to_read) File "xpn.py", line 860, in remove_from_unreads articles[msgid]=article File "/usr/lo

Re: Python vs Ruby

2005-10-21 Thread Scott David Daniels
bruno modulix wrote: > ... Another language that failed to make it to the mainstream but is > worth giving a try is Smalltalk - the father of OOPLs (Simula being the > GrandFather). I would say Simula is the forefather of modern OOPLs, and Smalltalk is the toofather. --Scott David Daniels [EMAIL

Re: Help with language, dev tool selection

2005-10-21 Thread Maciej Dziardziel
[EMAIL PROTECTED] wrote: > 1)What programming language to use This is trivial task, whatever language you choose, will do it. Python too, and its also simple and popular, so i can recommend it. > 2)What development tools to use You don't need nothing beyond python interpreter. > 3)

Re: reload fails if module not in sys.path

2005-10-21 Thread Lonnie Princehouse
It's not just load_module. Reload fails on modules imported normally if their paths are no longer in sys.path. Easy to reproduce example: bash$ mkdir module_dir bash$ touch module_dir/plugin.py bash$ python Python 2.4.1 (#1, Sep 25 2005, 15:12:45) [GCC 3.4.3 20041125 (Gentoo 3.4.3-r1, ssp-3.4.3-

how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the form order to do that ? My point is for the client to be able to re-read the modified data. Thanks, P

Re: reload fails if module not in sys.path

2005-10-21 Thread Lonnie Princehouse
> That's OK, but you may find fiddling with sys.path is more productive :-) Yeah, that's what I'm doing and it works just fine. When I stumbled over this behavior yesterday it seemed (and still does) like a low-priority bug in reload. I was hoping a guru would reply with something like, "Of cour

Re: need some advice on x y plot

2005-10-21 Thread Grant Edwards
On 2005-10-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > the time is DateTime.DateTime object from a mySQLdb query. the > value is a number anywhere between 0 and 15. the datetime is > formatted like 2005-10-20 08:40:34 > > i could strip it and make a timestamp out of it. but reading > the nu

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
PS: If my question is not clear, I am trying to "share" the form between the client and server. just as many sites out there allow you to modify existing data: 1) the server pops up a form with your data in it. 2) the client can modify it and submit. I know this is a _basic_ question, sorry. Phi

Re: Set an environment variable

2005-10-21 Thread Grant Edwards
On 2005-10-21, Mike Meyer <[EMAIL PROTECTED]> wrote: The closest thing you can do is that: -myScript.py-- print 'export MY_VARIABLE=value' -- -myScript.sh---

Re: Python variables are bound to types when used?

2005-10-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > >>reset your brain: >> >>http://effbot.org/zone/python-objects.htm > > > Neat link. > > Can you expand on this: > > >>a type (returned by type(x)) > > ... > >>You cannot change the type. > > > Especially what's going on here: > > >>>

RE: [python-win32] findwindow by its class name

2005-10-21 Thread James Hu
Thanks a lot! Yes, GetHandle() can return 'wxWindowClassNR', which is nice, but all wxPython apps return wxWindowClassNR as well, so when I Post Message, it goes to itself. James -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Moore Sent: Friday, Oc

Re: how to modify text in html form from python

2005-10-21 Thread Paul McNett
Philippe C. Martin wrote: > PS: If my question is not clear, I am trying to "share" the form between the > client and server. > > just as many sites out there allow you to modify existing data: > 1) the server pops up a form with your data in it. > 2) the client can modify it and submit. > > I kn

Re: newbie question about SocketServer

2005-10-21 Thread Steve Horsley
[EMAIL PROTECTED] wrote: > Is it just me or do the server_close() methods do squat? I'm primarily > working with a ThreadingTCPServer object and trying to create a simple > server that can shut itself down. But even simplest cases don't seem > to work. > > Admittedly I am trying it from within m

Re: Help with language, dev tool selection

2005-10-21 Thread [EMAIL PROTECTED]
Hi Vasilije, Try the Python 411 Podcast for a good introduction. http://www.awaretek.com/plf.html Cheers, Davy Mitchell http://www.latedecember.com -- http://mail.python.org/mailman/listinfo/python-list

python problems with dos lineendings in python-scripts

2005-10-21 Thread marco
hi folks, i can not run any python scripts with dos lineendings under cygwin's python. if i run such a scripts i get stupid syntax error messages from python. what can i do to run these scripts without changing the lineending of these scripts. regards marco pgpz3U7zraEvK.pgp Description: PGP

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > PS: If my question is not clear, I am trying to "share" the form between the > client and server. Yes, your question is not clear. And this statement doesn't clarify it. That you quoted the "share" shows you are probably aware of this, if not con

Re: subprocess exiting in an incomprehensible fashion

2005-10-21 Thread Maciej Dziardziel
Will wrote: > After the first number is input, the subprocess is exiting after the > first communicate. I do not understand why. As help(calc.communicate) says: Read data from stdout and stderr, until end-of-file is reached. Wait for process to _terminate_. > Any help would be much appreciated.

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Thanks Paul but I was not clear: the html page is separate from the python script, it calls the python script when the button is clicked. The indentation error must be because of my cut and paste. PS: My goal is to be able to exchange data between the server and the client (browser plugin) as I

Re: Set an environment variable

2005-10-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > My point: the OP wanted to know how to export an environment > variable to a child process. Either of the lines of code above > will do that, so what's with all the shellular shenanigans? Actually, the OP didn't say he wanted to export a variable to a c

Re: classmethods, class variables and subclassing

2005-10-21 Thread Ron Adam
Andrew Jaffe wrote: > Hi, > > I have a class with various class-level variables which are used to > store global state information for all instances of a class. These are > set by a classmethod as in the following (in reality the setcvar method > is more complicated than this!): > > class sup

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Mike, Here is what I am trying to do: WHAT -) a client opens his/her browser and click on some button which triggers my plugin -) the plugin starts to communicate with a server on some URL. -) the communication between the server and the client involves a few exchanges: data from client

python gc performance in large apps

2005-10-21 Thread Robby Dermody
Hey guys (thus begins a book of a post :), I'm in the process of writing a commercial VoIP call monitoring and recording application suite in python and pyrex. Basically, this software sits in a VoIP callcenter-type environment (complete with agent phones and VoIP servers), sniffs voice data o

Re: Set an environment variable

2005-10-21 Thread Grant Edwards
On 2005-10-21, Mike Meyer <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: >> My point: the OP wanted to know how to export an environment >> variable to a child process. Either of the lines of code above >> will do that, so what's with all the shellular shenanigans? > > Actu

How to add one month to datetime?

2005-10-21 Thread John W
Hello, I have been trying to figure out how to easily add just one month to a datetime object? For example if my datetime is: 1/31/2005 I want to get 2/28/2005 after adding one month. The max I can specify in a timedelta object is days.  However, since months vary in length, I can't just add 30

[ANNOUNCE] Twenty-sixth release of PythonCAD now available

2005-10-21 Thread Art Haas
I'm pleased to announce the twenty-sixth 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 feat

Re: Help with language, dev tool selection

2005-10-21 Thread Larry Bates
1) Python can do this easily 2) No tools required 3) Don't do it the way you describe. Here's what I would do: Load the information that you have in the text file into a MySQL database (MySQL import has tab delimited as its default so it is easy) and write a few lines of PHP to serve up the HTML

A question about searching with multiple strings

2005-10-21 Thread googleboy
Hi there. I have defined a class called Item with several (about 30 I think) different attributes (is that the right word in this context?). An abbreviated example of the code for this is: class Item(object): def __init__(self, height, length, function): params = locals

Re: Abstract Methods & Abstract Class

2005-10-21 Thread Terry Hancock
On Thursday 20 October 2005 03:32 am, Gerald Klix wrote: > class AbstractBase: > def method(self): > raise NotImplementedError( "abstract method called" ) You should also consider using an "interface" instead of an abstract class -- they can serve much the same purpose. (Search for P

Redirect os.system output

2005-10-21 Thread jas
I would like to redirect the output from os.system to a variable, but am having trouble. I tried using os.popen(..).read() ...but that doesn't give me exactly what i want. ..this is windows by the way. For example: tmp = os.popen("hostname").read() ...works as expected. however, tmp = os.pope

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Mike, > > Here is what I am trying to do: > > WHAT > -) a client opens his/her browser and click on some button which triggers my > plugin > -) the plugin starts to communicate with a server on some URL. > -) the communication between th

Re: need some advice on x y plot

2005-10-21 Thread nephish
ok, i have a display, and its a work in progress. lemme get this straight. you used gp('set term png') is this an example of sending normal gnuplot commands? if so, are all of the gnuplot commands available ? thanks so much this is helping me out a lot here -- http://mail.python.org/mailman/li

RE: How to add one month to datetime?

2005-10-21 Thread Robert Brewer
John W wrote: > I have been trying to figure out how to > easily add just one month to a datetime > object? ...I was wondering if there is > simple way of doing this with built in > datetime object? If you want the same day in the succeeding month, you can try: newdate = datetime.date(olddate

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Mike Meyer wrote: > "Philippe C. Martin" <[EMAIL PROTECTED]> writes: > > > > Some. To continue clarifying: > > The phrase "cgi script" refers to a server-side script that is run in > response to the user clicking something on the client. That's what you > expect it to be, right? > Yes, the cgi

Re: need some advice on x y plot

2005-10-21 Thread Grant Edwards
On 2005-10-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > gp('set term png') > > is this an example of sending normal gnuplot commands? Yes. > if so, are all of the gnuplot commands available ? Yes. -- Grant Edwards grante Yow! Do you like "TENDER

Re: A question about searching with multiple strings

2005-10-21 Thread Mike Meyer
"googleboy" <[EMAIL PROTECTED]> writes: > for item in all_items: > > strItem = str(item) > > m = re.search(p[i], strItem, flags = re.I) > if m: > height = getattr(item, "height") > length = getattr(item, "length") > function = getattr(item

Re: HELP! py2exe error - No module named decimal

2005-10-21 Thread Chris
That was it. Thank you so much! Chris In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > FYI there is a separate newsgroup for py2exe at > gmane.comp.python.py2exe. You may want to post > there also. > > Just as a suggestion, put an import decimal at > the top of your program. It l

Re: How to add one month to datetime?

2005-10-21 Thread Bengt Richter
On Fri, 21 Oct 2005 14:01:14 -0700, "Robert Brewer" <[EMAIL PROTECTED]> wrote: >John W wrote: >> I have been trying to figure out how to >> easily add just one month to a datetime >> object? ...I was wondering if there is >> simple way of doing this with built in >> datetime object? > >If you want

Re: Python vs Ruby

2005-10-21 Thread Ed Jensen
Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > I have here a library (it's the client side of a client-server > interface including a pile of class definitions) which has > implementations in pure C++, Java and Python, taking about 3000, > 3500 and 1500 loc respectively. And there's an associated mod

Python cgi

2005-10-21 Thread jbrewer
I'm currently writing my first CGI script (in Python), and I keep getting an error I don't know how to address. I'm not sure if this is a Python or Apache error, but I suspect it's an Apache config thing. Anyway, in my code I need to upload a file, so in my HTML there's a line like File to upload

Re: Python cgi

2005-10-21 Thread Mitja Trampus
jbrewer wrote: > I'm currently writing my first CGI script (in Python), and I keep > getting an error I don't know how to address. I'm not sure if this is > a Python or Apache error, but I suspect it's an Apache config thing. I suspect it's neither :) Make sure your HTML form looks like -- http

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steven Bethard wrote: > Andrew Jaffe wrote: > > I'm not sure if I understand your goal here, but you can get different > behavior using super(). > > py> class sup(object): > ... cvar1 = None > ... cvar2 = None > ... @classmethod > ... def setcvar1(cls, val): > ... cls.cva

Re: fun with lambdas

2005-10-21 Thread Juan Pablo Romero
Thanks to all I settled with this: def partial1(f,b): return lambda a:f(a,b) def partial2(f,a): return lambda b:f(a,b) Juan Pablo 2005/10/20, Mike Meyer <[EMAIL PROTECTED]>: > Robert Kern <[EMAIL PROTECTED]> writes: > > Juan Pablo Romero wrote: > >> Hello! > >> > >> given the d

Re: Python variables are bound to types when used?

2005-10-21 Thread [EMAIL PROTECTED]
Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > Fredrik Lundh wrote: > > > >>reset your brain: > >> > >>http://effbot.org/zone/python-objects.htm > > > > > > Neat link. > > > > Can you expand on this: > > > > > >>a type (returned by type(x)) > > > > ... > > > >>You cannot change the typ

Re: Redirect os.system output

2005-10-21 Thread Daniel Schüle
maybe you should look at subprocess module I have one expamle, this is Linux though >>> import subprocess as sp >>> p1 = sp.Popen(["ls", "-l"], stdout = sp.PIPE) >>> p2 = sp.Popen(["wc", "-c"], stdin = p1.stdout, stdout = sp.PIPE) >>> print p2.stdout.read() 226 hth, Daniel -- http://m

Re: Python vs Ruby

2005-10-21 Thread Peter Hansen
Bryan wrote: > Dave Cook wrote: >> Cale? You mean Python has more ruffage? > > i think you mean "kale" not "cale". nothing like a hot bowl of tofu > kale soup while reading the recipes in the "python cookbook". Well, if he's going to talk about "ruffage" instead of "roughage", perhaps he real

Re: Redirect os.system output

2005-10-21 Thread Kent Johnson
jas wrote: > I would like to redirect the output from os.system to a variable, but > am having trouble. I tried using os.popen(..).read() ...but that > doesn't give me exactly what i want. Here is an example using subprocess: http://groups.google.com/group/comp.lang.python/msg/9fa3a3c287e8e2a3?hl

C replacement for Queue module

2005-10-21 Thread Jonathan Ellis
I'm working on an application that makes heavy use of Queue objects in a multithreaded environment. By "heavy" I mean "millions of calls to put and get, constituting ~20% of the app's run time." The profiler thinks that a significant amount of time is spent in this code -- not just a consumer wai

Re: Python vs Ruby

2005-10-21 Thread Kent Johnson
Casey Hawthorne wrote: > I have heard, but have not been able to verify that if a program is > about > 10,000 lines in C++ > it is about > 5,000 lines in Java > and it is about > 3,000 lines in Python (Ruby to?) My experience is that Java:Python is roughly 2:1, the highest I have seen (on small b

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
I feel fairly stupid ... but to my defense in the past 17 years of coding, i've only spent 3 days looking at web stuff: I now can understand how "writing" to an existing form field from a cgi script might not work: how would the browser know ?: unless there is a very sophisticated scheme there (as

Re: need some advice on x y plot

2005-10-21 Thread nephish
this is great, because the docs on gnuplots website are a bit easier for me to grasp. thanks so much for your time on this one. you really have helped me a lot. i will not get a change to work on this till monday. so i may have more questions then. This is sure a point in the right direction. than

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: >> You've got lots of stuff going on here. I count at least five programs >> and three network connections. How much is working, and which parts >> are you trying to do in Python? > > I am starting from existing applications (cross-platform - and in

Re: Python cgi

2005-10-21 Thread Mike Meyer
"jbrewer" <[EMAIL PROTECTED]> writes: > Also, I need to run an external program with my CGI script using > something like os.system with flags from input forms, which is a major > security risk. Is it simply enough to test for flag.isalnum() or > should I do more to prevent random programs from be

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > I feel fairly stupid ... but to my defense in the past 17 years of coding, > i've only spent 3 days looking at web stuff: > > I now can understand how "writing" to an existing form field from a cgi > script might not work: how would the browser kn

Re: how to modify text in html form from python

2005-10-21 Thread Paul Rubin
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > * HOW (if there's a better way let me know please) ** > As I have not found any better solution yet, I am trying to do the following > (on the server there is an html file and a cgi file) If I understand it, you're trying to use a smart ca

python -m pdb questions

2005-10-21 Thread Bryan
So I am new to the whole python thing, be nice. So I do a b /foo/foo.py :10 (if I do a foo.py:10 it says not in sys.path) Then a continue... my breakpoint isn't hit. but if I am in main.py and do a b /foo/main.py:10 I hit the breakpoint. also I can't get b fooMethod to ever take, always get no

Re: override a property

2005-10-21 Thread Bengt Richter
On Tue, 18 Oct 2005 08:00:51 +, Robin Becker <[EMAIL PROTECTED]> wrote: >Bruno Desthuilliers wrote: >> Robin Becker a écrit : >> >>> Is there a way to override a data property in the instance? Do I need >>> to create another class with the property changed? >> >> >> Do you mean attributes

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Paul, That won't cut it: The cards I use/code do not have RSA capabilities but only symmetrical algorithms (AES, 3DES, ). I use the same type of authentication you would see between a POS and a Smart Card (ex: B0' in France) So I cannot hookup to one of the standards (PKCS11 or CSP). Thanks

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Mike Meyer wrote: > "Philippe C. Martin" <[EMAIL PROTECTED]> writes: > >> I feel fairly stupid ... but to my defense in the past 17 years of >> coding, i've only spent 3 days looking at web stuff: >> >> I now can understand how "writing" to an existing form field from a cgi >> script might not wo

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Mike Meyer wrote: > > I don't know much about plugins. I believe they get started when the > page loads, which gives you a chance to do the authentication when you > want it done. Well not in this case actually: the user triggers the plugin which in turn open the url, so the connection is "owne

Re: how to modify text in html form from python

2005-10-21 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> I don't know much about plugins. I believe they get started when the >> page loads, which gives you a chance to do the authentication when you >> want it done. > Well not in this case actually: the user triggers the plugin whi

Re: how to modify text in html form from python

2005-10-21 Thread Philippe C. Martin
Mike, Again, thanks. By plugin I mean the browsers' extensions: ex: http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/#more-4. IE has the same type or resorts also to activeX components. Right now I know how to program that guy to open a url I guess I need to some t

Re: Microsoft Hatred FAQ

2005-10-21 Thread Roedy Green
On Thu, 20 Oct 2005 22:07:51 GMT, "Mike Schilling" <[EMAIL PROTECTED]> wrote or quoted : >his status >as employee gives him no additional rights or responsibilities in this >respect. It may not be so in law, but I think most moral codes put more onus on the employee than the average citizen. --

Re: Python vs Ruby

2005-10-21 Thread Bryan
Ed Jensen wrote: > Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > >>I have here a library (it's the client side of a client-server >>interface including a pile of class definitions) which has >>implementations in pure C++, Java and Python, taking about 3000, >>3500 and 1500 loc respectively. And the

Re: sort problem

2005-10-21 Thread Alex Martelli
Michele Petrazzo <[EMAIL PROTECTED]> wrote: > Lasse Vågsæther Karlsen wrote: > > How about: > > > > list.sort(key=lambda x: x[3]) > > > > Does that work? > > Yes, on my linux-test-box it work, but I my developer pc I don't have > the 2.4 yet. I think that this is a good reason for update :) Up

Re: Python vs Ruby

2005-10-21 Thread Alex Martelli
Amol Vaidya <[EMAIL PROTECTED]> wrote: > Hi. I am interested in learning a new programming language, and have been > debating whether to learn Ruby or Python. How do these compare and contrast > with one another, and what advantages does one language provide over the > other? I would like to consi

Re: override a property

2005-10-21 Thread Alex Martelli
Robin Becker <[EMAIL PROTECTED]> wrote: ... > in answer to Bengt & Bruno here is what I'm sort of playing with. Alex > suggests class change as an answer, but that looks really clunky to me. > I'm not sure what Changing class is indeed 'clunky', though it might have been necessary depending on

Re: How to add one month to datetime?

2005-10-21 Thread dellaq
Bengt Richter wrote: > The OP will still have to decide whether he likes the semantics ;-) > E.g., what does he really want as the date for "one month" after January 30 ? > > Regards, > Bengt Richter When dealing with bonds a common convention is to return the same day in the succeeding month if i

Re: C replacement for Queue module

2005-10-21 Thread Jason Lai
How about Python 2.4's collections.deque class? Supposedly it's thread-safe, and it's implemented in C. - Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-21 Thread Robert Boyd
On 10/19/05, Jason Stitt <[EMAIL PROTECTED]> wrote: > > How can we improve Python's competitiveness in this arena? "Pie"? Or > can we do even better than Lua? Ptooey! I'm sure I could really evangelize use of it at work were it called Ptooey ;) As if Plone, Zope, and (non-Python) Shibboleth were

Re: coloring a complex number

2005-10-21 Thread Brandon K
I'm not 100% sure about this, but from what it seems like, the reason method B worked, and not method a is because class foo(complex) is subclassing a metaclass. So if you do this, you can't init a meta class (try type(complex), it equals 'type' not 'complex'. type(complex()) yields 'complex'

Re: Python vs Ruby

2005-10-21 Thread Roy Smith
Robert Boyd <[EMAIL PROTECTED]> wrote: > As if Plone, Zope, and (non-Python) Shibboleth weren't getting me > enough funny looks. And I haven't even started telling co-workers > about Django. A couple of years ago, a head-hunter asked me if I knew Plone. I figured he was just being an idiot and d

Re: Python vs Ruby

2005-10-21 Thread Terry Hancock
On Friday 21 October 2005 04:25 pm, Ed Jensen wrote: > Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > > I have here a library (it's the client side of a client-server > > interface including a pile of class definitions) which has > > implementations in pure C++, Java and Python, taking about 3000, >

Re: coloring a complex number

2005-10-21 Thread Kent Johnson
Arthur wrote: > Spending the morning avoiding responsibilities, and seeing what it would > take to color some complex numbers. > > class color_complex(complex): > def __init__(self,*args,**kws): > complex.__init__(*args) > self.color=kws.get('color', 'BLUE'

Re: coloring a complex number

2005-10-21 Thread Bengt Richter
On Fri, 21 Oct 2005 20:55:47 -0500, Brandon K <[EMAIL PROTECTED]> wrote: >I'm not 100% sure about this, but from what it seems like, the reason >method B worked, and not method a is because class foo(complex) is >subclassing a metaclass. So if you do this, you can't init a meta class >(try typ

Re: Python vs Ruby

2005-10-21 Thread Kent Johnson
Bryan wrote: > i would not say sion's ratio of 5:1 is dubious. for what it's worth, > i've written i pretty complex program in jython over the last year. > jython compiles to java source code and the number of generated java > lines to the jython lines is 4:1. Ugh. The code generated by jytho

Re: DBM scalability

2005-10-21 Thread George Sakkis
"Paul Rubin" wrote: > "George Sakkis" <[EMAIL PROTECTED]> writes: > > I'm trying to create a dbm database with around 4.5 million entries > > but the existing dbm modules (dbhash, gdbm) don't seem to cut > > it. What happens is that the more entries are added, the more t

Module Importing Question

2005-10-21 Thread James Stroud
Hello All, I have two modules that I use interchangably depending on the circumstances. These modules are imported by yet another module. I want the "importation" of these two alternatives to be mutually exclusive and dependent on the state of the "outermost module" A diagram: mainApp ==i

Re: C replacement for Queue module

2005-10-21 Thread jepler
does collections.deque have a blocking popleft()? If not, it's not very suitable to replace Queue.Queue. Jeff pgp9S3BEmciKx.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-21 Thread Steven D'Aprano
On Thu, 20 Oct 2005 08:26:43 -0700, [EMAIL PROTECTED] wrote: > I am looking for the best and efficient way to replace the first word > in a str, like this: > "aa to become" -> "/aa/ to become" > I know I can use spilt and than join them > but I can also use regular expressions > and I sure there i

Re: Microsoft Hatred FAQ

2005-10-21 Thread Steven D'Aprano
On Thu, 20 Oct 2005 09:47:43 -0700, T Beck wrote: > So what I'm getting here is, that they abused their monopoly power to > secure their initial deal with IBM. No they didn't. They didn't have a monopoly -- they didn't even have a product. (Lying to IBM, while unethical, is not against the law.

Problem with py2exe

2005-10-21 Thread David
I am unable to use py2exe to create an executable, even on the simple sample that comes with the package. There seems to be a problem when it is copying files. The ‘build’ and ‘dist’ directories are created and populated, but there is no executable created. The error message says: setup.py r

access dictionary with preferred order ?

2005-10-21 Thread [EMAIL PROTECTED]
Hi, I am wondering if there is a dictionary data type that allows me to define the order of access when iterating it using items/keys etc. ? An example: a=dict(a=dict(), c=dict(), h=dict()) prefer=['e','h', 'a'] for x in a.values: print x would give me {h:dict()}, {a:dict()}, then the rest whi

Re: C replacement for Queue module

2005-10-21 Thread Jonathan Ellis
[EMAIL PROTECTED] wrote: > does collections.deque have a blocking popleft()? If not, it's not very > suitable to replace Queue.Queue. It does not. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with py2exe

2005-10-21 Thread David
David wrote: > I am unable to use py2exe to create an executable, even on the simple > sample that comes with the package. There seems to be a problem when it > is copying files. The ‘build’ and ‘dist’ directories are created and > populated, but there is no executable created. The error mess

<    1   2   3   >