What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
? Is this better than defining a key for sorting my custom objects? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
preferred/accepted way. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
Sorry for double posting. Google Groups was acting funny this morning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
Sorry for double posting. Google Groups was acting funny this morning. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
On Thursday, February 24, 2011 10:09:53 AM UTC-7, Chris Rebert wrote: > On Thu, Feb 24, 2011 at 8:27 AM, Jeremy wrote: > > I just discovered the wiki page on sorting > > (http://wiki.python.org/moin/HowTo/Sorting/).  This describes the new way > > of sorting a container ins

Re: How can I define __getattr__ to operate on all items of container and pass arguments?

2011-02-24 Thread Jeremy
On Tuesday, February 15, 2011 2:58:11 PM UTC-7, Jeremy wrote: > > > So the arguments haven't yet been passed when __getattr__() is > > invoked. Instead, you must return a function from __getattr__(); this > > function will then get called with the arguments. Thu

inheriting file object

2005-07-06 Thread Jeremy
ng/writing. Can anyone help me out with this? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: inheriting file object

2005-07-06 Thread Jeremy
Jeremy Jones wrote: > Something like this? I put the following code in test_file.py: > > class MyFile(file): > def doing_something(self): > print "in my own method" > > > And used it like this: > > In [1]: import test_file > >

Re: inheriting file object

2005-07-06 Thread Jeremy
excellent explanation and the example is similar to what I want to do. I have a file I want to look through and change if needed. I think I will follow you suggestion and not inherit from the file object. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

regular expression questions in Python

2005-07-11 Thread Jeremy
or: raise error, v # invalid expression sre_constants.error: nothing to repeat So I guess my question is: how do I use the VERBOSE option to make my regular expression easier to understand for a human? Secondly, how can I use both the VERBOSE and IGNORECASE options? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

readlines() doesn't read entire file

2005-07-14 Thread Jeremy
print self.lines # and then other stuff as well I can see all the lines in the list self.lines, but they are not all the lines in the file. When I look at the file in Vim, I can see all the lines, but Python cannot. Can someone help me with this one? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: readlines() doesn't read entire file

2005-07-14 Thread Jeremy
Peter Hansen wrote: > Jeremy wrote: > >>I have a most aggravating problem. I don't understand what is causing >>readlines() not to read all the lines in the file. I have the following >>syntax: >> > > ... > >>self.xsdir = file(Data

re.IGNORECASE and re.VERBOSE

2005-07-18 Thread Jeremy
) Does anyone have any suggestions? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Newbie Developing a Python Extension

2006-11-24 Thread Jeremy
ning the Python program, at a line 'from tdma import init,txdn,txup,...', I get an error message saying 'ImportError: /home/.../tdma.so: undefined symbol: clock_gettime'. What is wrong here? Is the from-import statement right? Why is it, when I use 'import sm' or 'from sm import...', I get the message 'ImportError: No module named sm'? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Floating Exception

2006-11-27 Thread Jeremy
e crash in __init__() seems to depend on from which directory I run the Python program. What is wrong? And what is a floating exception? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

binascii in C++

2006-01-31 Thread Jeremy
sion but I can't find an equivalent module in C++. I'm not a professional developer so maybe I'm overlooking something simple. In particular I'm trying to find an equivalent to the binascii.b2a_hex() and binascii.unhexlify() functions. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Error 14 on OS Call

2007-03-12 Thread Jeremy
ke install on the instrumented Python code. Reagrds, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Python Threads and C Semaphores

2007-01-15 Thread Jeremy
running wholly in the extension. I notice that when one of the Python threads calls the extension and waits on a semaphore, all but the C++ thread halt even when not waiting on any semaphore. How do we get this working right? Thank you, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Adding a Par construct to Python?

2009-05-17 Thread jeremy
e of this would be possible with the current implementation of Python with its Global Interpreter Lock, which effectively rules out true parallel processing. See: http://jessenoller.com/2009/02/01/python-threads-and-the-global-interpreter-lock/ What do others think? Jeremy Martin -- http

Re: Adding a Par construct to Python?

2009-05-17 Thread jeremy
sumes that the new values of the boundary values are stored in temporary variables until they can be safely updated. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
. I like the simplicity of OpenMP, the cross-language portability of MPI and the fact the concurrency is built in to the Occam language. What I am proposing here is a hybrid of the OpenMP and Occam approaches - a change to the language which is very natural and yet is easy for programmers to understand. Concurrency is generally regarded as the hardest concept for programmers to grasp. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
s with garbage collection in multi-threaded applications. Without it the reference count method is prone to race conditions. However it seems like a fairly crude mechanism to solve this problem. Individual semaphores could be used for each object reference counter, as in Java. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
> will actually be and for which types of problems. I agree with this. My approach is in the same space as OpenMP - a simple way for users to define shared memory parallelism. There is no reason why it would not work with multiple disks or IO ports on the same shared memory server. However for di

Re: Adding a Par construct to Python?

2009-05-19 Thread jeremy
On 19 May, 00:32, Steven D'Aprano wrote: > On Mon, 18 May 2009 02:27:06 -0700, jeremy wrote: > > However I *do* actually want to add syntax to the language. I think that > > 'par' makes sense as an official Python construct - we already have had > > this i

Re: Adding a Par construct to Python?

2009-05-19 Thread jeremy
n two times slower." Source: http://jessenoller.com/2009/02/01/python-threads-and-the-global-interpreter-lock/ That was ten years ago - do you have any idea as to how things have been progressing in this area since then? Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-19 Thread jeremy
On 19 May, 10:24, Steven D'Aprano wrote: > On Mon, 18 May 2009 02:27:06 -0700, jeremy wrote: > > Let me clarify what I think par, pmap, pfilter and preduce would mean > > and how they would be implemented. > > [...] > > Just for fun, I've implemented a par

Re: Adding a Par construct to Python?

2009-05-19 Thread jeremy
ical iteration over a grid, e.g. finite elements, > calculation, where the boundary values need to be read by neighbouring > partitions before they are updated. It assumes that the new values of > the boundary values are stored in temporary variables until they can > be safely updated. >

Re: Adding a Par construct to Python?

2009-05-20 Thread jeremy
On 20 May, 03:43, Steven D'Aprano wrote: > On Tue, 19 May 2009 03:57:43 -0700, jeremy wrote: > >> you want it so simple to use that amateurs can mechanically replace > >> 'for' with 'par' in their code and everything will Just Work, no effort > &g

Re: Adding a Par construct to Python?

2009-05-22 Thread jeremy
On 22 May, 05:17, "Rhodri James" wrote: > On Wed, 20 May 2009 09:19:50 +0100,   > wrote: > > > On 20 May, 03:43, Steven D'Aprano > > wrote: > >> On Tue, 19 May 2009 03:57:43 -0700, jeremy wrote: > >> > As I wrote before, concurr

How to prevent re.split() from removing part of string

2009-11-30 Thread Jeremy
I know I can put parentheses around [^s] and keep the matched character, but the character is placed in it's own element of the list instead of with the rest of the lineoftext. Does anyone know how I can accomplish this without losing the matched character? Thanks, Jeremy -- http://mail.pyt

Re: How to prevent re.split() from removing part of string

2009-12-01 Thread Jeremy
On Nov 30, 5:24 pm, MRAB wrote: > Jeremy wrote: > > I am using re.split to... well, split a string into sections.  I want > > to split when, following a new line, there are 4 or fewer spaces.  The > > pattern I use is: > > >         sections = re.split('\n\

Re: Different number of matches from re.findall and re.split

2010-01-11 Thread Jeremy
On Jan 11, 8:44 am, Iain King wrote: > On Jan 11, 3:35 pm, Jeremy wrote: > > > > > > > Hello all, > > > I am using re.split to separate some text into logical structures. > > The trouble is that re.split doesn't find everything while re.findall >

Re: Different number of matches from re.findall and re.split

2010-01-11 Thread Jeremy
a \n instead of a ^ for > >> split. > > > You could use the .split method of a pattern object instead: > > >      tables = re.compile('^ 1', re.MULTILINE).split(line) > > or you might include the flag in the regular expression literal: '(?m)^ 1' Ano

What is built-in method sub

2010-01-11 Thread Jeremy
I just profiled one of my Python scripts and discovered that >99% of the time was spent in {built-in method sub} What is this function and is there a way to optimize it? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: What is built-in method sub

2010-01-11 Thread Jeremy
On Jan 11, 12:54 pm, Carl Banks wrote: > On Jan 11, 11:20 am, Jeremy wrote: > > > I just profiled one of my Python scripts and discovered that >99% of > > the time was spent in > > > {built-in method sub} > > > What is this function and is there a way t

Re: What is built-in method sub

2010-01-11 Thread Jeremy
On Jan 11, 1:15 pm, "Diez B. Roggisch" wrote: > Jeremy schrieb: > > > > > > > On Jan 11, 12:54 pm, Carl Banks wrote: > >> On Jan 11, 11:20 am, Jeremy wrote: > > >>> I just profiled one of my Python scripts and discovered that >

distutils not finding all of my pure python modules

2010-01-21 Thread Jeremy
file exists in the same directory as regex.py and has the same permissions. Does anyone know what is going on here? I'm using Python 2.6.4. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

How to schedule system calls with Python

2009-10-15 Thread Jeremy
one or two processors. I want to run one at a time (or two if I have two processors), wait until it's finished, and then call the next one. How can I use Python to schedule these commands? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 2:15 pm, TerryP wrote: > On Oct 15, 7:42 pm, Jeremy wrote: > > > I need to write a Python script that will call some command line > > programs (using os.system).  I will have many such calls, but I want > > to control when the calls are made.  I won't know

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 6:32 pm, MRAB wrote: > TerryP wrote: > > On Oct 15, 7:42 pm, Jeremy wrote: > >> I need to write a Python script that will call some command line > >> programs (using os.system).  I will have many such calls, but I want > >> to control when the call

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 6:47 pm, Ishwor Gurung wrote: > Jeremy, > Hi > > > I need to write a Python script that will call some command line > > programs (using os.system).  I will have many such calls, but I want > > to control when the calls are made.  I won't know in advanc

Please help with regular expression finding multiple floats

2009-10-22 Thread Jeremy
27;)] as a result. I have the regular expression pattern fp1 = '([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)\s+' which can find a floating point number followed by some space. I can find three floats with found = re.findall('%s%s%s' %fp1, text) My question is, how can I use regular expressions to find two OR three or even an arbitrary number of floats without repeating %s? Is this possible? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Jeremy
On Oct 23, 3:48 am, Edward Dolan wrote: > On Oct 22, 3:26 pm, Jeremy wrote: > > > My question is, how can I use regular expressions to find two OR three > > or even an arbitrary number of floats without repeating %s?  Is this > > possible? > > > Thanks, > &g

Re: Please help with regular expression finding multiple floats

2009-10-26 Thread Jeremy
t; > Sorry for the line noise folks. One of these days I'm going to learn > gnus. Yep now that works. Thanks for the help. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Please help with MemoryError

2010-02-11 Thread Jeremy
ust a pointer to the data. 2.When do I need to manually allocate/deallocate memory and when can I trust Python to take care of it? 3.Any good practice suggestions? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with MemoryError

2010-02-12 Thread Jeremy
On Feb 11, 6:50 pm, Steven D'Aprano wrote: > On Thu, 11 Feb 2010 15:39:09 -0800, Jeremy wrote: > > My Python program now consumes over 2 GB of memory and then I get a > > MemoryError.  I know I am reading lots of files into memory, but not 2GB > > worth. > > Are

Can I specify regex group to return float or int instead of string?

2010-02-25 Thread Jeremy
I have a regular expression that searches for some numbers and puts them into a dictionary, i.e. '(?P\d+)\s+(?P\d+\.\d+)' Is it possible to have the results of the matches returned as int or float objects instead of strings? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I specify regex group to return float or int instead of string?

2010-02-25 Thread Jeremy
On Feb 25, 9:41 am, Steven D'Aprano wrote: > On Thu, 25 Feb 2010 07:48:44 -0800, Jeremy wrote: > > I have a regular expression that searches for some numbers and puts them > > into a dictionary, i.e. > > > '(?P\d+)\s+(?P\d+\.\d+)' > > > Is it poss

Dictionary or Database—Please advise

2010-02-26 Thread Jeremy
independence without having to install a database and Python interface on all the platforms I'll be using. Is there something built-in to Python that will allow me to do this? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary or Database—Please advise

2010-02-26 Thread Jeremy
On Feb 26, 9:29 am, Chris Rebert wrote: > On Fri, Feb 26, 2010 at 7:58 AM, Jeremy wrote: > > I have lots of data that I currently store in dictionaries.  However, > > the memory requirements are becoming a problem.  I am considering > > using a database of some sorts inst

How can I define class methods outside of the class?

2010-12-01 Thread Jeremy
ds) I would rather not do this. Can someone show me how to do this? Is it even possible? Can decorators be used here? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I define class methods outside of the class?

2010-12-02 Thread Jeremy
On Dec 1, 10:47 pm, James Mills wrote: > On Thu, Dec 2, 2010 at 3:36 PM, Jeremy wrote: > > I have some methods that I need (would like) to define outside of the > > class.  I know this can be done by defining the function and then > > setting it equal to some member of an

Re: How can I define class methods outside of the class?

2010-12-02 Thread Jeremy
On Dec 2, 10:26 am, "bruno.desthuilli...@gmail.com" wrote: > On 2 déc, 15:45, Jeremy wrote: > > > > > > > On Dec 1, 10:47 pm, James Mills wrote: > > > > On Thu, Dec 2, 2010 at 3:36 PM, Jeremy wrote: > > > > I have some methods that I ne

Regular Expression for Finding and Deleting comments

2011-01-04 Thread Jeremy
#x27;t too hard. The trouble is, the comments are replaced with a new-line; or the new-line isn't captured in the regular expression. Below, I have copied a minimal example. Can someone help? Thanks, Jeremy import re text = """ c C - Second full line comment (first comme

Re: Regular Expression for Finding and Deleting comments

2011-01-04 Thread Jeremy
On Tuesday, January 4, 2011 11:26:48 AM UTC-7, MRAB wrote: > On 04/01/2011 17:11, Jeremy wrote: > > I am trying to write a regular expression that finds and deletes (replaces > > with nothing) comments in a string/file. Comments are defined by the first > > non-whitespace

Convert unicode escape sequences to unicode in a file

2011-01-11 Thread Jeremy
ec can't encode character u'\xe9' in position 947: ordinal not in range(128) It appears that the data isn't being converted when writing to the file. Can someone please help? Thanks, Jeremy if __name__ == "__main__": f = codecs.open(filename, 'r'

Re: Convert unicode escape sequences to unicode in a file

2011-01-11 Thread Jeremy
On Tuesday, January 11, 2011 3:36:26 PM UTC-7, Alex wrote: > > Are you _sure_ that your file contains the characters '\', 'u', '0', > '0', 'e' and '9'? I expect that actually your file contains a byte > with value 0xe9 and you have inspected the file using Python, which > has printed the byte usi

How can I define __getattr__ to operate on all items of container and pass arguments?

2011-02-15 Thread Jeremy
pass 'abc' to the 'itemMethod' method of each item in the container. Does someone know how I can accomplish this? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I define __getattr__ to operate on all items of container and pass arguments?

2011-02-15 Thread Jeremy
On Tuesday, February 15, 2011 1:44:55 PM UTC-7, Chris Rebert wrote: > On Tue, Feb 15, 2011 at 12:29 PM, Jeremy wrote: > > I have a container object.  It is quite frequent that I want to call a > > function on each item in the container.  I would like to do this whenever I > &g

How to read file during module import?

2010-04-09 Thread Jeremy
file every time? I tried pickling but that wouldn't work because I have custom classes. (Either that or I just don't know how to pickle—this is a highly probable event.) Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read file during module import?

2010-04-09 Thread Jeremy
On Apr 9, 4:02 pm, "Gabriel Genellina" wrote: > En Fri, 09 Apr 2010 18:04:59 -0300, Jeremy escribió: > > > How can I locate the file during the import statement.  The supporting > > file is located in the same directory as the module, but when I import > > I get

weakrefs, threads,, and object ids

2009-06-14 Thread Jeremy
Hello, I'm using weakrefs in a small multi-threaded application. I have been using object IDs as dictionary keys with weakrefs to execute removal code, and was glad to find out that this is in fact recommended practice (http://docs.python.org/library/weakref.html) > This simple example shows how

Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
; ../configure --prefix=$HOME/usr/local \ --enable-framework=$HOME/Library/Frameworks \ --disable-toolbox-glue \ MACOSX_DEPLOYMENT_TARGET=10.6 make make install Can anyone help me fix the install error? Thanks, Jeremy PS. Python compiled correctly, but a few modules were not found/

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
On Nov 4, 1:23 pm, Ned Deily wrote: > In article > <3d9139ae-bd6f-4567-bb02-b21a8ba86...@o15g2000prh.googlegroups.com>, > > > > > >  Jeremy wrote: > > I'm having trouble installing Python 2.7 on OSX 10.6  I was able to > > successfully compile i

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
w I just have to copy the installation to ~/Library/ Frameworks or just link to the local copy. I started the compilation when I left, tomorrow I'll finish up and see how it went. I don't anticipate any more problems. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-25 Thread Jeremy Sanders
ds UTF-8 to represent the additional codepoints it uses for raw 8- bit bytes and characters not unified with Unicode. " Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive plots

2011-07-06 Thread Jeremy Sanders
You can also embed it in a PyQt program. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding memory location of Python variables

2018-06-18 Thread Jeremy Black
Also, I don't think you can rely on memory being allocated sequentially any more now that everyone has implemented some level of ASLR. https://en.wikipedia.org/wiki/Address_space_layout_randomization On Sat, Jun 16, 2018 at 12:22 PM Alister via Python-list < python-list@python.org> wrote: > On S

Re: Classes derived from dict and eval

2005-09-22 Thread Jeremy Sanders
her globals or locals accessing by eval calls the __getitem__ member of the dicts. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Wrapping classes

2005-09-22 Thread Jeremy Sanders
sn't call Foo.__init__ yet a = lazyclass(Foo, 6) # Foo is only initalised here print a.num What I really want to do is make an object which looks like a numarray, but only computes its contents the first time it is used. Thanks Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping classes

2005-09-23 Thread Jeremy Sanders
nd on each other, and the easiest way to get the evaluation order correct is to only evaluate them when they're used. An alternative way is to do some string processing to replace a with computearray("a") in the expression or something horrible like that. Thanks Jeremy -- J

Re: Wrapping classes

2005-09-23 Thread Jeremy Sanders
tunately it needs Python 2.4, and I can't rely on my users having that. Traceback (most recent call last): File "test.py", line 15, in ? print eval("10 * a + b", globals(), l) TypeError: eval() argument 3 must be dict, not Foo If you subclass dict it doesn't ca

Re: Wrapping classes

2005-09-23 Thread Jeremy Sanders
bruno modulix wrote: > Could it work with a UserDict subclass ? Unfortunately not: Traceback (most recent call last): File "test.py", line 17, in ? print eval("10 * a + b", globals(), l) TypeError: eval() argument 3 must be dict, not instance Thanks Jeremy

Re: File processing

2005-09-23 Thread Jeremy Jones
Gopal wrote: >Hello, > >I'm Gopal. I'm looking for a solution to the following problem: > >I need to create a text file config.txt having some parameters. I'm >thinking of going with this format by having "Param Name - value". Note >that the value is a string/number; something like this: > >PROJEC

Re: File processing

2005-09-23 Thread Jeremy Jones
Gopal wrote: >Thanks for the reference. However, I'm not understanding how to use it. >Could you please provide with an example? Like I open the file, read >line and give it to parser? > >Please help me. > > > I had thought of recommending what Peter Hansen recommended - just importing the text

Re: Wrapping classes

2005-09-23 Thread Jeremy Sanders
ic application. I don't think they'd like to put () after each variable name. I could always munge the expression after the user enters it, of course. Jeremy -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: batch mkdir using a file list

2005-09-23 Thread Jeremy Jones
DataSmash wrote: >Hello, >I think I've tried everything now and can't figure out how to do it. >I want to read in a text list from the current directory, >and for each line in the list, make a system directory for that name. > >My text file would look something like this: >1144 >1145 >1146 >1147 >

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: >Damjan> Is there some python module that provides a multi process Queue? > >Not as cleanly encapsulated as Queue, but writing a class that does that >shouldn't be all that difficult using a socket and the pickle module. > >Skip > > > What about bsddb? The example

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: >Damjan> Is there some python module that provides a multi process Queue? > >Skip> Not as cleanly encapsulated as Queue, but writing a class that >Skip> does that shouldn't be all that difficult using a socket and the > Skip&

Strange Extension Module Behavior

2005-09-28 Thread Jeremy Moles
Hey guys. I have an extension module written in C that abstracts and simplifies a lot of what we do here. I'm observing some strange behavior and wanted to know if anyone had any advice as to how I should start tracking this down. More specific suggestions are obviously appreciated, but I really do

Re: return own type from Python extention?

2005-09-29 Thread Jeremy Moles
n: > > static PyObject* PyMyType_new(PyTypeObject *type, PyObject *args, > PyObject *kwds) > { > PyMyType *self; > self = (PyMyType*)type->tp_alloc(type, 0); > if (self != NULL) { > self->test = 0; > } > return (PyObject *)self; &g

Re: return own type from Python extention?

2005-09-29 Thread Jeremy Moles
} > return (PyObject *)self; > } > > ..but how do I have to call this from C-Code or how will another > Funktion for this look like? > > > > Jeremy Moles wrote: > > You can use Py_BuildValue for most what you're probably going to need. > > &

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
Wenhua Zhao wrote: >A.T.T > >Thanks a lot. > > If you could elaborate a bit more, it might be helpful. I'm guessing you want something like StringIO or cStringIO. - jmj -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
this temp file on memory??? > > > >Jeremy Jones wrote: > > >>Wenhua Zhao wrote: >> >> >> >>>A.T.T >>> >>>Thanks a lot. >>> >>> >>> >>> >>If you could elaborate a bit more, it m

Re: New Python book

2005-10-05 Thread Jeremy Jones
Dick Moores wrote: >(Sorry, my previous post should not have had "Tutor" in the subject header.) > >Magnus Lie Hetland's new book, _Beginning Python: From Novice to >Professional_ was published by Apress on Sept. 26 (in the U.S.). My copy >arrived in the mail a couple of days ago. Very much worth

Absolultely confused...

2005-10-06 Thread Jeremy Moles
So, here is my relevant code: PyArg_ParseTuple(args, "O!", &PyType_vector3d, &arg1) And here ismy error message: argument 1 must be pylf.core.vector3d, not pylf.core.vector3d I know PyType_vector3d "works" (as I can use them in the interpreter all day long), and I know I'm passi

Re: Absolultely confused...

2005-10-06 Thread Jeremy Moles
All of these are runtime errors. Using GCC4 and compiling perfectly with -Wall. On Thu, 2005-10-06 at 09:12 -0500, Brandon K wrote: > > If I take out the "!" in the format string and just use "O", I can at > > least get past PyArg_ParseTuple. > > Is this a compile-time error? Or a runtime error?

Re: Absolultely confused...

2005-10-06 Thread Jeremy Moles
re declared and assigned to all at once, only once. Am I misunderstanding the point? :) /me ducks On Thu, 2005-10-06 at 16:26 +0200, Thomas Heller wrote: > Jeremy Moles <[EMAIL PROTECTED]> writes: > > > So, here is my relevant code: > > > > PyArg_ParseTuple(arg

Re: Absolultely confused...

2005-10-06 Thread Jeremy Moles
tmar wrote: > Jeremy Moles wrote: > > So, here is my relevant code: > > > > PyArg_ParseTuple(args, "O!", &PyType_vector3d, &arg1) > > > > And here ismy error message: > > > > argument 1 must be pylf.core.vector3d, not pylf.core.v

Re: Absolultely confused...

2005-10-06 Thread Jeremy Moles
WELL, I figured it out--thanks to everyone's help. There were instances of the object and I am a total moron. Thanks again to everyone who helped me stomp this out. :) On Wed, 2005-10-05 at 21:58 -0400, Jeremy Moles wrote: > So, here is my relevant code: > > PyArg_Parse

PyObject_New

2005-10-06 Thread Jeremy Moles
Hey guys, sorry to ask another question of this nature, but I can't find the answer or a single example of it anywhere. I'm sure it's been asked before, but my google-fu isn't strong enough to find anything. I have the following: struct MyType { PyObject_HEAD

Re: New Python book

2005-10-07 Thread Jeremy Jones
Maurice LING wrote: >I had the opportunity to glance through the book in Borders yesterday. >On the whole, I think it is well covered and is very readable. Perhaps I >was looking for a specific aspect, and I find that threads did not get >enough attention. Looking at the index pages, the topics

C/API Clarification

2005-10-07 Thread Jeremy Moles
First of all, let me say I really do appreciate--and frequently use--the ample and easy to read Python documentation. However, there are a few things I'm still unclear on, even after asking multiple questions here on the list (thanks everyone!) and reading the "Extending" and "Reference" docs from

Re: PyObject_New

2005-10-07 Thread Jeremy Moles
n v. Löwis" wrote: > Jeremy Moles wrote: > > PyObject* obj = _PyObject_New(&PyType_MyType); > > obj = PyObject_Init(obj, &PyType_MyType); > > > > ... > > > > return obj; > > The call to PyObject_Init is redundant: _PyOb

Re: Pass a tuple (or list) to a C wrapper function

2005-10-12 Thread Jeremy Moles
It depends on how you want to manipulate the data in C. If you want compile-time variable access to each float, yeah, 50 floats. :) Probably what you want to do though is just keep the tuple as is and iterate over it using the PySequence_* protocol: http://docs.python.org/api/sequence.html On W

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-13 Thread Jeremy Jones
Kenneth McDonald wrote: >For unfortunate reasons, I'm considering switching back to Win XP >(from OS X) as my "main" system. Windows has so many annoyances that >I can only compare it to driving in the Bay Area at rush hour (OS X >is like driving in Portland at rush hour--not as bad, but get

Re: How to get a raised exception from other thread

2005-10-14 Thread Jeremy Moles
On non-Windows system there are a ton of ways to do it--this is almost a whole field unto itself. :) (D-BUS, fifos, sockets, shmfs, etc.) In Windows, I wouldn't have a clue. I guess this is a hard question to answer without a bit more information. :) On Fri, 2005-10-14 at 14:45 -0700, dcrespo wr

Re: global interpreter lock

2005-10-18 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: >I just need confirmation that I think right. > >Is the files thread_xxx.h (xxx = nt, os2 or whatever) responsible for >the >global interpreter lock in a multithreaded environment? > >I'm currently writing my own thread_VW for VxWorks, thats why I'm >asking. > >//Tommy >

Re: write a loopin one line; process file paths

2005-10-19 Thread Jeremy Jones
Xah Lee wrote: >Peter Hansen wrote: > > >>Xah Lee wrote: >> >> >>>If you think i have a point, ... >>> >>> >>You have neither that, nor a clue. >> >> > >Dear Peter Hansen, > >My messages speak themselfs. You and your cohorts's stamping of it does >not change its nature. And if this

ANN: Veusz 0.8 released

2005-10-21 Thread Jeremy Sanders
Veusz 0.8 - Velvet Ember Under Sky Zenith - http://home.gna.org/veusz/ Veusz is Copyright (C) 2003-2005 Jeremy Sanders <[EMAIL PROTECTED]> Licenced under the GPL (version 2 or greater) Veusz is a scientific plotting package written in Python (current

  1   2   3   4   5   6   7   >