Re: Simple TCP proxy

2022-07-28 Thread Andrew MacIntyre
On 29/07/2022 8:08 am, Chris Angelico wrote: It takes a bit of time to start ten thousand threads, but after that, the system is completely idle again until I notify them all and they shut down. (Interestingly, it takes four times as long to start 20,000 threads, suggesting that something in

Re: Python bug in ArcGIS - Urban Network analysis tool

2018-07-30 Thread Andrew MacIntyre
On 30/07/2018 4:02 PM, Станимира Николова wrote: I run Urban network analysis but It shows similar mistake several times. The UNA tool is free plugin that i downloaded, it's not from the default intalled in ArcGIS packed. It ask for integer data. I checked the type of the attributes, it's

Re: ctypes for AIX

2010-01-24 Thread Andrew MacIntyre
Waddle, Jim wrote: Is there a policy concerning getting functions like ctypes working on AIX. If you can get it working, post a patch on the bug tracker. -- - Andrew I MacIntyre These thoughts are mine

Re: questions regarding stack size use for multi-threaded python programs

2009-11-13 Thread Andrew MacIntyre
Gabriel Genellina wrote: En Mon, 09 Nov 2009 16:05:31 -0300, Eyal Gordon eyal.gor...@gmail.com escribió: background: we are using python 2.4.3 on CentOS 5.3 with many threads - and our shell's default stack size limit is set to 10240KB (i.e. ~10MB). we noticed that python's Threading module

Re: Python resident memory retention Evan Jones' improvements

2009-10-02 Thread Andrew MacIntyre
Matt Ernst wrote: {...} I thought Evan Jones altered Python to deal with this very problem, and the change went into the release of 2.5. Here is Tim Peters announcing the change: http://mail.python.org/pipermail/python-dev/2006-March/061991.html He included this simple test program to show

Re: Mapping in python? Transforming shapefile so that basemap can read them?

2009-09-12 Thread Andrew MacIntyre
C Barr Leigh wrote: I'm trying to get started with plotting maps in python. I need to read shape files (.shp) and make maps. There seem to be many efforts but none is complete? I'm looking for suggestions and troubleshooting. The basemap package is obviously at an impressive stage and comes

Re: Building Python with icc on 64-bit Linux

2009-05-28 Thread Andrew MacIntyre
Konrad Hinsen wrote: /home/shr/khinsen/tmp/Python-2.6.2/Modules/_ctypes/libffi/src/x86/ffi64.c(43): \ error: identifier __int128_t is undefined __int128_t sse[MAX_SSE_REGS]; ^ compilation aborted for /home/shr/khinsen/tmp/Python-2.6.2/Modules/_ctypes/libf\ fi/src/x86/ffi64.c (code 2)

Re: Statically linked extension and relative import

2009-05-07 Thread Andrew MacIntyre
David Cournapeau wrote: Hi, I am trying to build a 3rd party extension and link it statically to python. I managed to get things working by customizing Setup.local in python source tree, but I have a problem for imports of the 'foo.bar' form. For example, let's say the 3rd party module is laid

Re: geospatial python and how to convert multilinestrings to kml

2009-03-04 Thread Andrew MacIntyre
Danny Shevitz wrote: Howdy, I need to do some geospatial work and am a complete newbie at this. I have access to a PostGIS database and there are lots of MultiLineString objects. I want to run a python algorithm that determines a group of these MultiLineString objects and creates a KML file of

Re: Static Map

2009-02-28 Thread Andrew MacIntyre
KMCB wrote: Hello, I'm interested in creating a static map of a region in the US. This map would be set into a picture format, so I can add it to a document. I would like it to contain some town names and road information. Then I would like to add points, based on LAT and LONG, that can be

Re: ulimit stack size and python threads

2009-01-08 Thread Andrew MacIntyre
Greg Lindahl wrote: I figure this is a FAQ, but I can't find it in any FAQs. I want to limit the stacksize on my server. If I set it to 8 megs, or unlimited, python is happy. If I set it to 4 gigabytes, things like yum (which is a python program) crash creating a thread. This is on an x86_64

Re: Retrieving BSTR * from a DLL

2008-07-10 Thread Andrew MacIntyre
mzdude wrote: I need to interface with a windows DLL that has the following signature extern C void Foo( BSTR in, BSTR *out ) Code so far from ctypes import * import comtypes LPBSTR = POINTER(comtypes.BSTR) hdl = windll.MyDll.Foo hdl.rettype = None hdl.argtypes = [comtypes.BSTR, LPBSTR]

Re: ImportError: DLL load failed

2008-06-27 Thread Andrew MacIntyre
Tony May wrote: I'm having trouble importing when I run in Python. The hello world program passes the test during the bjam build but gives an error about loading the dll when I import from a python script. first the test from running bjam. ...patience... ...found 1915 targets... ...using 1

Re: Help needed - I don't understand how Python manages memory

2008-04-21 Thread Andrew MacIntyre
Hank @ITGroup wrote: In order to deal with 400 thousands texts consisting of 80 million words, and huge sets of corpora , I have to be care about the memory things. I need to track every word's behavior, so there needs to be as many word-objects as words. I am really suffering from the

Re: problem with Python 2.5.2 and gcc 4.3

2008-03-13 Thread Andrew MacIntyre
David P. Riedel wrote: I tried building Python 2.5.2 using gcc 4.3.0. The build completes with no problems but when I run 'make test', I get a segfault part way through the test run. here is the last part of the output from make test test_softspace test_sort test_sqlite

Re: bus error/segfault from PyArg_ParseTuple in initproc with incorrect arg number

2008-02-23 Thread Andrew MacIntyre
Miles Lubin wrote: I am using PyArg_ParseTuple to parse the arguments (ignoring the keyword arguments) to my initproc for a type I define. It seems that something goes wrong inside PyArg_ParseTuple when it gets the wrong number of arguments (my format string is OO); if the function isn't

Re: Memory Leaks and Heapy

2008-01-05 Thread Andrew MacIntyre
Yaakov Nemoy wrote: A couple of developers have mentioned that python might be fragmenting its memory space, and is unable to free up those pages. How can I go about testing for this, and are there any known problems like this? If not, what else can I do to look for leaks? Marc-Andre

Re: convert pdf to png

2007-12-25 Thread Andrew MacIntyre
Carl K wrote: Andrew MacIntyre wrote: Grant Edwards wrote: On 2007-12-24, Carl K [EMAIL PROTECTED] wrote: If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png I need python code to do this. It is going to be run on a someone else's shared host web server

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread Andrew MacIntyre
malkarouri wrote: Is it possible to write a Python extension that uses the Boehm garbage collector? I have a C library written that makes use of boehm-gc for memory management. To use that, I have to call GC_INIT() at the start of the program that uses the library. Now I want to encapsulate

Re: convert pdf to png

2007-12-24 Thread Andrew MacIntyre
Grant Edwards wrote: On 2007-12-24, Carl K [EMAIL PROTECTED] wrote: If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png I need python code to do this. It is going to be run on a someone else's shared host web server, security and performance is an issue. So I

Re: Pure Python GUI lib?

2007-12-22 Thread Andrew MacIntyre
oyster wrote: For the word Pure, I mean it is not a C/C++/Z++.. extension, so that we can use it under pythons of different version. Is it possible? I don't like to update the module for different python and the module Currently, I am writing the interface to

Re: Python memory handling

2007-06-01 Thread Andrew MacIntyre
[EMAIL PROTECTED] wrote: Using the same file with cElementTree took me 217 Mb, with no unreachable object. For me it's not a good behavior, it's not a good way to let the system swap this unused memory instead of freeing it. I think it's a really good idea to have a memory pool for

Re: Compiling python extension on amd64 for 32 bit

2007-05-26 Thread Andrew MacIntyre
Mathias Waack wrote: Andrew MacIntyre wrote: Mathias Waack wrote: After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. {...} Ok, thats fine. So why is python complaining? Or even more interesting, what do I have to do

Re: Compiling python extension on amd64 for 32 bit

2007-05-25 Thread Andrew MacIntyre
Mathias Waack wrote: After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. {...} Ok, thats fine. So why is python complaining? Or even more interesting, what do I have to do to compile the code? Is the Python your toolchain

Re: Possible to set cpython heap size?

2007-02-23 Thread Andrew MacIntyre
Chris Mellon wrote: On 22 Feb 2007 11:28:52 -0800, Andy Watson [EMAIL PROTECTED] wrote: On Feb 22, 10:53 am, a bunch of folks wrote: Memory is basically free. This is true if you are simply scanning a file into memory. However, I'm storing the contents in some in-memory data structures and

Re: Python Threads and C Semaphores

2007-01-16 Thread Andrew MacIntyre
Dejan Rodiger wrote: Jeremy said the following on 16.1.2007 8:27: I have a fat C++ extension to a Python 2.3.4 program. In all, I count five threads. Of these, two are started in Python using thread.start_new_thread(), and both of these wait on semaphores in the C++ extension using

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-10 Thread Andrew MacIntyre
Robin Becker wrote: Robin Becker wrote: Andrew MacIntyre wrote: Robin Becker wrote: I think it uses sysv semaphores and although freeBSD 6 has them perhaps there's something I need to do to allow them to work. IIRC, you need to explicitly configure loading the kernel module, or compile

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Andrew MacIntyre
Robin Becker wrote: I think it uses sysv semaphores and although freeBSD 6 has them perhaps there's something I need to do to allow them to work. IIRC, you need to explicitly configure loading the kernel module, or compile the kernel with the necessary option in the config file. --

Re: multythreading app memory consumption

2006-10-24 Thread Andrew MacIntyre
Bryan Olson wrote: In Python 2.5, each thread will be allocated thread.stack_size() bytes of stack address space. Note that address space is not physical memory, nor even virtual memory. On modern operating systems, the memory gets allocated as needed, and 150 threads is not be a

Re: Ghostscript interface

2006-09-10 Thread Andrew MacIntyre
defcon8 wrote: Does a ghostscript interface for python exist? I have searched google quite a bit and all I have been able to find are command line hacks from within python. Thanks in advance for any useful help. I'm not aware of a specific interface to the Ghostscript API, but it is trivial to

Re: _mssql on Python 2.5 Beta 2

2006-07-24 Thread Andrew MacIntyre
[EMAIL PROTECTED] wrote: I'm trying to use the _mssql module from http://pymssql.sourceforge.net/. It works fine on Python 2.4. I've just installed Python 2.5 Beta 2 on my Linux box and, whenever I try and run the mssql.close() function, or close the program, I get the following message:

Re: Problem with odbc and Sql Server

2006-05-21 Thread Andrew MacIntyre
Frank Millman wrote: Assume a table 't1' with a column 'c1' of type varchar(10). From Python, set c1 to an empty string - cur.execute(UPDATE t1 SET c1 = ?,['']) The result is that c1 is actually set to a string of 10 spaces. If I execute the command without using parameters -

Re: Slow network reading?

2006-05-13 Thread Andrew MacIntyre
Ivan Voras wrote: Andrew MacIntyre wrote: Comparative CPU memory utilisation statistics, not to mention platform and version of Python, would be useful hints... During benchmarking, all versions cause all CPU to be used, but Python version has ~1.5x more CPU time allocated to it than

Re: releasing interpreter lock in custom code?

2006-05-11 Thread Andrew MacIntyre
Bram Stolk wrote: I've implemented, in C, a function that does a lot of I/O, and thus can block for a long time. If I execute this function in my Python script, it does not relinquish the global interpreter lock, like Python's native blocking functions do, like I/O funcs, and time.sleep()

Re: Slow network reading?

2006-05-11 Thread Andrew MacIntyre
Ivan Voras wrote: def query(self, sql): self.sf.write(SQL %s\r\n % sql) self.sf.flush() resp = self.sf.readline().rstrip() m = SQLCacheD.re_rec.match(resp) if m != None: # only if some rows are returned (SELECT) n_rows =

Re: Building a Dynamic Library (libpython.so) for Python 2.4.3 Final

2006-04-26 Thread Andrew MacIntyre
Dean wrote: I've been trying to make python a dynamic library. I downloaded Python 2.4.3 Final from the Python web site and I cannot get it to create the library. I've tried using the directive: --enable-shared and --enable-shared=yes and both of them had the same effect of

Re: Python vs. Java gzip performance

2006-03-17 Thread Andrew MacIntyre
Bill wrote: I've written a small program that, in part, reads in a file and parses it. Sometimes, the file is gzipped. The code that I use to get the file object is like so: if filename.endswith(.gz): file = GzipFile(filename) else: file = open(filename) Then I parse the

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed L with number data type

2006-03-02 Thread Andrew MacIntyre
[posted mailed] [EMAIL PROTECTED] wrote: The only issue I've had so far is retrieving data from Oracle when an integer has been defined like: number(p)[same thing as number(p,0) evidently] This is from a database I didn't design and can't change. Evidently there are new ways

Re: threading IOError

2005-12-13 Thread Andrew MacIntyre
Gabriel Genellina wrote: Hi I'm using Python 2.4.2 on Windows 98 SE. In a program with several threads, sometimes (I cant determine exactly when or why) one thread dies with the following traceback: 12/13/05 02:17:47 (WatchDog ) Unhandled thread exception Traceback (most recent

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-10 Thread Andrew MacIntyre
On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller [EMAIL PROTECTED] wrote: {...} (I have released and announced this 3 weeks ago, but haven't got a single feedback. So it seems the need to access custom interfaces is very low.) I have downloaded it and am trying to find the time to play with

Re: python and ARCView GIS desktop

2005-09-09 Thread Andrew MacIntyre
GISDude wrote: hi all. I am a newbie, so be kind. I am using ARCView GIS 9.1 and python win. I am trying to develop a module using the GZIP module in my ARCView map session. What I am attempting to do (I think) is use the zip mod to zip up all the files in a .mxd document into one neat little

Re: FTP over SSL (explicit encryption)

2005-08-10 Thread Andrew MacIntyre
David Isaac wrote: I am looking for a pure Python secure ftp solution. Does it exist? I recall coming across an extension package (pretty sure it wasn't pure Python anyway, certainly not for the SSL bits) with SFTP - I think the name was Paramiko or something like that.

Re: PPC floating equality vs. byte compilation

2005-07-09 Thread Andrew MacIntyre
Donn Cave wrote: I ran into a phenomenon that seemed odd to me, while testing a build of Python 2.4.1 on BeOS 5.04, on PowerPC 603e. test_builtin.py, for example, fails a couple of tests with errors claiming that apparently identical floating point values aren't equal. But it only does that

Re: IRIX MipsPro compiler chokes on Python.h

2005-05-25 Thread Andrew MacIntyre
Bram Stolk wrote: Hi there, I just built and installed Python-2.4.1 on my Irix machine. My compiler, the MipsPro compiler, chokes on the Python.h include file, as demonstrated here: $ CC -v MIPSpro Compilers: Version 7.41 $ python -V Python 2.4.1 $ cat l.cxx #include Python.h

Re: Build error Python 2.4.1 - stat problem?

2005-05-25 Thread Andrew MacIntyre
Brandt, Servatius wrote: The stat values do not make any sense. It seems that the value used for the mode is really the numbers of links (I created the two empty /usr/local... directories to prevent the os.error exception): That sort of suggests that the definition of the stat struct is not

Re: bsddb support for berkeley db 4.3?

2005-03-12 Thread Andrew MacIntyre
[EMAIL PROTECTED] wrote: It doesn't seem like the python 2.4(and the recent 2.4.1) support berkeley db 4.3. (4.3 fixes some deadlock bugs I occasionally encounter using 4.2.) bsddb3(at pybsddb.sf.net) already supports 4.3 since last December(but doesn't explicitly support win32 -- see the assert

Re: Problems with python and threads under Freebsd

2005-02-08 Thread Andrew MacIntyre
snacktime wrote: After debugging this some more I narrowed it down to an encryption function in pycrypto that is triggering the segfault. I posted a bug report. Don't really know enough about threading to know whether it's a python bug or a pycrypto bug, but I'll let someone else sort that out

Re: Python evolution: Unease

2005-01-06 Thread Andrew MacIntyre
On Wed, 5 Jan 2005, John Roth wrote: I would like to contribute some documentation to Python. I've got the time, I write quite a bit, etc. I've got fairly strong opinions about some things that need to be documented, (such as all the new style class descriptor stuff from 2.2) and I have