Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 20:17, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns out that people in the 1970's were pretty smart

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 21:13, Raymond Hettinger wrote: It turns out that people in the 1970's were pretty smart :-) I think that often, the cleverness of people is inversely proportional to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and*

Re: Have you read the Python docs lately?

2011-04-27 Thread Irmen de Jong
On 27-4-2011 19:56, Raymond Hettinger wrote: A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes

Re: windows 7 x64 shutdown

2011-04-25 Thread Irmen de Jong
On 25-4-2011 23:15, rjmccorkle wrote: does anyone know a solution to shutting down windows 7 x64 via python script? the win32 obviously doesn't work... something similar? http://goo.gl/5tVPj (a recipe on activestate, First hit on Google for 'python ctypes shutdown') Works fine on my win7 x64

Re: suggestions, comments on an is_subdict test

2011-04-22 Thread Irmen de Jong
On 22-4-2011 15:55, Vlastimil Brom wrote: Hi all, I'd like to ask for comments or advice on a simple code for testing a subdict, i.e. check whether all items of a given dictionary are present in a reference dictionary. Sofar I have: def is_subdict(test_dct, base_dct): Test whether all

Re: Remote Connection

2011-04-21 Thread Irmen de Jong
On 20-04-11 05:26, ray wrote: The speech commands will scripted in Python. Dragonfly is the Python project to coordinate this but does not address connectivity. So I am wondering if there have been any Python projects to address the connectivity. ray I'm not quite sure what you want

Re: What breaks if I remove lib/python2.7/test/* ?

2011-04-19 Thread Irmen de Jong
On 19-4-2011 19:06, cjblaine wrote: What breaks if I remove lib/python2.7/test/* ? What purpose does it serve? It is 26MB for me. I am trying to trim my Python install for good reason. Thanks for any info! Terry answered what it is for. Personally, I also once used some functions from

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 0:21, Grant Edwards wrote: I'm have problems figuring out how to receive UDP broadcast packets on Linux. [...] Here's the sending code: send.py--- #!/usr/bin/python import sys,socket,time host = sys.argv[1]

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 1:21, Grant Edwards wrote: If I don't call bind(), then the broadcast packets go out the wrong interface on the sending machine. Fair enough. Next issue then: as far as I know, broadcast packets are by default not routed across subnets by gateways. Which is a good thing.

Re: How to schedule execution of code?

2011-03-15 Thread Irmen de Jong
On 15-03-11 08:16, Virgil Stokes wrote: Suppose that I have some Python code (vers. 2.6) that has been converted into an *.exe file and can be executed on a Windows (Vista or 7) platform. What can one do to have this *.exe executed at a set of specific times each day? In addition, if a day is

Re: Do you monitor your Python packages in inux distributions?

2011-03-12 Thread Irmen de Jong
by googling. All in all probably not a very helpful example but I thought I'd share my experience. Cheers Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle a list

2011-03-08 Thread Irmen de Jong
in the lista list, instead it just has the initial list. You probably want to initialize self.alist in the class's __init__ method instead. That way it is a normal object attribute and will get pickled normally. Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-23 Thread Irmen de Jong
is to use the 3.2 32-bit installer for Mac OS X from python.org: http://www.python.org/download/releases/3.2/ Yep, maybe I should have. I just like to tinker around too much myself I suppose :-) Thanks again. Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
i386+ppc universal build installer? Or what other thing I might do wrong? (Note: I have no trouble compiling a --enable-framework build on Mac OS 10.6.6 on intel. Also, a non-framework build compiles ok on the PPC mac.) Thanks in advance. Irmen de Jong. -- http://mail.python.org/mailman/listinfo

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
that seems to be the only thing that's failing now. Btw: just tried to compile Python 2.7.1 with --enable-framework, it compiled without error on the powerpc mac. regards Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compile on OS X PPC? was: Re: [RELEASED] Python 3.2

2011-02-22 Thread Irmen de Jong
-Makefile.pre.in.diff Thanks for the pointer Benjamin. Unfortunately, applying this patch didn't make it fly. Gonna have to look further :) Regards. Irmen de Jong. -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket connection between python and C

2011-02-09 Thread Irmen de Jong
On 09-02-11 01:54, Williamson, Ross X. (Guest) wrote: Dear All, I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. I can happily send simple text through the socket. Ideally I would like make say a struct (using

Pyro 3.11 released

2010-11-22 Thread Irmen de Jong
: http://pypi.python.org/pypi/Pyro/ Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

[ANN] Pyro 3.11 released

2010-11-21 Thread Irmen de Jong
: http://pypi.python.org/pypi/Pyro/ Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Pyro 4.2 released!

2010-09-28 Thread Irmen de Jong
. Pyro is designed to be simple (but powerful) so it's only a manner of adding a few lines of code to ignite your objects. Simple example: http://www.razorvine.net/python/Pyro/Example Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python

Pyro 4.2 released

2010-09-28 Thread Irmen de Jong
. Pyro is designed to be simple (but powerful) so it's only a manner of adding a few lines of code to ignite your objects. Simple example: http://www.razorvine.net/python/Pyro/Example Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Pyro 4.1 released

2010-06-28 Thread Irmen de Jong
- added @Pyro.callback decorator to be able to raise callback exceptions locally as well as on the caller side. Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

Re: how to get bit info

2010-06-17 Thread Irmen de Jong
On 17-6-2010 21:51, Back9 wrote: Hi, I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? TIA Use bitwise and, for instance, to see if the third bit is set: byte = 0b if byte 0b0100: print bit is set -irmen --

Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-14 Thread Irmen de Jong
On 14-6-2010 15:09, Vincent Davis wrote: Anyway, make sure readline is installed, and then recompile Python. So I should run ./configure make install again? Will this overwrite other py packages I have installed? Vincent Often there is no need to run the configure script again if you're

Pyro 4.0 released

2010-06-13 Thread Irmen de Jong
-- Detailed info here: http://www.razorvine.net/python/Pyro (a page about migration from Pyro 3.x is included) Download Pyro 4.0 here: http://www.xs4all.nl/~irmen/pyro4/download/ License: MIT software license. Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python

Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Irmen de Jong
On 14-6-2010 1:19, Vincent Davis wrote: I just installed 2.6 and 3.1 from current maintenance source on Mac OSx. When I am running as an interactive terminal session the up arrow does not scroll thought the history of the py commands I have entered I just get ^[[A. When I install from a compiled

Pyro 4.0 released

2010-06-12 Thread Irmen de Jong
-- Detailed info here: http://www.razorvine.net/python/Pyro (a page about migration from Pyro 3.x is included) Download Pyro 4.0 here: http://www.xs4all.nl/~irmen/pyro4/download/ License: MIT software license. Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-06 Thread Irmen de Jong
On 6-6-2010 14:32, Lie Ryan wrote: On 06/06/10 22:09, Petite Abeille wrote: On Jun 6, 2010, at 12:52 PM, Steven D'Aprano wrote: Yes, just wait until somebody builds a web-browser that runs in your web- browser! There you go: A good browser should be able to reproduce itself. Safari 4,

Re: FIle transfer over network - with Pyro?

2010-06-03 Thread Irmen de Jong
On 3-6-2010 19:47, Nathan Huesken wrote: Hi, I am writing a network application which needs from time to time do file transfer (I am writing the server as well as the client). For simple network messages, I use pyro because it is very comfortable. But I suspect, that doing a file transfer is

Re: recursively remove all the directories and files which begin with '.'

2010-05-16 Thread Irmen de Jong
On 16-5-2010 19:41, Sean DiZazzo wrote: On May 14, 8:27 am, albert kaoalbertk...@gmail.com wrote: On May 14, 11:01 am, Jdreadpiratej...@gmail.com wrote: On Fri, May 14, 2010 at 10:53, albert kaoalbertk...@gmail.com wrote: C:\pythonrmdir.py C:\test\com.comp.hw.prod.proj.war\bin

Re: gnu readline licensing?

2010-04-20 Thread Irmen de Jong
On 20-4-2010 20:09, Brendan Miller wrote: Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. Also, I presume programs written with the readline interface

Compiling Python extension modules in the near future, was: Re: Download Visual Studio Express 2008 now

2010-04-13 Thread Irmen de Jong
a little because at first I skipped this post because I thought that it was product spam ;-) Irmen de Jong. -- http://mail.python.org/mailman/listinfo/python-list

Re: per-method jit compiler

2010-04-06 Thread Irmen de Jong
On 6-4-2010 8:22, Luis M. González wrote: The above post gave me an idea (very naive, of couse). What if I write a simple decorator to figure out the types of every function, and then we use it as a base for a simple method-jit compiler for python? example: def typer(f): def

Re: pythonrag

2010-04-05 Thread Irmen de Jong
On 5-4-2010 13:48, superpollo wrote: Jason Friedman ha scritto: I saw this posted in the July issue but did not see any follow-up there: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. a = 500 b =

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Irmen de Jong ir...@razorvine.net added the comment: Ok I think I've got the code and doc changes ready. I added a recvall and a recvall_into method to the socket module. Any partially received data in case of errors is returned to the application as part of the args for a new exception

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong ir...@razorvine.net: Removed file: http://bugs.python.org/file6439/patch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1103213

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong ir...@razorvine.net: Added file: http://bugs.python.org/file16762/socketmodulepatch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1103213

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong ir...@razorvine.net: Added file: http://bugs.python.org/file16763/libpatch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1103213

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Changes by Irmen de Jong ir...@razorvine.net: Added file: http://bugs.python.org/file16764/docpatch.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1103213

[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong
Irmen de Jong ir...@razorvine.net added the comment: Currently if MSG_WAITALL is defined, recvall() just calls recv() internally with the extra flag. Maybe that isn't the smartest thing to do because it duplicates recv's behavior on errors. Which is: release the data and raise an error. Would

[issue8320] docs on socket.recv_into doesn't mention the return value

2010-04-05 Thread Irmen de Jong
New submission from Irmen de Jong ir...@razorvine.net: Doc/library/socket.rst doesn't mention the return value for recv_into. Adding a simple Returns the number of bytes received. should fix this. (note that recvfrom_into does mention its return value) -- assignee: georg.brandl

Re: Getting Local MAC Address

2010-04-02 Thread Irmen de Jong
On 2-4-2010 22:55, danmcle...@yahoo.com wrote: On Apr 2, 2:52 pm, danmcle...@yahoo.comdanmcle...@yahoo.com wrote: On Apr 2, 2:14 pm, Bootercolo.av...@gmail.com wrote: Hello all, I am new to python ans was wondering if there was a way to get the mac address from the local NIC? Thanks

Re: Encryption source code with md5

2010-03-28 Thread Irmen de Jong
On 28-3-2010 12:08, Lawrence D'Oliveiro wrote: In message91541c26-6f18-40c7- a0df-252a52bb7...@l25g2000yqd.googlegroups.com, catalinf...@gmail.com wrote: It is possible to encrypt with md5 python source code? Don’t use MD5. Also, md5 is not an encryption algorithm at all, it is a secure

Re: exec .exe

2010-03-26 Thread Irmen de Jong
On 26-3-2010 22:58, wukong wrote: newbie question, how do you run a .exe generated by MSVC++ in python in windows? Use the subprocess module, for instance: subprocess.call([notepad.exe, d:/file.txt]) irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any library for indexing binary data?

2010-03-25 Thread Irmen de Jong
On 3/25/10 4:28 AM, 甜瓜 wrote: Howdy, Recently, I am finding a good library for build index on binary data. Xapian Lucene for python binding focus on text digestion rather than binary data. Could anyone give me some recommendation? Is there any library for indexing binary data no matter whether

Re: Saving a page loaded using the webbrowser library?

2010-03-25 Thread Irmen de Jong
On 3/25/10 8:41 AM, Dr. Benjamin David Clarke wrote: Does anyone know of a way to save the a loaded web page to file after opening it with a webbrowser.open() call? Specifically, what I want to do is get the raw HTML from a web page. This web page uses Javascript. I need the resulting HTML

Re: Is there any library for indexing binary data?

2010-03-25 Thread Irmen de Jong
On 25-3-2010 10:55, 甜瓜 wrote: Thank you irmen. I will take a look at pytable. FYI, let me explain the case clearly. Originally, my big data table is simply array of Item: struct Item { long id;// used as key BYTE payload[LEN]; // corresponding value with fixed length };

Re: Sniffing encoding type by looking at file BOM header

2010-03-25 Thread Irmen de Jong
On 26-3-2010 0:16, Lawrence D'Oliveiro wrote: In messagemailman.1139.1269442366.23598.python-l...@python.org, pyt...@bdurham.com wrote: BOM_UTF8 = '\xef\xbb\xbf' Since when does UTF-8 need a BOM? It doesn't, but it is allowed. Not recommended though. Unfortunately several tools, such

Re: why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread Irmen de Jong
On 20-3-2010 14:38, News123 wrote: I'm having a small multiprocessing manager: # ## import socket,sys from multiprocessing.managers import BaseManager mngr = BaseManager(address=('127.0.0.1',8089),authkey='verysecret') try: srvr = mngr.get_server() except

[issue1103213] Adding the missing socket.recvall() method

2010-03-16 Thread Irmen de Jong
Irmen de Jong ir...@users.sourceforge.net added the comment: Sure, I'll give it another go. I've not done any c-development for quite a while though, so I have to pick up the pieces and see how far I can get. Also, I don't have any compiler for Windows so maybe I'll need someone else

[issue1103213] Adding the missing socket.recvall() method

2010-03-16 Thread Irmen de Jong
Irmen de Jong ir...@razorvine.net added the comment: Ok I've looked at it again and think I can build an acceptable patch this time. However there are 2 things that I'm not sure of: 1) how to return the partial data to the application if the recv() loop fails before completion. Because

Re: What happened to pyjamas?

2010-02-19 Thread Irmen de Jong
On 2/18/10 9:45 PM, Luis M. González wrote: On Feb 18, 5:21 pm, Daniele Gondonidaniele.gond...@gmail.com wrote: On 18 Feb, 19:58, sstein...@gmail.comsstein...@gmail.com wrote: Down from here (NH, US). S On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: Unreacheable from Italy as

Re: Your impression of for-novice writings on assertions

2010-02-02 Thread Irmen de Jong
On 2-2-2010 21:54, Alf P. Steinbach wrote: I've started on ch 3 of my beginner's intro to programming, now delving into the details of the Python language. Alf, I think it's a good read so far. I just don't like the smilies that occur in the text. It's a book (or article) that I'm reading,

Re: Milliseconds in logging format

2010-01-10 Thread Irmen de Jong
On 10-1-2010 20:04, Joan Miller wrote: How the logging '%(asctime)s' [1] specifier to gets the millisecond portion of the time if there is not a directive to get it from the time module [2] ? The date format string follows the requirements of strftime() [1]

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:12, Robert Somerville wrote: hi; I am trying to read 24bit signed WAV format (little endian) data from a WAV file and convert it to 32 bit little endian integer format ... can anybody please tell me how to do the conversion from 24 bit to 32 bit with a snippet of Python code ???

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:37, Grant Edwards wrote: On 2010-01-08, Irmen de Jongirmen-nosp...@xs4all.nl wrote: Are you using the standard wave module? I guess that will produce a string of 3-byte audio frames with readframes(). Won't it work to chop this up in individual 3-byte frames, then appending a

Re: lightweight encryption of text file

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:39, Daniel Fetchinson wrote: http://www.nightsong.com/phr/crypto/p3.py Thanks a lot, currently I'm having trouble using this code on python 2.6 but probably some small tweaking will fix it. If you keep having issues with this module, maybe you can try this:

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread Irmen de Jong
On 29-12-2009 23:22, inhahe wrote: On Tue, Dec 29, 2009 at 5:11 PM, inhaheinh...@gmail.com wrote: On Tue, Dec 29, 2009 at 5:10 PM, inhaheinh...@gmail.com wrote: So i'm guessing that the attribute has been changed from func_code to f_code but the inspect module wasn't updated to reflect

Re: more efficient?

2009-12-22 Thread Irmen de Jong
On 12/22/09 7:13 AM, Zubin Mithra wrote: I have the following two implementation techniques in mind. def myfunc(mystring): check = hello, there + mystring + !!! print check OR structure = [hello, there,,!!!] def myfunc(mystring): structure[2] = mystring output =

Re: dict initialization

2009-12-22 Thread Irmen de Jong
On 22-12-2009 22:33, mattia wrote: Is there a function to initialize a dictionary? Right now I'm using: d = {x+1:[] for x in range(50)} Is there any better solution? Maybe you can use: dict.fromkeys(xrange(1,51)) but this will initialize all values to None instead of an empty list...

Re: console command to get the path of a function

2009-12-20 Thread Irmen de Jong
On 12/20/2009 1:45 PM, mattia wrote: Hi all, is there a way in the python shell to list the path of a library function (in order to look at the source code?). Thanks, Mattia something like this? import inspect import os inspect.getsourcefile(os.path.split) 'C:\\Python26\\lib\\ntpath.py'

Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Irmen de Jong
On 11-12-2009 14:52, Antoine Pitrou wrote: Hello, I've looked at the web servers that come bundled with the Python standard library[1] and they are too slow. Apparently you have debugged your speed issue so I suppose you don't have performance problems anymore. Do note, however, that Python

Re: Brent's variation of a factorization algorithm

2009-12-10 Thread Irmen de Jong
On 12/10/09 12:52 AM, n00m wrote: On Dec 10, 1:11 am, Irmen de Jongir...@-nospam-xs4all.nl wrote: 9 == 27 * 37037037 What gives? Isn't this thing supposed to factor numbers into the product of two primes? -irmen Only if you yield to it a SEMIprime =) A 'semiprime' being a product

Pyro 3.10 released

2009-12-09 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-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

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

Re: Brent's variation of a factorization algorithm

2009-12-09 Thread Irmen de Jong
On 27-11-2009 16:36, n00m wrote: Maybe someone'll make use of it: def gcd(x, y): if y == 0: return x return gcd(y, x % y) def brent(n): [...] [D:\Projects]python brentfactor.py 9 == 27 * 37037037 What gives? Isn't this thing supposed to factor numbers into the

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

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

Re: disable image loading to speed up webpage load

2009-11-04 Thread Irmen de Jong
On 4-11-2009 8:32, elca wrote: Diez B. Roggisch-2 wrote: Use urllib2. you can show me some more specific sample or demo? It's not even more than 1 click away in the Python standard lib documentation... how hard can it be? http://docs.python.org/library/urllib2.html#examples -irmen --

Re: how can i use lxml with win32com?

2009-10-25 Thread Irmen de Jong
Michiel Overtoom wrote: elca wrote: im sorry ,also im not familiar with newsgroup. It's not a newsgroup, but a mailing list. And if you're new to a certain community you're not familiar with, it's best to lurk a few days to see how it is used. Pot. Kettle. Black. comp.lang.python really

Re: MUD Game Programmming - Python Modules in C++

2009-10-13 Thread Irmen de Jong
Christopher Lloyd wrote: Hello all, I'm new to Python and new to this list, although I've done some digging in the archives and already read up on the problem I'm about to describe. I'm a relatively inexperienced programmer, and have been learning some basic C++ and working through the demos

Re: Enormous Input and Output Test

2009-10-10 Thread Irmen de Jong
John Yeung wrote: P.S. I hope people realize that the concise, intuitive, readable answers we all tried in our first couple of (failed) attempts are much more Pythonic than the beasts that were created just for SPOJ. Well, it is not often that we need to micro optimize stuff (or how would you

Re: Enormous Input and Output Test

2009-10-07 Thread Irmen de Jong
n00m wrote: numerix's solution was excelled by Steve C's one (8.78s): http://www.spoj.pl/ranks/INOUTEST/lang=PYTH I don't understand nothing. I just got my solution accepted, it ran in 14 seconds though. I have no idea how to shave more seconds off, so I think 7.5 seconds for the fastest

Re: socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-17 Thread Irmen de Jong
Wes McKinney wrote: I am running what is apparently a custom Python 2.5.4 (part of the Enthought Python Distribution) which should be identical to the one on python.org, but is not. I contacted Enthought about the issue-- it can be worked around in the Pyro configuration for the time being.

Re: socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-16 Thread Irmen de Jong
Tim Roberts wrote: Wes McKinney wesmck...@gmail.com wrote: I noticed the flag socket.MSG_WAITALL seems to have crept its way into Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about intermediate releases). I do not think Windows supports it. It seems to cause some problems in

Re: How to receive a data file of unknown length using a python socket?

2009-07-18 Thread Irmen de Jong
twgray wrote: I am attempting to send a jpeg image file created on an embedded device over a wifi socket to a Python client running on a Linux pc (Ubuntu). All works well, except I don't know, on the pc client side, what the file size is? You don't. Sockets are just endless streams of

[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: 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

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 ste...@remove.this.cybersource.com.au 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

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: 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\devpython

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 from

Re: Unladen-Swallow: A faster python

2009-03-28 Thread Irmen de Jong
Tim Roberts wrote: Luis M. González luis...@gmail.com 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

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: 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

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 traver...@gmail.com 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

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 instead

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('/td/tr/table\r\n/div\r\n',re.IGNORECASE | re.MULTILINE | re.DOTALL) If you keep running

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 --

Pyro 3.8 released

2008-08-23 Thread Irmen de Jong
. 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 and powerful

Pyro 3.8 released

2008-08-23 Thread Irmen de Jong
. 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 and powerful

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

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

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

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:

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

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

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 deliberate?

<    1   2   3   4   5   6   7   >