Re: Python for System Verilog testbench

2018-09-14 Thread Dale Marvin via Python-list
ardware engineers with the power of the Python ecosystem." It supports synthesis from the Python RTL Models: <http://docs.myhdl.org/en/stable/manual/rtl.html> - Dale On Friday, September 14, 2018, George Fischhof wrote: Bobby ezt írta (időpont: 2018. szept. 14., P 0:16):

Re: curses, ncurses or something else

2018-07-23 Thread Dale Marvin via Python-list
ut having to install another library. Ideas invited. You didn't tell us much about your application but for analysis and display I like Jupiter Notebook. Plus it's easy to add graphs etc. Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: julian 0.14 library

2018-04-04 Thread Dale Marvin via Python-list
going to work. >> >> the cheeseshop description says 3.2+ >> -- >> https://mail.python.org/mailman/listinfo/python-list >> On 4/4/18 3:35 PM, sum abiut wrote: I got the error below, tryinig in on python 3.2. import julian Traceback (most recent call last): File "", line 1, in ImportError: No module named julian On Thu, Apr 5, 2018 at 3:21 AM, Thomas Jollans wrote: Did you pip install julian into your python 3.2 installation? You may need type pip3 install julian depending upon how your python was installed. Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: IoT automation

2018-01-28 Thread Dale Marvin via Python-list
On 1/28/18 7:39 AM, Prahallad Achar wrote: Hello team, Could you please help me out in automation of IoT product end to end Regards Prahallad <https://micropython.org/> ? --Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-14 Thread Dale Marvin via Python-list
istory Professors, one in particular seemed to make it his life's purpose to say bad things about religion/bible etc. I should have known better than to get into such an off-topic quagmire. Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-14 Thread Dale Marvin via Python-list
e same false history that I was taught at college. There's much evidence that medieval scholars did not believe the earth was flat. <https://en.wikipedia.org/wiki/Myth_of_the_flat_Earth> Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3: Launch multiple commands(subprocesses) in parallel (but upto 4 any time at same time) AND store each of their outputs into a variable

2016-08-23 Thread Dale Marvin via Python-list
) Wait until all N commands are done > 5) Have an array of N strings with the stdout+stderr of each command in it. > > What is the best way to do this? The best way is a matter of opinion, I have had success using Celery with Redis. <http://www.celeryproject.org/> DAle -- https:/

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Dale Marvin via Python-list
e processing you are asking for and in a Python language syntax. Dale -- https://mail.python.org/mailman/listinfo/python-list

Introduction

2016-04-01 Thread Dale Marvin
I just sent my first post, been using python for about 12 years to automate media production tasks. Lately I've been adding testing (Thanks Ned Batchelder: <http://nedbatchelder.com/text/test0.html>), and documentation with Sphinx/rst. Thanks Dale Marvin digital OutPos

Re: Grab metadata from images and save to file, batch mode

2016-04-01 Thread Dale Marvin
ok at exiftool <http://www.sno.phy.queensu.ca/~phil/exiftool/> There are python bindings as well <http://smarnach.github.io/pyexiftool/>. Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: WeakValueDict and threadsafety

2011-12-10 Thread Darren Dale
On Dec 10, 2:09 pm, Duncan Booth wrote: > Darren Dale wrote: > > On Dec 10, 11:19 am, Duncan Booth > > wrote: > >> Darren Dale wrote: > > def get_data(oid): > >     with reglock: > >         data = registry.get(oid, None) > >         if da

Re: WeakValueDict and threadsafety

2011-12-10 Thread Darren Dale
On Dec 10, 11:19 am, Duncan Booth wrote: > Darren Dale wrote: > > I'm concerned that this is not actually thread-safe. When I no longer > > hold strong references to an instance of data, at some point the > > garbage collector will kick in and remove that entry from

WeakValueDict and threadsafety

2011-12-10 Thread Darren Dale
I am using a WeakValueDict in a way that is nearly identical to the example at the end of http://docs.python.org/library/weakref.html?highlight=weakref#example , where "an application can use objects IDs to retrieve objects that it has seen before. The IDs of the objects can then be used in other

multiprocessing in subpackage on windows

2011-04-20 Thread Darren Dale
I have two really simple scripts: C:\Python27\Scripts\foo --- if __name__ == '__main__': import bar bar.main() C:\Python27\Lib\site-packages\bar.py --- from multiprocessing import Pool def task(arg): return arg def main(): pool = Pool() res = pool.apply_async(task, (3.14,))

Re: two brief question about abstractproperty

2011-03-12 Thread Darren Dale
On Mar 12, 11:16 pm, Darren Dale wrote: > I've been reading PEP 3119 and the documentation for ABCs in the > python documentation. According to the PEP, the following should yield > an error, because the abstract property has not been overridden: > > import abc > class

two brief question about abstractproperty

2011-03-12 Thread Darren Dale
I've been reading PEP 3119 and the documentation for ABCs in the python documentation. According to the PEP, the following should yield an error, because the abstract property has not been overridden: import abc class C: __metaclass__ = abc.ABCMeta @abc.abstractproperty def x(self):

possible circular import problem with python-3, but not python-2

2010-09-27 Thread Darren Dale
I am attempting to contribute to the h5py project by porting the code for python-3. The code is available in a branch at github: http://github.com/darrendale/h5py/tree/py3k . That code uses cython to wrap the hdf5 library. So far, only a few minor changes have been needed (relative imports, change

Re: problem with simple multiprocessing script on OS X

2010-08-25 Thread Darren Dale
On Aug 24, 4:32 pm, Thomas Jollans wrote: > On Tuesday 24 August 2010, it occurred to Darren Dale to exclaim: > > > > > > > On Aug 23, 9:58 am, Darren Dale wrote: > > > The following script runs without problems on Ubuntu and Windows 7. > > > h5py is

Re: problem with simple multiprocessing script on OS X

2010-08-25 Thread Darren Dale
On Aug 24, 4:32 pm, Thomas Jollans wrote: > On Tuesday 24 August 2010, it occurred to Darren Dale to exclaim: > > > > > > > On Aug 23, 9:58 am, Darren Dale wrote: > > > The following script runs without problems on Ubuntu and Windows 7. > > > h5py is

Re: problem with simple multiprocessing script on OS X

2010-08-25 Thread Darren Dale
On Aug 24, 5:29 pm, Benjamin Kaplan wrote: > On Tue, Aug 24, 2010 at 3:31 PM, Darren Dale wrote: > > On Aug 23, 9:58 am, Darren Dale wrote: > >> The following script runs without problems on Ubuntu and Windows 7. > >> h5py is a package wrapping the hdf5 librar

Re: problem with simple multiprocessing script on OS X

2010-08-24 Thread Darren Dale
On Aug 23, 9:58 am, Darren Dale wrote: > The following script runs without problems on Ubuntu and Windows 7. > h5py is a package wrapping the hdf5 library (http://code.google.com/p/ > h5py/): > > from multiprocessing import Pool > import h5py > > def update(i): &

problem with simple multiprocessing script on OS X

2010-08-23 Thread Darren Dale
The following script runs without problems on Ubuntu and Windows 7. h5py is a package wrapping the hdf5 library (http://code.google.com/p/ h5py/): from multiprocessing import Pool import h5py def update(i): print i def f(i): "hello foo" return i*i if __name__ == '__main__': pool

python3 Unicode is slow

2009-10-25 Thread Dale Gerdemann
I've written simple code in 2.6 and 3.0 to read every charcter of a set of files and print out some information for each of these characters. I tested each program on a large Cyrillic/Latin text. The result was that the 2.6 version was about 5x faster. Here are the two programs: #!/usr/bin/env pyt

Re: efficient running median

2009-10-13 Thread Dale Dalrymple
computation to slide the window 1 element to be proportional to 2 bubble sorts of log window size instead of a window size sort. Good luck. Dale B. Dalrymple -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to use keyword arguments from C?

2009-07-13 Thread Darren Dale
On Jul 13, 9:38 am, Darren Dale wrote: > I am learning about the python C-api in order to contribute a feature > to numpy. I see a discussion (http://docs.python.org/extending/ > extending.html#keyword-parameters-for-extension-functions) on how to > create a function or method  in C

Is it possible to use keyword arguments from C?

2009-07-13 Thread Darren Dale
I am learning about the python C-api in order to contribute a feature to numpy. I see a discussion (http://docs.python.org/extending/ extending.html#keyword-parameters-for-extension-functions) on how to create a function or method in C that accepts kwargs, but is it possible to call such a method

Re: import and package confusion

2009-04-30 Thread Dale Amon
Gabriel gave me the key to a fine solution, so just to put a bow tie on this thread: #!/usr/bin/python import sys sys.path.extend (['../lib', '../bin']) from VLMLegacy.CardReader import CardReader rdr = CardReader ("../example/B767.dat","PRINTABLE") iotypes = ["WINGTL","VLMPC","VLM4997"] fo

Re: import and package confusion

2009-04-30 Thread Dale Amon
On Thu, Apr 30, 2009 at 04:33:57AM -0300, Gabriel Genellina wrote: > En Thu, 30 Apr 2009 03:04:40 -0300, alex23 escribió: >> Are you familiar with __import__? >> >> iotypes = ["WINGTL","VLMPC","VLM4997"] >> for iotype in iotypes: >> packagename = "VLMLegacy." + iotype + ".Conditions" >> classn

Re: import and package confusion

2009-04-30 Thread Dale Amon
On Thu, Apr 30, 2009 at 02:38:03AM -0400, Dave Angel wrote: > As Scott David Daniels says, you have two built-in choices, depending on > Python version. If you can use __import__(), then realize that > mod = __import__("WINGTL") > > will do an import, using a string as the import name. I do

Re: import and package confusion

2009-04-30 Thread Dale Amon
On Thu, Apr 30, 2009 at 08:32:31AM +0200, Jeroen Ruigrok van der Werven wrote: -On [20090430 02:21], Dale Amon (a...@vnl.com) wrote: >>import sys >>sys.path.extend (['../lib', '../bin']) >> >>from VLMLegacy.CardReader import CardReader >>

Re: Re: import and package confusion

2009-04-29 Thread Dale Amon
On Wed, Apr 29, 2009 at 10:02:46PM -0400, Dave Angel wrote: > The dot syntax works very > predictably, and quite flexibly. The problem was that by using the same > name for module and class, you didn't realize you needed to include both. It is one of the hazards of working in many very differ

Re: import and package confusion

2009-04-29 Thread Dale Amon
On Wed, Apr 29, 2009 at 04:06:23PM -0700, Scott David Daniels wrote: > Dale Amon wrote: >> >> The point I take away from this is that packages and >> modules have dotted names, but Classes do not and there >> is no way to do exactly what I wanted to do. > Nope.

Re: import and package confusion

2009-04-29 Thread Dale Amon
Well, I've managed to get close to what I want, and just so you can see: #!/usr/bin/python import sys sys.path.extend (['../lib', '../bin']) from VLMLegacy.CardReader import CardReader rdr = CardReader ("../example/B767.dat","PRINTABLE") iotypes = ["WINGTL","VLMPC","VLM4997"] for iotype in

Re: import and package confusion

2009-04-29 Thread Dale Amon
On Wed, Apr 29, 2009 at 03:06:13PM -0700, Scott David Daniels wrote: > You did not answer the question above, and I think the answer is the root > of your misunderstanding. A class and a module are _not_the_same_thing_. > sys is not a package, it is a module. >>> Just because you put a class insid

Re: import and package confusion

2009-04-29 Thread Dale Amon
On Wed, Apr 29, 2009 at 04:34:03PM -0400, Dale Amon wrote: > type = "VLM4997" > type.Header(args) > type.Plan(args) > type.Conditions(args) > Where the type might change from execution to execution > or even on different iterations. Actually l

Re: import and package confusion

2009-04-29 Thread Dale Amon
On Wed, Apr 29, 2009 at 01:12:33PM -0700, Scott David Daniels wrote: > Dale Amon wrote: >> I am trying to get to the heart of what it is I am >> missing. Is it the case that if you have a module C in a package A: >> A.C >> that there is no way to load it such that y

Re: import and package confusion

2009-04-29 Thread Dale Amon
I am trying to get to the heart of what it is I am missing. Is it the case that if you have a module C in a package A: A.C that there is no way to load it such that you can use: x = A.C() in your code? This is just a simpler case of what I'm trying to do now, which has a module

import and package confusion

2009-04-29 Thread Dale Amon
I am going around in circles right now and have to admit I do not understand what is going on with import of hierarchical packages/modules. Perhaps someone can get me on the road again. Here is a subset of what I am trying to accomplish: The package directory set up: VLMLegacy/

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Dale Roberts
contained to just the few routines that make up the state machine. It works very well, makes it easy to implement the state machine clearly, and is easy to understand and maintain. I can see where it could get very confusing to use this mechanism in a more general way. dale -- http://mail.python.org/mailman/listinfo/python-list

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Dale Roberts
nt. I'd made a modified version of my generator that was "for loop aware" and had two yields in it, but this seemed very fragile and hackish to me, and left my generator only usable inside a "for" loop. The wrapper method seems to be a much better way to go. dale -- http://mail.python.org/mailman/listinfo/python-list

send() to a generator in a "for" loop with continue(val)??

2009-04-17 Thread Dale Roberts
e from the idea of a "co- routine" style generator (where send() is used). Maybe combining the two idioms in this way would cause confusion? What do folks think? dale -- http://mail.python.org/mailman/listinfo/python-list

Re: any(), all() and empty iterable

2009-04-16 Thread Dale Roberts
> an empty iterable. > > as one of the instigators in this thread, I'm +1 on this solution. Yes, I now appreciate the motivation for having the word "all" in the text, and simply adding something like "or the iterable is empty" might head off future confusion. dale -- http://mail.python.org/mailman/listinfo/python-list

Re: any(), all() and empty iterable

2009-04-16 Thread Dale Roberts
the intended audience: programmers, who like to make sure all bases and cases are covered. dale -- http://mail.python.org/mailman/listinfo/python-list

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 12, 4:50 pm, Kay Schluehr wrote: > On 11 Apr., 20:15, Darren Dale wrote: > > > I am working on a project that provides a high level interface to hdf5 > > files by implementing a thin wrapper around h5py. > > I would like to > > generalize the project so the s

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 12, 3:23 pm, Aaron Brady wrote: > On Apr 12, 1:30 pm, Darren Dale wrote: > > > > > On Apr 11, 2:15 pm, Darren Dale wrote: > > _ > > > > format1.Group # implementation of group in format1 > > > format2.Group # ... > > > Base.DerivedGro

Re: design question, metaclasses?

2009-04-12 Thread Darren Dale
On Apr 11, 2:15 pm, Darren Dale wrote: > I am working on a project that provides a high level interface to hdf5 > files by implementing a thin wrapper around h5py. I would like to > generalize the project so the same API can be used with other formats, > like netcdf or ascii files

design question, metaclasses?

2009-04-11 Thread Darren Dale
I am working on a project that provides a high level interface to hdf5 files by implementing a thin wrapper around h5py. I would like to generalize the project so the same API can be used with other formats, like netcdf or ascii files. The format specific code exists in File, Group and Dataset clas

regexp strangeness

2009-04-09 Thread Dale Amon
This finds nothing: import re import string card = "abcdef" DEC029 = re.compile("[^&0-9A-Z/ $*,.\-:#@'=\"[<(+\^!);\\\]%_>?]") errs = DEC029.findall(card.strip("\n\r")) print errs This works correctly: import re import string card = "abcdef" DEC029 = re.compile("[^&0-9A-

Re: Computed attribute names

2009-04-08 Thread Dale Amon
On Wed, Apr 08, 2009 at 09:03:00PM +0200, paul wrote: > I'd say you can use: Thanks. I could hardly ask for a faster response on a HowTo than this! signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

Computed attribute names

2009-04-08 Thread Dale Amon
There are a number of things which I have been used to doing in other OO languages which I have not yet figured out how to do in Python, the most important of which is passing method names as args and inserting them into method calls. Here are two cases I have been trying to figure out for a curren

Re: Unix programmers and Idle

2009-04-03 Thread Dale Amon
Just in case anyone else finds it useful, to be precise I use: if opts.man: p1 = Popen(["echo", __doc__], stdout=PIPE) p2 = Popen(["pod2man"], stdin=p1.stdout, stdout=PIPE) p3 = Popen(["nroff","-man"], stdin=p2.stdout, stdout=PIPE) output = p3.co

Re: Unix programmers and Idle

2009-04-03 Thread Dale Amon
On Mon, Mar 30, 2009 at 10:54:56PM -0700, Niklas Norrthon wrote: > I make sure my scripts are on the form: > > # imports > # global initialization (not depending on sys.argv) > def main(): > # initialization (might depend on sys.argv) > # script logic > # other functions > if __name__ == '

Re: Unix programmers and Idle

2009-03-30 Thread Dale Amon
On Mon, Mar 30, 2009 at 09:47:24PM -0500, Dave Angel wrote: > See http://docs.python.org/library/idle.html and search for command line > > According to that page (for Python 2.6.1), you can set those parameters > on the command line that starts IDLE itself. > > I haven't tried it yet, as I'm u

Re: Unix programmers and Idle

2009-03-30 Thread Dale Amon
On Mon, Mar 30, 2009 at 08:11:10PM -0500, Dave Angel wrote: > I don't know what Idle has to do with it. sys.args contains the command > line arguments used to start a script. > > Dale Amon wrote: >> I wonder if someone could point me at documentation on how to debug

Unix programmers and Idle

2009-03-30 Thread Dale Amon
I wonder if someone could point me at documentation on how to debug some of the standard Unix type things in Idle. I cannot seem to figure out how to set my argument line for the program I am debugging in an Idle window. for example: vlmdeckcheck.py --strict --debug file.dat There must b

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 6, 1:32 pm, rdmur...@bitdance.com wrote: > Darren Dale wrote: > >On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > >> En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale > >> escribi : > > >> > On Mar 5, 12:02 pm, s...@pobo

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale   > escribió: > > > > > On Mar 5, 12:02 pm, s...@pobox.com wrote: > >> What happens if you simply call > > >>     my_thread.setDaemon(True) &g

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale   > escribió: > > > > > On Mar 5, 12:02 pm, s...@pobox.com wrote: > >> What happens if you simply call > > >>     my_thread.setDaemon(True) &g

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
On Mar 5, 12:02 pm, s...@pobox.com wrote: > What happens if you simply call > >     my_thread.setDaemon(True) > > (or in Python 2.6): > >     my_thread.daemon = True > > ?  That is the documented way to exit worker threads when you want the > application to exit.  From the threading module docs: >

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
Actually, this problem can also be seen by running this code as a script, it hangs up if the sys.exit lines are commented, and exits normally if uncommented. import atexit import threading import time class MyThread(threading.Thread): def __init__(self): threading.Thread.__init__(se

question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
I have a function that stops execution of a thread, and this function is registered with atexit.register. A simple example module is included at the end of this post, say its called test.py. If I do the following in the interactive interpreter, the thread stops executing as I hoped: >>> from test

Re: how to assert that method accepts specific types

2009-02-20 Thread Darren Dale
On Feb 20, 8:20 pm, Chris Rebert wrote: > On Fri, Feb 20, 2009 at 5:12 PM, Darren Dale wrote: > > I would like to assert that a method accepts certain types. I have a > > short example that works: > > > from functools import wraps > > > def accepts(*t

how to assert that method accepts specific types

2009-02-20 Thread Darren Dale
I would like to assert that a method accepts certain types. I have a short example that works: from functools import wraps def accepts(*types): def check_accepts(f): @wraps(f) def new_f(self, other): assert isinstance(other, types), \ "arg %r does n

Re: what gives with

2009-01-23 Thread Darren Dale
On Jan 22, 10:07 pm, Benjamin Peterson wrote: > Darren Dale gmail.com> writes: > > > Judging fromhttp://bugs.python.org/issue2400, this issue > > was fixed back in May 2008, but it is still present with python-2.5.4, > > which was released in December. Why wont py

what gives with "'import *' not allowed with 'from .'"?

2009-01-22 Thread Darren Dale
I know the use of "from foo import *" is discouraged, but I'm writing a package that I hope others may want to integrate as a subpackage of their own projects, I know what I'm doing, and I want to use the "from .bar import *" syntax internally. It works fine with python-2.6, but with python-2.5 I g

Re: Finding the instance reference of an object

2008-10-31 Thread Dale Roberts
On Oct 31, 2:27 am, greg <[EMAIL PROTECTED]> wrote: > Dale Roberts wrote: > > Are you > > saying that C++ is capable of using the Call By Reference idiom, but C > > is not, because C does not have a reference designation for formal > > function parameters? >

Re: Finding the instance reference of an object

2008-10-31 Thread Dale Roberts
On Oct 31, 3:15 am, greg <[EMAIL PROTECTED]> wrote: > Dale Roberts wrote: > > Just as the Pass By Reference idiom deserves a unique name to > > distinguish it from Pass By Value (even though it is often Pass By > > (address) Value internally), so Pass By Object Reference

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 30, 3:06 pm, Dale Roberts <[EMAIL PROTECTED]> wrote: > ... that idiom deserves a different name which > distinguishes it from the commonly accepted notion of Pass By Value. Bah, what I meant to end with was: Just as the Pass By Reference idiom deserves a unique name to disting

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
d within Python variables). But Python, unlike Java or most other commonly used languages, can ONLY EVER pass an object reference, and never an actual value I care about, and I think that idiom deserves a different name which distinguishes it from the commonly accepted notion of Pass By Value. Thanks for

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
ust for fun I did look at the assembler output, and, indeed, the output for examples 1 and 3 is absolutely identical. They are the same thing, as far as the CPU is concerned. Would you give them different names? dale -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-29 Thread Dale Roberts
plain and simple. Pass By Reference? So "postmodern". Who needs it. Show me a so-called "reference". I've looked at the assembler output and have never seen one. There is no such thing. "The continued attempts to obfuscate this is pointless and wrong." --- I hate to have to add this, but for those not paying close attention: ;-) dale (tongue back out of cheek now) -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
t... And when they tell their friend that Joe The Programmer said it's Pass By Value, your additional context may not be present any longer, and the friend will be very confused. In my opinion, best just to head it off and call it something different so as not to confuse. dale -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
On Oct 28, 2:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 28 Oct 2008 01:16:04 -0200, Dale Roberts <[EMAIL PROTECTED]>   > escribió: > > > > > So, then, what to tell a C++ programmer about how Python passes   > > arguments?

Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
asses. An assignment in Python binds a variable name to an object. The internal "value" of the variable is the memory address of an object, and can be seen with id(var), but is rarely needed in practice. The "value" that gets passed in a Python function call is

Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
f a reference/pointer to some other memory/object/array. In C, we would say that the VALUE of that variable is the memory address of another object. But you can, if you need to, get the address of the pointer variable, which points to the *address* of the other object. In Python, a variable is ONLY EVER a reference to an object. You cannot get the address of a Python variable, only of a Python object. Hope this clears things up. dale -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to add a property to an instance?

2008-07-22 Thread Darren Dale
GHUM wrote: >> Does anyone know if it is possible to add a property to an instance at >> runtime? I didn't see anything about it in the standard library's new >> module, google hasn't turned up much either. > > yes. You need nothing special, just add it: > > class fish(object): > pass > > a

is it possible to add a property to an instance?

2008-07-22 Thread Darren Dale
Does anyone know if it is possible to add a property to an instance at runtime? I didn't see anything about it in the standard library's new module, google hasn't turned up much either. Thanks, Darren -- http://mail.python.org/mailman/listinfo/python-list

windows installers and license agreement

2008-06-29 Thread Darren Dale
Is it possible to create a windows installer using distutils that includes a prompt for the user to agree to the terms of the license? Thanks, Darren -- http://mail.python.org/mailman/listinfo/python-list

improving performance of python webserver running python scripts in cgi-bin

2008-01-10 Thread Dale
e of operation where the program mostly performs my python I/O functions until an HTTP request comes in, and then it breaks out of the I/O operations to handle the HTTP request. thanks Dale -- http://mail.python.org/mailman/listinfo/python-list

python webserver question

2007-12-17 Thread dale bryan
uld point me in the right direction? thx Dale-- http://mail.python.org/mailman/listinfo/python-list

PDB scope problem

2007-10-22 Thread Dale Strickland-Clark
ver, the Python interpreter is happy with it if entered directly: >>> lstValues [[Decimal("1"), Decimal("47.0")]] >>> agg = [0,1] >>> print list([sum(v[i] for i in range(len(agg))) for v in lstValues]) [Decimal("48.0")] >>&

Re: MIMEText breaking the rules?

2007-08-05 Thread Dale Strickland-Clark
Tim Roberts wrote: > Dale Strickland-Clark <[EMAIL PROTECTED]> wrote: >> >>The email module's mimetext handling isn't what you might expect from >>something that appears to behave like a dictionary. >>... >>Having apparently REPLACED my rec

MIMEText breaking the rules?

2007-08-01 Thread Dale Strickland-Clark
gt; print msg.as_string() Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] A message >>> Having apparently REPLACED my recipient, what I've ended up with is both of them. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: python style guide inconsistencies

2007-04-23 Thread Darren Dale
Bjoern Schliessmann wrote: > Darren Dale wrote: > >> I was just searching for some guidance on how to name packages and >> modules, and discovered some inconsistencies on the >> www.python.org. http://www.python.org/doc/essays/styleguide.html >> says "Modu

python style guide inconsistencies

2007-04-22 Thread Darren Dale
I was just searching for some guidance on how to name packages and modules, and discovered some inconsistencies on the www.python.org. http://www.python.org/doc/essays/styleguide.html says "Module names can be either MixedCase or lowercase." That page also refers to PEP 8 at http://www.python.org/d

Re: string formatting: engineering notation

2007-03-14 Thread Darren Dale
[EMAIL PROTECTED] wrote: > On Mar 14, 1:14 pm, Darren Dale <[EMAIL PROTECTED]> wrote: >> Does anyone know if it is possible to represent a number as a string with >> engineering notation (like scientific notation, but with 10 raised to >> multiples of 3: 120e3, 1

Re: string formatting: engineering notation

2007-03-14 Thread Darren Dale
Steve Holden wrote: > Darren Dale wrote: >> Does anyone know if it is possible to represent a number as a string with >> engineering notation (like scientific notation, but with 10 raised to >> multiples of 3: 120e3, 12e-6, etc.). I know this is possible with the >>

question about class methods

2007-03-14 Thread Darren Dale
I've run across some code in a class method that I don't understand: def example(self, val=0) if val and not self: if self._exp < 0 and self._exp >= -6: I am unfamiliar with some concepts here: 1) Under what circumstances would "if not self" be True? 2) If "not self" is

string formatting: engineering notation

2007-03-14 Thread Darren Dale
Does anyone know if it is possible to represent a number as a string with engineering notation (like scientific notation, but with 10 raised to multiples of 3: 120e3, 12e-6, etc.). I know this is possible with the decimal.Decimal class, but repeatedly instantiating Decimals is inefficient for my ap

Re: list of range of floats

2007-02-14 Thread Dale Strickland-Clark
Steve wrote: > I'm trying to create a list range of floats and running into problems. > I've been trying something like: > > a = 0.0 > b = 10.0 > > flts = range(a, b) > > fltlst.append(flts) > > When I run it I get the following DeprecationWarning: integer argument > expected, got float. How c

Re: What's going on here?

2006-11-23 Thread Dale Strickland-Clark
Thanks for the answers. I am informed but I don't feel enlightened. It does strike me as odd that an apparently empty subclass should add extra function to the base class. Not at all obvious. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Rive

What's going on here?

2006-11-22 Thread Dale Strickland-Clark
e "", line 1, in ? AttributeError: 'object' object has no attribute 'spam' >>> class b(object): ...pass ... >>> a = b() >>> a <__main__.b object at 0xb7b4dcac> >>> a.spam = 1 >>> What is subclassing adding to th

Re: Providing full interaction with the run time

2006-11-01 Thread Dale Strickland-Clark
Thanks for the info. I didn't know about that module. I'll take a look. Fredrik Lundh wrote: > Dale Strickland-Clark wrote: > >> We have a system we're developing which runs as a server. It has an >> xml-rpc interface which I've extended to provide some deb

Re: Hooking file open

2006-11-01 Thread Dale Strickland-Clark
this? I > realize that some dependencies will still fall through my checks, > especially file opens from C extensions, which is fine. I just want to > be able to detect the most common use cases. Any other suggestions are > appreciated. > > -Farshid -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Providing full interaction with the run time

2006-10-29 Thread Dale Strickland-Clark
t this throws away expression results so that's no help. At the moment, I'm making a crude attempt to distinguish between statements and expressions but it's easily fooled. So the question is: how does my debug interface (which operates over RPC) decide which type of COMPILE it wants? Or am I going about this all wrong? (I don't need warnings about the obvious security implications of this interface.) Thanks -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's CRT licensing on Windows

2006-10-25 Thread Dale Strickland-Clark
To paraphrase an applicant for a job vacancy we're currently filling when asked to give an example of their problem solving skills: A client had a problem with Windows XP on his laptop. I reformatted his hard disk and installed Red Hat. Problem solved. -- Dale Strickland-Clark Riverhall Sy

We're recruiting Python programmers

2006-10-17 Thread Dale Strickland-Clark
I'll keep this brief. Please see the web site for details Thanks. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Tim N. van der Leeuw wrote: > > Hi, > > select lastval(); > Thanks, that was useful. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Hi Harald Thanks for that, somewhat comprehensive, answer. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
is out? Thanks. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >