Re: Comparing 2 similar strings?

2005-05-28 Thread Irmen de Jong
Rob W. W. Hooft wrote: > After reading this thread, I have wrapped up a different approach, > probably not what you were looking for, but it is very good for what I > wanted: comparing a command string typed by a user with all possible > commands a program can accept, to be able to do typo-corre

Re: Seti-like program

2005-06-01 Thread Irmen de Jong
Magnus Lycka wrote: > Both CORBA implementations and simpler things like PYRO could help, but > these systems are more aimed at enabling communication between programs > running in a distributed fashion, and I don't think they target tasks > such as job queues, starting and stopping jobs, or load

[ANN] Snakelets 1.41 and Frog 1.6

2005-06-03 Thread Irmen de Jong
nd more info on both projects here: http://snakelets.sourceforge.net/ Download: http://sourceforge.net/project/showfiles.php?group_id=41175 The detailed release notes have been added to the version section. Have fun! --Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Snakelets 1.41 and Frog 1.6

2005-06-04 Thread Irmen de Jong
thinfrog wrote: > It's very interesting, i'm glad to try. > > And it can access data by MYSQL/SQL or other database software? "it" meaning Snakelets, I assume. (because Frog, the blog server, doesn't use any database for storage) Snakelets does not contain ANY database connector. You can therefo

Problem on python 2.3.x was: [ANN] Snakelets 1.41 and Frog 1.6

2005-06-04 Thread Irmen de Jong
...darn, some users have reported that a strange problem occurs when running Snakelets 1.41 on Python 2.3.x (Python 2.4 is fine!) It seems that there is a bug in older versions of inspect.getmodule() and that bug causes Snakelets to stop working correctly on Python 2.3.x If you experience this bu

Re: Sending mail from 'current user' in Python

2005-06-11 Thread Irmen de Jong
Grig Gheorghiu wrote: > I use this function as a platform-independent way of finding out the > current user name: > > def get_username(): > if sys.platform == 'win32': > return win32api.GetUserName() > else: > return getpass.getuser() > [e:\]python Python 2.4.1 (#65, Mar

Re: Going crazy...

2005-06-13 Thread Irmen de Jong
Jan Danielsson wrote: > Hello all, > >I'm 100% sure that I saw an example which looked something like this > recently: > > a=(1, 2, 3, 4, 5, 6) b=(2, 3, 6) a - b > > (1, 4, 5) > >The only new language I have been involved in lately is Python. Is my > memory failing me, or h

Re: Python in Games (was RE: [Stackless] Python in Games)

2005-06-14 Thread Irmen de Jong
Patrick Down wrote: > My understanding is that the upcoming Civilization IV will have python > scripting. > Also, alledgedly the new BattleField II uses Python in a way... because I heard that you had to comment out a certain line in a certain .py file to remove the time limit of the demo :-) --

Re: Tiny/small/minimalist Python?

2007-07-02 Thread Irmen de Jong
Paul Rubin wrote: > rtk <[EMAIL PROTECTED]> writes: >> FYI.. I wanted a simple version of Python to run on an ancient DEC >> Alpha box. I got VMS Python 2.5 up and running but it is too slow to >> use. It takes *minutes* to get the interpreter prompt after typing >> 'python'! > > Something is w

Re: Python and ARexx (was Re: Tiny/small/minimalist Python?)

2007-07-03 Thread Irmen de Jong
Dennis Lee Bieber wrote: > On 3 Jul 2007 10:03:45 GMT, Jorgen Grahn > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> How does Python combine with ARexx? Can you control applications >> which provide an ARexx interface? >> > Irmen had supplied a Python module that ha

Re: socket: connection reset by server before client gets response

2007-07-07 Thread Irmen de Jong
ahlongxp wrote: > me again. > > "Connection reset by peer" happens about one in fifth. > I'm using python 2.5.1 and ubuntu 7.04. > > -- > ahlongxp > > Software College,Northeastern University,China > [EMAIL PROTECTED]://www.herofit.cn > > Post the code. Without it we can only help when o

Re: Best method for inter process communications

2007-07-17 Thread Irmen de Jong
JamesHoward wrote: > I am looking for a way of performing inter process communication over > XML between a python program and something else creating XML data. What is that "something else"? --irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickled objects over the network

2007-07-19 Thread Irmen de Jong
Rustom Mody wrote: > Sure pyro may be the solution but it may also be overkill > Why not use safe_load from the yaml module? In what way would Pyro be overkill where Yaml (also a module that you need to install separately) wouldn't be? -irmen -- http://mail.python.org/mailman/listinfo/python-lis

Re: how to transfer integer on socket?

2007-04-21 Thread Irmen de Jong
Frank Potter wrote: > Is there any easy way to transfer 4 bit integer on socket? I think you mean a 4-byte integer? Look at the struct module, anyway. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Select weirdness

2007-04-22 Thread Irmen de Jong
Ron Garret wrote: > Here's my code. It's a teeny weeny little HTTP server. (I'm not really > trying to reinvent the wheel here. What I'm really doing is writing a > dispatching proxy server, but this is the shortest way to illustrate the > problem I'm having): > > from SocketServer import *

Re: Select weirdness

2007-04-22 Thread Irmen de Jong
Ron Garret wrote: > I don't understand why socketserver calling select should matter. (And > BTW, there are no calls to select in SocketServer.py. I'm using > Python2.5.) You don't *need* a select at all. Socketserver just blocks on accept() and dispatches a handler on the new connection. >>

Re: Numbers and truth values

2007-04-28 Thread Irmen de Jong
Szabolcs wrote: > Newbie question: > > Why is 1 == True and 2 == True (even though 1 != 2), > but 'x' != True (even though if 'x': works)? Please check before you post: [E:\Projects]python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copy

Re: getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Irmen de Jong
Martin v. Löwis wrote: >> Is this a bug? > > Why don't you read the responses posted earlier? John Machin > replied (in <[EMAIL PROTECTED]>) > that you are mistaken: There is NO difference between the outcome > of os.path.getmtime between Py2.5 and Py2.4. It always did return > UTC, and always wi

Re: getmtime differs between Py2.5 and Py2.4

2007-05-08 Thread Irmen de Jong
Leo Kislov wrote: > > Let me guess: your E drive uses FAT filesystem? > > -- Leo > Nope, its all NTFS on my system. Anyway this doesn't matter, as the true cause is explained in another reply in this thread (bug in c runtime library of Python 2.4). --Irmen -- http://mail.python.org/mail

Re: Python Power Point Slides

2007-05-14 Thread Irmen de Jong
Krypto wrote: > Hi, > > I want to give a short presentation in my group about benefits of > python, why should one use python and some basic starting information > about python, about its data type, etc. > > Can somebody point me to the right references on the web. I have > searched a lot and I d

Re: Problem with socket.recv()

2007-05-17 Thread Irmen de Jong
xreload wrote: > Hello ! > > So, lets do : > sock.py "http://forums.childrenwithdiabetes.com/showthread.php?t=5030"; > - it not ok , only some part of document. > wget "http://forums.childrenwithdiabetes.com/showthread.php?t=5030"; - > it ok ! > sock.py "http://www.google.com/"; - it ok ! > > Wh

ANN: Pyro 3.7 (remote objects)

2007-05-19 Thread Irmen de Jong
nymore - wxnsc updated to recent WxPython API, deprecation warning is gone Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong ---> What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced and powerful Distributed Object Technology system writ

Re: Components for a client/server architecture

2007-05-22 Thread Irmen de Jong
John Nagle wrote: > You don't hear much about CORBA any more. It used to be derided > as a bulky way to marshall data, but then came XML. CORBA is much more than just a way to marshall data. GIOP (or its more often used implementation IIOP) is the marshaling protocolused in CORBA. And it is

Re: Shared Memory Space - Accross Apps & Network

2007-05-25 Thread Irmen de Jong
Hendrik van Rooyen wrote: >>> Just to get the ball rolling, I'd suggest two things: >>> >>> Pyro -http://pyro.sf.net > > This is good advice, if you have the power to run it. What do you mean exactly by "the power to run it"? --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Periodic tasks.

2007-05-30 Thread Irmen de Jong
Ramashish Baranwal wrote: > Hi, > > I am trying to execute some tasks periodically, those familiar with > unix can think of it as equivalent to cron jobs. I have tried looking > around, but couldn't find a way. Would appreciate any pointers or > clues.. > > Thanks, > -Ram > Have a look at Kron

Re: Directory

2007-07-30 Thread Irmen de Jong
Rohan wrote: > I would like to get a list of sub directories in a directory. > If I use os.listdir i get a list of directories and files in that . > i only want the list of directories in a directory and not the files > in it. > anyone has an idea regarding this. > Look up os.walk (allows you to

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Irmen de Jong
John Machin wrote: > > (you_are_confused and/or > function_returns_bool_but_has__side_effects()) > That above expression should be written more explicitly like: function_result = function_returning_bool_but_with_side_effects() if you_are_confused or function_result: do_something_nice() -

Re: Auto run/Timer

2007-08-04 Thread Irmen de Jong
Rohan wrote: > Hello, > I would like my script to run once a week with out any external > interference. > More like a timer. Can it be done in python or should some other shell > scripting be used. > If anyone knows anything please let me know. > Have a look at my 'kronos' task scheduler, availab

Re: distutils

2007-08-07 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > Hello again, > > Is there any patch for python "distutils", for this > from distutils import log,dir_util > ImportError: cannot import name log > > > Regards, > Vedran > Are you sure you haven't written a module yourself called distutils.py ? (that one will hid

Re: question: howto transfer objects between server and client?

2007-08-11 Thread Irmen de Jong
OpenPavilion wrote: > Since XMLRPC has limited features: Is there any other server/client > technique to transfer objects (not strings, or dictionaries, but self > defined object types) ? Take a look at Pyro; http://pyro.sourceforge.net --Irmen -- http://mail.python.org/mailman/listinfo/pytho

Re: ANN: Compyler 0.1

2007-08-12 Thread Irmen de Jong
Grant Olson wrote: > Compyler is a pre-alpha x86 native code compiler. In what ways is this similar or different to Shed Skin? http://mark.dufour.googlepages.com/ --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Compyler 0.1

2007-08-13 Thread Irmen de Jong
Thanks Grant for the very informative response. -irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test if a key in a dictionary exists?

2007-03-10 Thread Irmen de Jong
Frank wrote: > Hi, > > does anyone know how one can test if, e.g., a dictionary 'name' has a > key called 'name_key'? name_key in name e.g. >>> name={"john": 42} >>> "john" in name True >>> "julie" in name False --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: distributed queue?

2007-03-11 Thread Irmen de Jong
Paul Rubin wrote: > Does anyone have an implementation of a distributed queue? I.e. I > have a long running computation f(x) and I'd like to be able to > evaluate it (for different values of x) on a bunch of different > computers simultaneously, the usual "worker thread" pattern except > distribut

ANN: Pyro 3.6 (remote objects)

2007-03-20 Thread Irmen de Jong
oo long to include here. Please view it online: http://pyro.sourceforge.net/manual/12-changes.html#latest Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong ---> What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced and powerful Distr

Re: replace illegal xml characters

2007-03-21 Thread Irmen de Jong
killkolor wrote: >> Does InDesign export broken XML documents? What exactly is your problem? > > yes, unfortunately it does. it uses all possible unicode characters, > though not all are alowed in valid xml (see link in the first post). Are you sure about this? Could you post a small example? I

Re: Create new processes over telnet in XP

2007-03-23 Thread Irmen de Jong
Shane Geiger wrote: > This reminds me of something I once wanted to do: How can I install > Python in a totally non-gui way on Windows (without the use of VNC)? I > think I was telnetted into a computer (or something like that) and I was > unable to run the usual Python installer because it us

Re: How can I find out the size of a file

2007-03-28 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > How can I find out the size of a file in a disk in python? os.path.getsize(filename) -Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: low level networking in python

2007-04-04 Thread Irmen de Jong
Maxim Veksler wrote: > I'm trying to bind a non-blocking socket, here is my code: > """ > #!/usr/bin/env python > > import socket, select > from time import sleep > > s_nb1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s_nb1.setblocking(0) > > s_nb1.bind(('192.168.2.106', 10

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > Hello to all, > > I'm beginer in learning Python I wish somebody help me with solving > this problem. I would like to read all text files wchich are in some > folder. For this text files I need to make some word frequencies using > defined words like "buy", "red", "good

[offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
to receive any broadcast packets. Is this a known 'feature' of a windows NT service? Doesn't windows allow a service to receive broadcast packets? Again, sorry that I post this here it is probably more of a windows question. But I don't know a good place to ask this type of thing. T

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: > Try running the service impersonating another user (not LOCAL_SERVICE, > the default). > You can change that from the service control panel. Alas, that didn't change anything. I made it run as a user account that has admin privileges even, and it still doesn't respond

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: > Ouch, no more ideas from me. You'll surely get more answers from a > Windows networking group - this appears not to be related to Python anyway. Yeah I know that... That's what I mentioned in my original post... But I'm a noob on that type of thing, no idea where to ge

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
> Hendrik van Rooyen wrote: >> I am not sure if this is at all relevant - but I seem to recall seeing >> something once that had a list of socket numbers, splitting them >> between UDP & TCP - can the socket actually rx UDP? Yeah, as I wrote: when I'm sending UDP packets to the port directly on t

Re: problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
Paul McGuire wrote: > I would investigate Windows security settings as a likely culprit. My > guess is that you are running WinXP SP2 with the default security > policies, which are likely to prohibit such promiscuous behavior. > > Here's a URL that may shed some light, it seems surprisingly > i

Re: RMI with Pyro et al

2007-10-11 Thread Irmen de Jong
Sells, Fred wrote: > Diez B. Roggisch wrote > . Why do you want that (hot deploy) >> anyway? Does startuptime of a script really bother you? >> shouldn't take >> more than a few seconds. > > My primary need is development/debug. I'm a Pyro newbie and I add a > feature and then test. The only

Re: RMI with Pyro et al

2007-10-11 Thread Irmen de Jong
Diez B. Roggisch wrote: > Go install cygwin (but not it's included python-interpreter, or at least > make sure you have your python path properly under control) and then simply > start the script from the command-line. And hit C-c if you need it to stop, > and restart it. Only start it as service

Re: socket.inet_ntop, and pton question

2007-01-28 Thread Irmen de Jong
Andrew wrote: > Hi > > Are these functions (inet_ntop(), inet_pton()) from the socket library > supported on Windows. > > If not is there an equivalent for them using Windows > > Ive seen mention of people creating their own in order to use them > > Appreciate the help > > ty Why didn't you

Re: socket.inet_ntop, and pton question

2007-01-28 Thread Irmen de Jong
Gabriel Genellina wrote: > But these are not the requested functions, inet_ntop() and inet_pton(): > > py> socket.inet_ntop > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'module' object has no attribute 'inet_ntop' > > Oops, my bad. Should have had more coff

Re: Python, readline and OS X

2007-02-01 Thread Irmen de Jong
Ron Garret wrote: > I have installed Python 2.5 on my new Intel Mac but I can't for the life > of me get readline to work. I have libreadline installed, I've tried > copying readline.so from my Python 2.3 installation into 2.5, I've > searched the web, and no joy. Could someone please give me

Re: Calculating future dates

2007-02-01 Thread Irmen de Jong
Toine wrote: > Hello, > > I'm new to Python so please bare with me... > > I need to calculate a date that is exactly 31 days from the current > date in -MM-DD format. I know that date.today() returns the > current date, but how can I add 31 days to this result? I'm sure this > task is simple,

ANN: Pyro 3.6 beta released

2007-02-12 Thread Irmen de Jong
t has been done, read the 'changes' chapter in the manual, and/or visit Pyro's "todo" wiki page: http://www.razorvine.net/python/PyroTodoList Thanks for your support, and I'm looking forward to release a final Pyro-3.6 version soon ! Sincerely, --Irmen de Jong PS

Re: How to Speed Up Internet Searches??

2007-02-12 Thread Irmen de Jong
Patrick Klos wrote: > In article <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> wrote: >> How to Speed Up Internet Searches?? >> When you go to a web site, the first thing that happens is that. >> and for networking tips see at >> : : : > > Please don't post this kind of stu

Re: message processing/threads

2007-02-17 Thread Irmen de Jong
Jonathan Curran wrote: > I need a program running in the background to process messages (FIFO order) > which I would send using soap/xmlrpc/pyro (haven't decided yet). According to > my thinking I would need to make this a threaded application. One thread to > process the messages and the other

Re: Forking SocketServer daemon -- updating state

2007-02-19 Thread Irmen de Jong
Reid Priedhorsky wrote: > Another possibility is that the signal handler simply sets a needs_update > flag, which I could check for in a handle_request() loop. The disadvantage > here is that the update wouldn't happen until after the next request is > handled, and I would like the state to be ava

Re: Possible to set cpython heap size?

2007-02-22 Thread Irmen de Jong
Andy Watson wrote: > > Why do you want that? And no, it is not possible. And to be honest: > I have >> no idea why e.g. the JVM allows for this. >> >> Diez > > The reason why is simply that I know roughly how much memory I'm going > to need, and cpython seems to be taking a fair amount of time

Re: pickle problem - frexp() out of range

2007-02-26 Thread Irmen de Jong
ahaldar wrote: > Hi: > > I have some large data structure objects in memory, and when I attempt > to pickle them, I get the following error: > > SystemError: frexp() out of range > > Are there some objects that are just too large to serialize, and if > so, is there an easy workaround without bre

Re: python's thread problem on Linux platform

2006-04-22 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > I found that multi-threaded program(io-centralize ) runs very slowly > on linux while the same program runs very quickly on windows.If I > change the thread number to one ,the program runs quickly on linux, in > fact the speed is quicker than the multi-threaded vers

Re: do "some action" once a minute

2006-05-09 Thread Irmen de Jong
Petr Jakes wrote: > OK, to be more specific, I would like to run the code, when the value > of seconds in the timestamp become say "00". > The whole code will run in the infinitive loop and other actions will > be executed as well, so it can not "sleep" for 60 seconds :). Have a look at my 'Kronos

Re: Using "pickle" for interprocess communication - some notes and things that ought to be documented.

2008-01-17 Thread Irmen de Jong
Christian Heimes wrote: > John Nagle wrote: >> It's possible to use "pickle" for interprocess communication over >> pipes, but it's not straightforward. > > IIRC the processing module uses pickle for IPC. Maybe you can get some > idea by reading its code? > > http://pypi.python.org/pypi/processin

Re: Does Python mess with CRLFs?

2008-11-12 Thread Irmen de Jong
Gilles Ganault wrote: On Wed, 12 Nov 2008 12:04:07 +0100, Gilles Ganault <[EMAIL PROTECTED]> wrote: I wonder if Python rewrites CRLFs when reading a text file with open/read? For those seeing the same thing, the answer is yes: On Windows, the code above turns CRLF into LF. I tried "rb" instea

Re: Does Python mess with CRLFs?

2008-11-12 Thread Irmen de Jong
Gilles Ganault wrote: Hello I'm stuck at understanding why Python can't extract some bit from an HTML file using regexes, although I can find it just fine with UltraEdit. #BAD friends = re.compile('\r\n\r\n',re.IGNORECASE | re.MULTILINE | re.DOTALL) If you keep running into trouble and

Re: Single-instance daemons

2008-11-12 Thread Irmen de Jong
Jeffrey Barish wrote: Nice. One thing: how do I get the uid and gid for the target user? In general, I know the name of the target user, but the uid/gid assigned by the OS to that user could be different on different systems. pwd.getpwnam grp.getgrnam --irmen -- http://mail.python.org/mailm

Re: Python Image Library IOError - cannot find JPEG decoder?

2009-02-25 Thread Irmen de Jong
wongobongo wrote: On Feb 24, 9:34 am, Dario Traverso wrote: I've been trying to install the Python Image Library (PIL) on my Mac OSX Leopard laptop, but have been running into some difficulties. I've built the library, using the included setup.py script. The build summary checks out ok,

Re: How print binary data on screen

2009-03-17 Thread Irmen de Jong
Ehsen Siraj wrote: I am trying to print binary data on screen but I got the following error. f = open('/home/ehsen/1.mp3','rb') g = f.read() print g [...] UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: unexpected code byte please help me how i fix this thing. One wa

Re: Introducing Python to others

2009-03-26 Thread Irmen de Jong
Apart from the other suggestions that have been made already, it could be very wow-provoking if you have a nice example using ctypes to interface to existing c libraries. Python shines as a glue language too :-) --irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Unladen-Swallow: A faster python

2009-03-28 Thread Irmen de Jong
Tim Roberts wrote: Luis M. González wrote: This is a new project started by two Google engineers to speed up python: http://code.google.com/p/unladen-swallow/ I read this with a skeptical eye, but they have some very interesting ideas here. IronPython has certainly shown that Python can be s

Re: Bullshit Generator

2009-03-29 Thread Irmen de Jong
Pierre Denis wrote: I have written a "Bullshit Generator" script in Python (see below). It generates English sentences at random, talking about leading-edge Web-based technologies. For example it can produce simple sentences like "The interface subscriber manages the web-based online ontology."

Re: Can't get a simple TCP program to work

2009-03-29 Thread Irmen de Jong
Zach wrote: The following *extremely* simple script complains that "Socket is not connected" when I try to call recv. Could anyone provide some quick guidance? http://pastebin.com/m64317b32 replace node2.recv() by new_socket.recv() - you need to get data from the client socket that you got fro

Re: Windows command line not displaying print commands

2009-03-30 Thread Irmen de Jong
JonathanB wrote: Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Python\dev>python

Re: Creating huge data in very less time.

2009-03-31 Thread Irmen de Jong
venutaurus...@gmail.com wrote: On Mar 31, 1:15 pm, Steven D'Aprano wrote: On Mon, 30 Mar 2009 22:44:41 -0700, venutaurus...@gmail.com wrote: Hello all, I've a requirement where I need to create around 1000 files under a given folder with each file size of around 1GB. The constraint

Re: Writing to Console on mac OS X

2009-03-31 Thread Irmen de Jong
RGK wrote: I'm on mac os x 10.4.11 running python 2.5.2, and Django 1.0, but this is a python question. When doing django/mod_python stuff, I can write to the Apache error_log file with sys.stderr.write("SOMETHING I WANT TO KNOW") which had me wondering if there's not a means for a misc

Re: PIL Handbooks

2009-04-02 Thread Irmen de Jong
W. eWatson wrote: I'm very new to PIL, and don't see any handbooks for 1.1.6 or the forthcoming 1.1.7. In fact, this looks like the extent of them: * Python Imaging Library Handbook for 1.1.5 (online) * Python Imaging Library Handbook for 1.1.3 (PDF) Somewhere in my recent search I see

[ANN] Pyro 3.9 released

2009-04-04 Thread Irmen de Jong
://sourceforge.net/projects/pyro Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Best technology for agent/web server architecture

2008-05-12 Thread Irmen de Jong
authentication/encryption/... Cheers Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Import/Create module from buffer

2008-05-12 Thread Irmen de Jong
Gruik wrote: But before that 1 question: what if I'm in Python ? Following your solution, I did that in Python : def load_buffer(buffer) : compiled_buffer = compile(buffer, "module_name", "exec") exec(compiled_buffer) It works great except that I can't have a module object

Re: How do *you* use Python in non-GUI work?

2008-05-18 Thread Irmen de Jong
ten find myself opening a Python prompt to just execute simple tasks that I see other people needing big tools or even online services for: - base-64 encoding/decoding - md5/sha hashing - simple string or regular expression operations - simple math - unicode decoding/encoding - etc etc. --irmen

Re: TPCServer and xdrlib

2008-05-19 Thread Irmen de Jong
Laszlo Nagy wrote: It is possible to change the serialization used by Pyro http://pyro.sourceforge.net/manual/9-security.html#pickle to the the 'gnosis' XML Pickler. As I said earlier, I would not use XML. Just an example - I need to be able to transfer image files, word and excel docu

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Irmen de Jong
Alan Wright wrote: while (num1<=10) : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10.0) s.connect(("10.1.1.69", 50008)) # SMTP print s.recv(1024) + '\n', num1=num1+1 #s.close() sys.exit(1) I think the following is happening: Reusing the 's' object for every ne

Problem pickling exceptions in Python 2.5/2.6

2008-06-08 Thread Irmen de Jong
I'm having troubles pickling classes that extend Exception. Given the following source: class Foo(object): def __init__(self, m): self.m=m class Bar(Exception): def __init__(self, m): self.m=m import pickle s=pickle.dumps(Foo("test")) pickle.loads(s) # normal object w

Re: why can i still able to reproduce the SimpleHTTPServer bug whichis said fixed 3 years ago?

2008-06-19 Thread Irmen de Jong
Terry Reedy wrote: "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] En Fri, 13 Jun 2008 04:02:48 -0300, Leo Jay <[EMAIL PROTECTED]> escribió: http://bugs.python.org/issue1097597 in my python 2.5.2, i still find these code in SimpleHTTPServer.py, is that delibe

Re: pixel colour on screen

2008-06-29 Thread Irmen de Jong
Dennis Lee Bieber wrote: On Sat, 28 Jun 2008 11:47:46 -0700 (PDT), [EMAIL PROTECTED] declaimed the following in comp.lang.python: Could anyone help me, I'm a python noob and need some help. im trying to find some code that will, given a screen co-ordinate, will give me the colour of that pixel

Re: Pyro: ProtocolError('connection failed')

2008-07-02 Thread Irmen de Jong
Diez B. Roggisch wrote: THis is just a guess - but it seems that somehow you don't bind your pyro objects to the NIC's IP address, but to localhost (127.0.0.1) - which of course won't work. That never happened to me though, try and see the pyro docs on how to prevent/control to which IP a p

Re: PIL (etc etc etc) on OS X

2008-08-01 Thread Irmen de Jong
David C. Ullrich wrote: Decided to try to install PIL on my Mac (OS X.5). I know nothing about installing programs on Linux, nothing about building C programs, nothing about installing libraries, nothing about "fink", nothing about anything. Please insert question marks after every sentence:

module for generating captcha images

2008-08-03 Thread Irmen de Jong
Hi, I wanted to generate Captcha images(*) from Python and I couldn't find any module that suited my needs so I made one myself. It only needs PIL. (I used PIL 1.1.6) It can generate images with a provided background or it can make a random background for you. It needs a truetype font to dr

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread Irmen de Jong
David C. Ullrich wrote: Just as well that the message sent earlier today seems to have been lost... Ok. Read your instructions on libjpeg. Read some of the install.doc. ./configure, fine. make, fine. "make test", fine. So I said "sudo make install" and this happened: 0-1d-4f-fc-28-d:jpeg-6b du

Re: datetime from uuid1 timestamp

2008-08-13 Thread Irmen de Jong
Kent Tenney wrote: Howdy, I have not found a routine to extract usable date/time information from the 60 bit uuid1 timestamp. Is there not a standard solution? I submitted an ASPN recipe to do it. http://code.activestate.com/recipes/576420/ I'm interested in the use case for this. Why wo

Re: Receive data from socket stream

2008-04-26 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Until now, I've been doing this little trick: data = client.recv(256) new = data while len(new) == 256: new = client.recv(256) data += new Are you aware that recv() will not always return the amount of bytes asked for? (send() is similar; it doesn't guarantee t

Re: Simple question

2008-05-10 Thread Irmen de Jong
Gandalf wrote: On May 10, 2:36 pm, Bjoern Schliessmann wrote: Gandalf wrote: how can i ran script with python It depends on your web server configuration. To get your web server execute Python code, there are several alternatives like * CGI * FastCGI * mod_python Regards, Björn -- BOFH ex

Re: what does int means for python ?

2008-05-11 Thread Irmen de Jong
alefajnie wrote: #!/usr/bin/env python arr = [[0 for c in range(0, 10)] for r in range(0, 10)] # 10x10 array arr[2,3] # throws TypeError: list indices must be integers arr[int(2), int(3)] # also throws TypeError: list indices must be integers ! -

Pyro 3.8 released

2008-08-23 Thread Irmen de Jong
us version. Please check the changes chapter in the manual for details: http://pyro.sourceforge.net/manual/12-changes.html#latest Have fun, and thanks for your interest, support, and feedback! --Irmen de Jong ** What is Pyro? Pyro is an acronym for PYthon Remote Objects. Pyro is an advanced an

Re: python library for web discussions

2006-03-19 Thread Irmen de Jong
Amir Michail wrote: > Hi, > > I'm building something like digg/reddit and would like to allow people > to have discussions on various items. > > Is there a simple lightweight python library that I can use (as opposed > to a heavyweight web framework)? Although not necessary, some sort of > scori

Re: Is there such an idiom?

2006-03-19 Thread Irmen de Jong
Per wrote: > how to find the number of common items between two list in linear-time? > Not really sure about linear-time, but you could try the following: >>> a=[1,2,3,4] >>> b=[3,4,5,6] >>> set(a) & set(b) set([3, 4]) --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Can XML-RPC performance be improved?

2006-03-21 Thread Irmen de Jong
Sion Arrowsmith wrote: > I've got an established client-server application here where there > is now a need to shovel huge amounts of data (structured as lists of > lists) between the two, and the performance bottleneck has become > the amount of time spent parsing XML Any chance of replacing the

Re: Uploading files from IE

2006-03-22 Thread Irmen de Jong
AB wrote: > All right... I already hated IE. But, now I do even more. My scripts > upload function is working in Firefox, but not in IE. If I upload a file > from Internet Explorer I get a file on the system named for the full path > from the users computer... > > example... > They user uplo

Re: How do I handle #

2006-03-24 Thread Irmen de Jong
Michael Sperlle wrote: > I need to write out a file containing the # comment. When I try to specify > it as part of a literal, everything afterward turns into a comment. > > I finally created a file containing the #, read it in, and used the > resulting variable as part of the string I created. >

Exception classes don't follow pickle protocol, problems unpickling

2009-12-06 Thread Irmen de Jong
Hi, I am puzzled why Python's exception classes don't seem to follow the pickle protocol. To be more specific: an instance of a user defined exception, subclassed from Exception, cannot be pickled/unpickled correctly in the expected way. The pickle protocol says that: __getinitargs__ is used

Pyro 3.10 released

2009-12-08 Thread Irmen de Jong
://sourceforge.net/projects/pyroor from PyPI http://pypi.python.org/pypi/Pyro/ Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception classes don't follow pickle protocol, problems unpickling

2009-12-08 Thread Irmen de Jong
On 7-12-2009 10:12, Peter Otten wrote: So there are 2 problems: the pickle protocol isn't used when exception objects (or instances of classes derived from Exception) are pickled, and during unpickling, it then crashes because it calls __init__ with the wrong amount of parameters. (why is it bo

Re: Question about 'remote objects'

2009-12-09 Thread Irmen de Jong
On 9-12-2009 13:56, Frank Millman wrote: My first thought was to look into Pyro. It seems quite nice. One concern I had was that it creates a separate thread for each object made available by the server. It doesn't. Pyro creates a thread for every active proxy connection. You can register thous

<    1   2   3   4   5   6   >