PIL show moves focus

2006-06-12 Thread elbertlev
Hi! I have an application where images (jpeg) have to be annotated by an operator. I use PIL like: import Image im = Image.open(Path) im.show() raw_input(Path + ':') Python runs in a console window. Then show starts some application (in my case Windows picture and FAX viewer) and the

PAMIE save an image

2006-06-09 Thread elbertlev
Hi, all! I'm writing a web page tester. The page is designed in such a way, that every time it creates an image file and displays it on the page. As soon as the file is downoladed it is deleted from the server. Using PAMIE I can download the page (by controlling an instance of IE) then images =

Re: Eclipse best/good or bad IDE for Python?

2005-12-01 Thread elbertlev
Eclipse is very-very slow. 3G P4 looks like 8M 86. It might be good for Java, but not for Python. BUT THIS IS 1 OF 2 IDE'S WHICH ALLOWS DEBUGGING OF MULTITHREADED APPLICATIONS. I prefer Eric or PythonWin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse best/good or bad IDE for Python?

2005-12-01 Thread elbertlev
Eclipse is very-very slow. 3G P4 looks like 8M 86. It might be good for Java, but not for Python. BUT THIS IS 1 OF 2 IDE'S WHICH ALLOWS DEBUGGING OF MULTITHREADED APPLICATIONS. I prefer Eric or PythonWin. -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2005-11-30 Thread elbertlev
Isaac Gouy wrote: Which stated Python is doing the heavy lifting with GMPY which is a compiled C program with a Python wrapper - but didn't seem to compare that to GMPY with a Java wrapper? You are missing the main idea: Java is by design a general purpose programming language. That's why all

Re: Aproximative string matching

2005-11-20 Thread elbertlev
This algorithm is called soundex. Here is one implementation example. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52213 here is another: http://effbot.org/librarybook/soundex.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: ownership problem?

2005-11-20 Thread elbertlev
Yes! Python uses auto garbage collection. As soon as the object reference count becomes 0 it is removed from existence. So the problem typical for C/C++: accessing pointers to already deleted objects does not exist in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: deleting registry keys and value

2005-11-19 Thread elbertlev
Looks OK to me. Just tried on my network - works with no exceptions -- http://mail.python.org/mailman/listinfo/python-list

Re: A way for closing an app monitor

2005-11-16 Thread elbertlev
//So my solution (need help on this) is that I have been thinking on letting the monitor listen for socket connection. Through this, the main app can tell him to close when the main app closes correctly. Do you think this is well thought? Any suggestions? This is the only solution you have to

Re: python and VisualFox dbf

2005-11-16 Thread elbertlev
A hint :) Is ADO supported? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-19 Thread elbertlev
Languages are very similar but Python has more cale avaliable. Much more. -- http://mail.python.org/mailman/listinfo/python-list

Re: date reformatting

2005-10-06 Thread elbertlev
setup.py install -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a Python dictionary inside a Python extension

2005-05-27 Thread elbertlev
1. Why not to simplfy the problem. You can extract values from the dictionari in python (this is fast). Put them in a list (fast). Pass the list to the extension, handle it and return to python. etc. 2. Use Pyrex. -- http://mail.python.org/mailman/listinfo/python-list

Re: cpu usage limit

2005-05-27 Thread elbertlev
I understand, that what I suggest does not solve the problem you want, but.. Why do you want to restrict CPU usage to 30%? In Windows I run CPU intesive therads on IDLE priority, while interfacand/or communication threads run on normal. This gives me best of two worlds: 1. I use 100% CPU (good)

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread elbertlev
Sure it does not. As well as C, unless you instaead of malloc use low level os-dependant APIs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread elbertlev
C programs also can be disassembled. Serious people do not consider braking the machine code harder byte-code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reg php equivalent Mail_mime Module in Python

2005-05-13 Thread elbertlev
Look for: http://sourceforge.net/projects/pymaillib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging overlapping spans/ranges

2005-05-10 Thread elbertlev
The linear method: You create an array - one bool per minute. For one day 24 * 60 entries is enough. Spans (Start, End) are in minutes from midnight. Set array slots in range(Start, End) to True for each input span. Scan the array and find metaspans - contiguous sequences of False. --

Re: Database backend?

2005-05-08 Thread elbertlev
Look for the packet called KirbyBase. Small, pythonic, text based files... -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie : checking semantics

2005-05-07 Thread elbertlev
I am new to python and was very enthustic about its possibilities when I discover that python is really what it is : just a scripting language. .. The fact that python doesn't check if the symbol ... is defined, is really bad ... 1. For a language like Python full static checking is

Re: database in python ?

2005-04-11 Thread elbertlev
[EMAIL PROTECTED] wrote: I need to build table which need searching data which needs more power then dictionary or list in python, can anyone help me what kind of database suitable for python light and easy to learn. Is mySQL a nice start with python ? It depends... mySQL is fine for more or

Dialogic bindings

2005-04-11 Thread elbertlev
Hi! Does somebody have bindings to Dialogic voice cards driver. I'm sure some people do have them, but could not find any reference. Ideally there sould be some framework for CT applications in Python. Any help would be greatly appreciated. --

Re: Threads and variable assignment

2005-04-11 Thread elbertlev
Theoretically you have to use lock, while accesing the isgood instance, but... practically noting bad can happen IN THIS PARTICULAR CASE, if you don't. Python uses Global Interpreter Lock. In other words only one thread is running at any particular moment. Thread scheduling is preemptive, but

Re: Help understanding code

2005-04-10 Thread elbertlev
Reading the language tututorial would help you a lot :( === what is the difference between pc and pc()? pc = getToolByName() - returnes a refference to a method pc is a refference to a method, pc() is a method invocation. numbers =

Re: Best editor?

2005-04-05 Thread elbertlev
Windows: textpad Linux: vim -- http://mail.python.org/mailman/listinfo/python-list

Re: threading.Event file descriptor

2005-04-03 Thread elbertlev
Nicolas Fleury wrote: Hi, Is there any way to get the file descriptor on Unix or handle on Windows associated internally with a threading.Event object? So that it can be used in a call to select or WaitForMultipleObjects. Thx and regards, Nicolas Good idea! But... There is no event

Re: threading.Event file descriptor

2005-04-03 Thread elbertlev
//And there's no handle at all? There is one (check thread_nt.h) you have to propagate HANDLE to Pythom level. That's why, you have to change the interpreter. Do not forget, that thread is a build-in module. //I wouldn't want to derive from Event since my goal would be to submit a patch to make

Re: Convert the contents of a string into name of variable

2005-03-24 Thread elbertlev
TRy db_row does exactly what you want to do. Slower, but more simple: ## #Sequence2Struct.py class Struct: pass def MakeStruct(seq, names): obj = Struct() if len(seq) != len(names): raise IndexError(seq and names are not the same length) for i

Re: Anonymus functions revisited

2005-03-22 Thread elbertlev
Please do not change the syntax. Better focus on the library. 1. There are already 3 constructs right now for this problem. 2. List comprehensions are used mostly in examples. At least I came to such conclusion reading the standard library modules. --

Re: Checking if port is in use.

2005-03-19 Thread elbertlev
How about this? try: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1) s.bind((HOST, PORT)) except socket.error, e: if e print address already in use -- http://mail.python.org/mailman/listinfo/python-list

Re: {SPAM} start a python application as a win NT service

2005-03-14 Thread elbertlev
I'm using windows 2003 small business server and I want to install my python programm as a NT (it's just an old name) service. Does anybody know how to do this? 1. you need win32 extensions installed; 2. you need py2exe (optional if you want to install the service on the machine with no Python)

Re: Speeding up CGIHTTPServer (Tim Roberts)

2005-03-08 Thread elbertlev
Starting a process on WIN98 is VERY slow. (On NT much faster the second time). If you really want to use WIN98, modify CGIHTTPServer.py in such a way, that branch #Other O.S. -- execute script in this process is executed. This way CGIHTTPServer is as fast as it gets. At least not slower then

Re: namespace collisions

2005-02-17 Thread elbertlev
John Lenton wrote: On Thu, Feb 17, 2005 at 06:20:36PM +, Will McGugan wrote: Hi, I'm accumulating a number of small functions, which I have sensibly put in a single file called 'util.py'. But it occurs to me that with such a generic name it could cause problems with other modules

Where is WSAEnumNetworkEvents???

2005-02-02 Thread elbertlev
I was trying to write an asyncronous TCP server for win32 using WSAEventSelect (which lives if win32file). Such events require WaitForMultipleObjects (which lives if win32event) and WSAEnumNetworkEvents WHICH IS NOT EXPOSED. This makes WSAEventSelect useless. Does somebody know how to add the

py-xmlrpc postpone question

2005-01-31 Thread elbertlev
Hi! I'm trying to use py-xmlrpc. All works fine (and very fast) in one-threaded case, but I really have to serve many clients. As advertised, py-xmlrpc supports non-blocking calls (via select). When request is received the handler is called with proper parameters. As I understood from reading

Re: smtplib bug with Windows XP

2005-01-24 Thread elbertlev
Try manually, but think about these options: a firewall that has suddenly been enabled, an SMTP server that now requires authentication, some kind of proxy like what virus scanners use (though why they would intercept outgoing mail I don't know)... -Peter I bet it was the firewall on XP.

Re: encryption/decryption help

2005-01-12 Thread elbertlev
For the problem described pycrypto is the best solution. Blowfish is simple and secure. The method you want to use is called security by obscurity. But chances are very high that the homebrewed scheme you will invent will not stand any serious crytoatack. First of all: both sides (sender and

pyXLwriter and jython

2005-01-12 Thread elbertlev
Hi! I was using pyXLwriter in C-python, but recently had to code in jython. Tried to port pyXLwriter to jython and it does not work. Did somebody uset this module with jython? -- http://mail.python.org/mailman/listinfo/python-list

Re: File locking is impossible in Windows? SOLUTION

2005-01-02 Thread elbertlev
Sure it will do if one of the processes needs read access only. Scenario when you need shared rw acces with locking: In the file you have records say 30 bytes long, 2 processes are reading/writing these records by: lock-read-unlock or lock-write-unlock . Both processes have to open the file with

Re: File locking is impossible in Windows?

2004-12-22 Thread elbertlev
I just have written the program in C, which does the same. It behaves almost the way you described. Tthe copy command gives such diagnostic: The process cannot access the file because another process has locked a portion of the file. 0 file(s) copied. BUT THE FILE IS ACTUALLY OVERWRITTEN.. I'm

Re: File locking is impossible in Windows? SOLUTION

2004-12-22 Thread elbertlev
Sure it will do if one of the processes needs read access only. Scenario when you need shared rw acces with locking: In the file you have records say 30 bytes long, 2 processes are reading/writing these records by: lock-read-unlock or lock-write-unlock . Both processes have to open the file with

Re: better lambda support in the future?

2004-12-17 Thread elbertlev
Lambda functions will become obsolette in the nearest future. This is the PLAN. -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for blocking on read of a real file (not socket or pipe)

2004-12-14 Thread elbertlev
I doubt that the recipe you recomended will work at all in the case of different processes. To do this right file has to be open in shared mode (by both programs). Python does not support shared access. In the case of one program, but different threads probably this will work. --

Re: M2Crypto for 2.4

2004-12-02 Thread elbertlev
//I will do it in the next day or two. Me too! Remember, this is a programmer and a manager telling you his plan. :) But, if I do not, nobody in my department will :( -- http://mail.python.org/mailman/listinfo/python-list