Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Sat, 08 Nov 2008 19:30:17 +1300, greg wrote: > Something has just occurred to me. If you take the view that the value > of an expression is an object, then the terms "value" and "object" are > synonymous. So far so good. > So if you then insist that Python uses "call by object", you're actual

Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Sat, 08 Nov 2008 18:31:47 +1300, greg wrote: > Marc 'BlackJack' Rintsch wrote: > >> You have said the value that is copied is a pointer to the object. > > This assumes that "call by value" means "call by copying the value". > > That assumption is WRONG. Not according to my Comp Sci lecturer

using datetime containers

2008-11-07 Thread indika
Hi, I'm a newbie to python but have some experience in programming. I came across this requirement of using datetime.date objects associated with some another object. eg. a dictionary containing datetime.date => string >> { datetime.date(2001, 12, 3): 'c', datetime.date(2001, 12, 1): 'a', datetime.

Re: Finding the instance reference of an object

2008-11-07 Thread greg
Joe Strout wrote: On Nov 5, 2008, at 2:06 PM, Lie wrote: Another example: pass-by-object. Here's where we depart, I guess. I think there's no such thing (see for example, and the dead-tree references I have on hand agree). Something has

Re: Finding the instance reference of an object

2008-11-07 Thread greg
Arnaud Delobelle wrote: 'Pass by value' is not relevant to Python as variables do not contain anything. Where abouts in the phrase "pass by value" does the word "contain" appear? You don't need a notion of containment in order for "pass by value" to have meaning. All you need is some notion o

Re: Very simple - please help

2008-11-07 Thread Mark Tolonen
"Chris Rebert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Fri, Nov 7, 2008 at 8:52 PM, pineapple <[EMAIL PROTECTED]> wrote: I am not a python programmer, but am being forced to port one of my (smalltalk) applications to python for pragmatic reasons (python is embedded with

Re: Finding the instance reference of an object

2008-11-07 Thread greg
Marc 'BlackJack' Rintsch wrote: You have said the value that is copied is a pointer to the object. This assumes that "call by value" means "call by copying the value". That assumption is WRONG. It doesn't mean that. It means "call by ASSIGNING the value." So, you can think of the value of a

Re: Very simple - please help

2008-11-07 Thread Chris Rebert
On Fri, Nov 7, 2008 at 8:52 PM, pineapple <[EMAIL PROTECTED]> wrote: > I am not a python programmer, but am being forced to port one of my > (smalltalk) applications to python for pragmatic reasons (python is > embedded with a graphics package I am switching over to, so to use the > graphics packag

Very simple - please help

2008-11-07 Thread pineapple
I am not a python programmer, but am being forced to port one of my (smalltalk) applications to python for pragmatic reasons (python is embedded with a graphics package I am switching over to, so to use the graphics package I am essentially forced to use python). Okay, enough background. At any r

Re: Are .pyc files portable?

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 19:01:31 -0800, Wubbulous wrote: > Python compiles to bytecode, which means that pyc files can be > interpreted by any Python executable regardless of platform. No, bytecode isn't compatible from one version number to another. -- Steven -- http://mail.python.org/mailman/li

Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Sat, 08 Nov 2008 17:12:00 +1300, greg wrote: > Steven D'Aprano wrote: >> Python's behaviour is not the same as what Pascal, or C, calls >> call-by-value. > > Python's assignment is not the same as what Pascal or C calls > assignment, either. Yet we don't hear anyone claim that the term > "assi

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 13:05:16 -0700, Joe Strout wrote: > In Python, AFAICT, there is only one type, the object reference. So, > the type of every variable is 'reference', and each one contains a > reference. This is wrong. If we take "variable" to mean "name", then Python names do not have types

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
In an attempt to keep this post from hitting the ridiculous length of one of my posts last night, I'm going to skip over a lot of things Joe writes that aren't critical. Just because I've skipped over a comment doesn't mean I agree with it, merely that I don't think it gains much to argue the p

Re: Finding the instance reference of an object

2008-11-07 Thread greg
Steven D'Aprano wrote: Python's behaviour is not the same as what Pascal, or C, calls call-by-value. Python's assignment is not the same as what Pascal or C calls assignment, either. Yet we don't hear anyone claim that the term "assignment" shouldn't be used in Python. The difference between c

Python COM: Automatic wrap/unwrap?

2008-11-07 Thread Greg Ewing
I'm creating a COM server in Python that will have one main class, with methods that create and return instances of other classes. I've found that I need to use win32com.server.util.wrap and unwrap on these objects when they pass over a COM connection. This doesn't seem very convenient, especiall

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steve Holden wrote: > Lawrence D'Oliveiro wrote: > >> In message >> <[EMAIL PROTECTED]>, >> Michele Simionato wrote: >> >>> On Nov 7, 4:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: >>> Seriously, though, although Python does indeed support multiple inheri

Re: Is there a way to step debug the multiprocessing python program?

2008-11-07 Thread Aaron Brady
On Nov 7, 9:15 pm, "davy zhang" <[EMAIL PROTECTED]> wrote: > I mean every process attach like thread in wingide > > like thread or tasklet in wingide > > :) > > maybe I asked t much:D Here is where 'multiprocessing' assembles the command line to spawn the subprocess (Windows version):

Re: using exec() to instantiate a new object.

2008-11-07 Thread Aaron Brady
On Nov 7, 4:23 pm, RyanN <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to teach myself OOP to do a data project involving > hierarchical data structures. > > I've come up with an analogy for testing involving objects for > continents, countries, and states where each object contains some > att

Is there a way to step debug the multiprocessing python program?

2008-11-07 Thread davy zhang
I mean every process attach like thread in wingide like thread or tasklet in wingide :) maybe I asked t much:D -- http://mail.python.org/mailman/listinfo/python-list

Re: Are .pyc files portable?

2008-11-07 Thread Wubbulous
Python compiles to bytecode, which means that pyc files can be interpreted by any Python executable regardless of platform. As for manual compilation to directories, the py_compile module is the one you want. Here's an example program to plug in. #test_compile.py# import py_compile print "hello

Are .pyc files portable?

2008-11-07 Thread Roy Smith
I'm using Python as part of a test fixture for a large (mostly C++) software project. We build on a lot of different platforms, but Solaris is a special case -- we build on Solaris 8, and then run our test suite on Solaris 8, 9, and 10. The way the build system is set up (driven by Build Forge),

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Aaron Brady
On Nov 7, 3:39 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Aaron Brady <[EMAIL PROTECTED]> writes: > >  Furthermore, some class models variables like this: > > > a.b= 'abc' > > a.c= 'def' > > a.d= 'ghi' > > > It also allows index access: a[0], a[1], a[2], respectively.  'abc' > > has two name

marshal locks program even in thread

2008-11-07 Thread Zac Burns
Greetings, It seems that marshal.load will lock the problem if the file object (in this case a pipe) is not ready to be read from - even if it's done in a thread. The use case here is in writing a scripting interface for perforce using the -G option (http://www.perforce.com/perforce/doc.072/manua

Re: Finding the instance reference of an object

2008-11-07 Thread Douglas Alan
Joe Strout <[EMAIL PROTECTED]> writes: > Yes, OK, that's great. But there are several standard pass-by- > somethings that are defined by the CS community, and which are simple > and clear and apply to a wide variety of languages. "Pass by object" > isn't one of them. "Call-by-sharing" *is* one

Re: Extending Logger

2008-11-07 Thread polettog
On Nov 7, 8:23 pm, Matimus <[EMAIL PROTECTED]> wrote: > > Yes but in the other hand > > :http://docs.python.org/library/logging.html#logger-objects > > "Note that Loggers are never instantiated directly, but always through > > the module-level function logging.getLogger(name)." > > That is part of

Re: best way to accelerate xmlrpc?

2008-11-07 Thread skip
Mark> I've got some python xmlrpc servers and clients. What's the best Mark> way to accelerate them? Mark> xmlrpclib.py attempts to import these modules: Mark> import _xmlrpclib Mark> import sgmlop Mark> from xml.parsers import expat sgmlop always worked wel

best way to accelerate xmlrpc?

2008-11-07 Thread mh
I've got some python xmlrpc servers and clients. What's the best way to accelerate them? xmlrpclib.py attempts to import these modules: import _xmlrpclib import sgmlop from xml.parsers import expat and falls back to defining the SlowParser class. So, which of these modules is the pr

Re: Finding the instance reference of an object

2008-11-07 Thread Douglas Alan
Joe Strout <[EMAIL PROTECTED]> writes: > As for where I get my definitions from, I draw from several sources: > > 1. Dead-tree textbooks You've been reading the wrong textbooks. Read Liskov -- she's called CLU (and hence Python's) calling strategy "call-by-sharing" since the 70s. > 2. Wikipedia

Re: using exec() to instantiate a new object.

2008-11-07 Thread Patrick Mullen
On Fri, Nov 7, 2008 at 2:23 PM, RyanN <[EMAIL PROTECTED]> wrote: > > to do this I tried: > >def addCountry(self,country_name): ># create an instance of country >exec(country_name + "= country('" + country_name + "')") ># Add this new instance of a country to a list >

Re: creating a block file for file-like object

2008-11-07 Thread Iain
On Nov 7, 4:42 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, Iain > wrote: > > > Can someone give me some pointers as to how I might create some sort > > of blocking device file or named pipe ... > >     mkfifo /path/to/named/pipe Th

Re: Snippets management

2008-11-07 Thread Edwin
On Nov 7, 5:38 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > I've to extract the right libs from the larger program, > as I'm in an import crisis right now, > it may take a couple of days. > If it's not here by the end of next week, > mail be directly, because I forget a lot :-) > > cheers, > Stef

Re: Snippets management

2008-11-07 Thread Edwin
On Nov 7, 6:36 pm, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > > Since you are in Linux you should definitely check "Basket". Go to it's > website and you'll be hooked, just what you need. Actually I use Mac OS and Free BSD but I'll check it out mate. Thanks for the tip!! -- http://mail.python.org/

Re: Snippets management

2008-11-07 Thread Stef Mientki
expora wrote: On Nov 6, 12:38 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: Edwin wrote: Hi there, I've been looking for a snippet manager and found PySnippet but it requires PyGTK. Do you know any other option that doesn't need much? I'm sort of new to python and user inte

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message > <[EMAIL PROTECTED]>, > Michele Simionato wrote: > >> On Nov 7, 4:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: >> >>> Seriously, though, although Python does indeed support multiple >>> inheritance, I have the impression from comments over the years that it

Re: Snippets management

2008-11-07 Thread Ricardo Aráoz
Edwin B. wrote: > Robert Lehmann <[EMAIL PROTECTED]> writes: > >> I don't think there is a one-size-fits-all solution. > > I definetly agree. > >> Setting up a 'snippets' repository sounds good if you just want to be >> able to look back at what you've done and/or have a place to stash away >>

Re: etymology of "list comprehension"?

2008-11-07 Thread mh
"Martin v. Lowis" <[EMAIL PROTECTED]> wrote: > The definition in logic, in turn, matches my understanding of the > English word "to comprehend": If I know all attributes, marks, > etc of an object, I understand it fully, i.e. I comprehend it. I think also that as was pointed out, "comprehension" m

using exec() to instantiate a new object.

2008-11-07 Thread RyanN
Hello, I'm trying to teach myself OOP to do a data project involving hierarchical data structures. I've come up with an analogy for testing involving objects for continents, countries, and states where each object contains some attributes one of which is a list of objects. E.g. a country will con

Re: What exactly is an "Implementation of Python" ?

2008-11-07 Thread Fiedzia
webtourist wrote: > Warning: New learner here > > Not sure what the term means "implementation of Python". > So what exactly does it mean *"implementation of Python"* like > cpython, Jython, IronPython ? Python is a programming language. Python implementation means Python interpreter or com

What exactly is an "Implementation of Python" ?

2008-11-07 Thread webtourist
Warning: New learner here Not sure what the term means "implementation of Python". So what exactly does it mean *"implementation of Python"* like cpython, Jython, IronPython ? In terms of IronPython --- does it mean a Python programmer can write .Net app in Python ? Thanks examples and ANA

Re: Python25\Tools\checkversions.py

2008-11-07 Thread Colin J. Williams
Martin v. Löwis wrote: I suggest that consideration be given to dropping it and and versionchecker from the distribution. I see that it still appears in versions 2.6 and 3.0. Please submit a bug report to bugs.python.org to this effect. Regards, Martin Done: components: Tests files: pyvers

Re: Daemon and logging - the best approach?

2008-11-07 Thread Lech Karol Pawłaszek
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Lech Karol Pawłaszek wrote: > >> And now I want to read logging config file before daemonize the program >> because the file might not be accessible after daemonization. > > Why might it be inaccessible just because you've daemonized?

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Arnaud Delobelle
Aaron Brady <[EMAIL PROTECTED]> writes: > Furthermore, some class models variables like this: > > a.b= 'abc' > a.c= 'def' > a.d= 'ghi' > > It also allows index access: a[0], a[1], a[2], respectively. 'abc' > has two names: 'a.b', and 'a[0]'. Correct? You know very well that a.b and a[0] aren't

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Aaron Brady
On Nov 7, 3:03 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Joe Strout <[EMAIL PROTECTED]> writes: > > So.  How about this for a summary? > > > "Python uses call-by-sharing.  That's a special case of call-by-value > > where the variables are references to objects; it is these references > > th

Re: Weird behavior with lexical scope

2008-11-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Terry Reedy wrote: > [EMAIL PROTECTED] wrote: > >> class Outer: >>def __init__(self): >> class Inner: >> def __init__(self): pass >> a = Inner() > > This create a duplicate Inner class object for every instance of Outer, > which is almost c

Re: (Windows) "Dropping" stuff onto a Python script

2008-11-07 Thread Aaron Brady
On Nov 6, 2:56 am, [EMAIL PROTECTED] wrote: > Hello people, > > I'd like to have the functionality known from "real" executables that > if I drag-drop a file icon on top of the app, the app starts and has > the file's path as command-line argument. > > However, this doesn't seem to work with Python

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Michele Simionato wrote: > On Nov 7, 4:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > >> Seriously, though, although Python does indeed support multiple >> inheritance, I have the impression from comments over the years that it's >> used a lot less than in other lan

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steve Holden
Joe Strout wrote: > On Nov 7, 2008, at 12:13 PM, Terry Reedy wrote: [...] >>> I wonder if that could be tested systematically. Perhaps we could >>> round up 20 newbies, divide them into two groups of 10, give each one >>> a 1-page explanation either based on passing object references >>> by-value,

Re: Calling Python from Python and .pyc problem

2008-11-07 Thread Steve Holden
Terry Reedy wrote: > David Shi wrote: >> Hello, there. >> >> I am using Python 2.5. I used py_compile and made a .pyc file. > > No need usually. > >> However, it runs but never stops. What is the best way to >> >> compile a .py file. > > When you run a .py file, it automatically compiles and

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Arnaud Delobelle
Joe Strout <[EMAIL PROTECTED]> writes: > So. How about this for a summary? > > "Python uses call-by-sharing. That's a special case of call-by-value > where the variables are references to objects; it is these references > that are copied to the parameters, not the objects themselves. For > user

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Fri, Nov 7, 2008 at 7:02 PM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> What if I need the parse method to be called in other parts of the >> program? > > I don't understand!? Then you call it from those other parts. Yes, you're right. Don't know why, but I was thinking to use @cl

Re: Calling Python from Python and .pyc problem

2008-11-07 Thread Terry Reedy
David Shi wrote: Hello, there. I am using Python 2.5. I used py_compile and made a .pyc file. No need usually. However, it runs but never stops. What is the best way to compile a .py file. When you run a .py file, it automatically compiles and write a .pyc file if there is no .pyc fi

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 12:35 PM, Terry Reedy wrote: http://en.wikipedia.org/wiki/Call_by_something#Call_by_sharing Call by sharing Also known as "call by object" or "call by object-sharing" is an evaluation strategy first named by Barbara Liskov et al for the language CLU in 1974[1]. It is use

Re: More __init__ methods

2008-11-07 Thread Terry Reedy
Duncan Booth wrote: Mr.SpOOn <[EMAIL PROTECTED]> wrote: Now I must pass a and b to the main constructor and calculate them in the classmethods. class foo: def __init__(self, a, b): self.a = a self.b = b @classmethod def from_string(self, ..): ...

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 12:13 PM, Terry Reedy wrote: Python has two types of names. Some complex objects -- modules, classes, and functions, and wrappers and subclasses thereof, have 'definition names' that are used instead of a 'value' to print a representation. Otherwise, names are identifie

Re: .pyc keeps running and never stops

2008-11-07 Thread Terry Reedy
Shao wrote: Dear All, I am using Python 2.5 and used py_compile to produce a .pyc file. The script runs well. However, the .pyc keeps running and never stops. Advices will be deeply appreciated. You have either an infinite loop or a computation that runs longer than your patience. If I cou

Re: is it a bug in Module copy or i am wrong??

2008-11-07 Thread Terry Reedy
yoma wrote: python version 2.5 in module copy we all know that copy have two method: copy() and deepcopy(). and the explain is - A shallow copy constructs a new compound object and then (to the extent possible) inserts *the same objects* into it that the original contains. - A deep copy con

Re: @contextlib question

2008-11-07 Thread Peter Otten
Neal Becker wrote: > http://www.python.org/doc/2.5.2/lib/module-contextlib.html has this > example: from contextlib import contextmanager > > @contextmanager > def tag(name): > print "<%s>" % name > yield > print "" % name > > contexlib.contextmanager doc string (2.5.1) says: > T

Re: Daemon and logging - the best approach?

2008-11-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Lech Karol Pawłaszek wrote: > And now I want to read logging config file before daemonize the program > because the file might not be accessible after daemonization. Why might it be inaccessible just because you've daemonized? -- http://mail.python.org/mailman/list

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Terry Reedy
Steven D'Aprano wrote: On Fri, 07 Nov 2008 08:48:19 -0700, Joe Strout wrote: Unfortunately, the term "name" is *slightly* ambiguous in Python. There are names, and then there are objects which have a name attribute, which holds a string. This attribute is usually called __name__ but sometimes

Re: Daemon and logging - the best approach?

2008-11-07 Thread Neal Becker
Lech Karol Pawłaszek wrote: > Hello. > > I'm trying to make a daemon and I want to log to a file its activity. > I'm using logging module with a configuration file for it (loaded via > fileConfig()). > > And now I want to read logging config file before daemonize the program > because the file m

Re: Finding the instance reference of an object

2008-11-07 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 07 Nov 2008 11:37:28 -0500, Steve Holden wrote: > >> Steven D'Aprano wrote: >>> On Fri, 07 Nov 2008 10:50:55 -0500, Steve Holden wrote: >>> I am probably egregiously misunderstanding. The practical difficulty with the "moving huge blocks of data" approach

Re: Extending Logger

2008-11-07 Thread Matimus
> Yes but in the other hand > :http://docs.python.org/library/logging.html#logger-objects > "Note that Loggers are never instantiated directly, but always through > the module-level function logging.getLogger(name)." That is part of the power of the logging module. If you ask for a logger of the

Re: Django or TurboGears or Pylons? for python web framework.

2008-11-07 Thread Daniel Fetchinson
> Hi Senior, > > There was a case for web site that will be public to Internet for me. I like > python so I do not consider the use of Ruby on Rails. > > I searched more web framework of python from Google. The good solution just > only there are Django, TurboGears and Pylons. > > Just from my pref

Re: Daemon and logging - the best approach?

2008-11-07 Thread Lech Karol Pawłaszek
J Kenneth King wrote: [...] > Depends. > > For *NIX systems, it's a good idea to use the syslog daemon for logging > where it's available. True, however it's more convenient to have certain application logs in its own place sometimes. > I believe the logging module can be configured to log to th

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I need some help getting output values from my stored procedures when > using adodbapi. There's an example > testVariableReturningStoredProcedure in adodbapitest.py, and that > works for my system. But my stored procedure

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Terry Reedy
Joe Strout wrote: On Nov 6, 2008, at 10:35 PM, Steve Holden wrote: Note: I tried to say "name" above instead of "variable" but I couldn't bring myself to do it -- "name" seems to generic to do that job. Python has two types of names. Some complex objects -- modules, classes, and functions,

Re: (Windows) "Dropping" stuff onto a Python script

2008-11-07 Thread Roger Upole
This is done via a drop handler. Add registry key HKCR\Python.File\shellex\DropHandler with a default value of {86C86720-42A0-1069-A2E8-08002B30309D} Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello people, > > I'd like to have the functionality known from "r

@contextlib question

2008-11-07 Thread Neal Becker
http://www.python.org/doc/2.5.2/lib/module-contextlib.html has this example: from contextlib import contextmanager @contextmanager def tag(name): print "<%s>" % name yield print "" % name contexlib.contextmanager doc string (2.5.1) says: Typical usage: @contextmanager

Re: Extending Logger

2008-11-07 Thread polettog
On Nov 7, 12:17 am, Thomas Christensen <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > I took a look to the logging module which was quite sexy at a first > > sight, but then i finally realized the following : the Logger class > > can't be extended since a Logger is created only with get

Re: Simple - Pretty Printing (pprint) a list with a max width?

2008-11-07 Thread Paul McGuire
On Nov 7, 9:45 am, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > Perhaps it's not supposed to work like this but I thought if you > supplied a width to pprint it would nicely format a list to the > width. > > KEYS = ['search_keys', 'Section', 'site', 'Employee', 'JobClassCode', > 'XBoss', 'Depar

Re: Trying to set a date field in a access databse

2008-11-07 Thread Roger Upole
You should be able to pass a PyTime or datetime.datetime object. Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I cannot get the following code to work > > import win32com.client > import time > > engine = win32com.client.Dispatch("DAO.DBEngine.36") > db=en

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 10:29 AM, Steven D'Aprano wrote: Note: I tried to say "name" above instead of "variable" but I couldn't bring myself to do it -- "name" seems to generic to do that job. Lots of things have names that are not variables: modules have names, classes have names, methods hav

Re: [urllib2 + Tor] How to handle 404?

2008-11-07 Thread Steven McKay
On Fri, Nov 7, 2008 at 2:28 AM, Chris Rebert <[EMAIL PROTECTED]> wrote: > > On Fri, Nov 7, 2008 at 12:05 AM, Gilles Ganault <[EMAIL PROTECTED]> wrote: > > Hello > > > >I'm using the urllib2 module and Tor as a proxy to download data > > from the web. > > > > Occasionnally, urlllib2 returns

RE: Django or TurboGears or Pylons? for python web framework.

2008-11-07 Thread Sells, Fred
I use Flex (from adobe) for the client side and turbogears for the server side and pass xml or json in between. It gives you a Flash client which is very Sexy and browser independent and very simple turbogears code in Python. Flex is essentially open source, but the IDE is about $295, although the

Re: Finding the instance reference of an object

2008-11-07 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Nov 2008 11:37:28 -0500, Steve Holden wrote: > Steven D'Aprano wrote: >> On Fri, 07 Nov 2008 10:50:55 -0500, Steve Holden wrote: >> >>> I am probably egregiously misunderstanding. The practical difficulty >>> with the "moving huge blocks of data" approach would appear to emerge >>> whe

Re: More __init__ methods

2008-11-07 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Nov 2008 17:23:21 +0100, Mr.SpOOn wrote: > On Fri, Nov 7, 2008 at 4:16 PM, Duncan Booth > <[EMAIL PROTECTED]> wrote: >> There is a really big advantage to being explicit in this situation: >> you no longer have to make sure that all your constructors use a unique >> set of types. Consid

Re: Daemon and logging - the best approach?

2008-11-07 Thread J Kenneth King
Lech Karol Pawłaszek <[EMAIL PROTECTED]> writes: > Hello. > > I'm trying to make a daemon and I want to log to a file its activity. > I'm using logging module with a configuration file for it (loaded via > fileConfig()). > > And now I want to read logging config file before daemonize the program >

Re: overloading for ladder logic

2008-11-07 Thread Aaron Brady
On Nov 7, 7:48 am, [EMAIL PROTECTED] wrote: > I am trying to simulate the execution of some PLC ladder logic in > python. > > I manually modified the rungs and executed this within python as a > proof of concept, but I'd like to be able to skip the  modification > step.  My thought was that this mi

Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 11:37:28 -0500, Steve Holden wrote: > Steven D'Aprano wrote: >> On Fri, 07 Nov 2008 10:50:55 -0500, Steve Holden wrote: >> >>> I am probably egregiously misunderstanding. The practical difficulty >>> with the "moving huge blocks of data" approach would appear to emerge >>> whe

Re: plot for sale

2008-11-07 Thread D'Arcy J.M. Cain
On Fri, 07 Nov 2008 18:10:00 +0100 Mario Testinori <[EMAIL PROTECTED]> wrote: > Unless you're breeding pythons there, you're offtopic. Arrggghhh!!! Stop responding to spam! Please! -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves http://www.druid.net/darcy/

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 08:48:19 -0700, Joe Strout wrote: > I think of it this way: every variable is an object reference; no > special syntax needed for it because that's the only type of variable > there is. (Just as with Java or .NET, when dealing with any class type; > Python is just a little mor

Re: Can this be done in py?

2008-11-07 Thread Mathieu Prevot
2008/11/7 Robert Singer <[EMAIL PROTECTED]>: > Now, don't get me wrong if this is a trivial question, or even an > apsurd one. I'm new to python, so my mileage may vary. > > I have several exe files, console applications that pretty much run on > the principle: > first.exe > Enter file name: start

Can this be done in py?

2008-11-07 Thread Robert Singer
Now, don't get me wrong if this is a trivial question, or even an apsurd one. I'm new to python, so my mileage may vary. I have several exe files, console applications that pretty much run on the principle: first.exe Enter file name: start.dat second.exe Enter file name: filename.dat ... y

Re: efficient Python object count

2008-11-07 Thread darrenr
> Here you > are:http://svn.python.org/projects/python/branches/release25-maint/Misc/S... Excellent, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: plot for sale

2008-11-07 Thread Mario Testinori
On Fri, 7 Nov 2008 04:27:04 -0800 (PST), "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >SELL OUT land area with 12,681 ha, located at the entrance to the town >of Pazardzhik(Bulgaria) in city limits and has 106 meters >individual . "Dimcho Debelyanov (Miryansko road). A plot in the new >economic

Re: Can I hide internal method calls from an exception stack trace?

2008-11-07 Thread Paul McGuire
On Nov 7, 10:30 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Paul McGuire wrote: > > Is there any way to hide portions of an exception stack trace?  When > > Add a try...except at the appropriate level. Why do you want to do anything > more complex? > > Peter I thought I tried that, and now in ret

Calling Python from Python and .pyc problem

2008-11-07 Thread David Shi
Hello, there.I am using Python 2.5. I used py_compile and made a .pyc file. However, it runs but never stops. What is the best way tocompile a .py file.I am trying to customise the attached script to do the following:calling an external Python script and passing parameters into it.And run the

Re: declaration problem

2008-11-07 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: > On Fri, 07 Nov 2008 16:05:22 +0530, devi thapa wrote: > >> I am using the command >> >> recv(..) to receive a message from client. >> >> retval = recv(my_socket, *buf, len(buf) , 0) >> >> and its giving this error >> >> File "./server1.py", line 31 >> retval

Re: Finding the instance reference of an object

2008-11-07 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 07 Nov 2008 10:50:55 -0500, Steve Holden wrote: > >> I am probably egregiously misunderstanding. The practical difficulty >> with the "moving huge blocks of data" approach would appear to emerge >> when a function that gets passed an instance of some container then

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread leesquare
Thanks for that excellent pointer! I was able to do just what you said with But if my procedure has an insert statement in its midst, it doesn't work. The cursor.fetchall() gets an exception. Any ideas? --Li -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I hide internal method calls from an exception stack trace?

2008-11-07 Thread Peter Otten
Paul McGuire wrote: > Is there any way to hide portions of an exception stack trace?  When Add a try...except at the appropriate level. Why do you want to do anything more complex? Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Fri, Nov 7, 2008 at 4:16 PM, Duncan Booth <[EMAIL PROTECTED]> wrote: > There is a really big advantage to being explicit in this situation: you no > longer have to make sure that all your constructors use a unique set of > types. Consider: > > class Location(object): >def __init__(self, lat,

Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 10:50:55 -0500, Steve Holden wrote: > I am probably egregiously misunderstanding. The practical difficulty > with the "moving huge blocks of data" approach would appear to emerge > when a function that gets passed an instance of some container then > calls another function that

Re: Can I hide internal method calls from an exception stack trace?

2008-11-07 Thread alex23
On Nov 8, 1:25 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > Is there any way for me to suppress these non-value-added API-internal > traceback levels? Hey Paul, Have you taken a look at the traceback module? print_tb(sys.last_traceback, ) or extract_tb(sys.last_traceback, limit) could do the tr

Re: Finding the instance reference of an object

2008-11-07 Thread Steven D'Aprano
On Thu, 06 Nov 2008 21:31:16 -0700, Joe Strout wrote: >> You're wrong, Python variables don't contain *anything*. Python >> variables are names in a namespace. > > I think we're saying the same thing. What's a name? It's a string of > characters used to refer to something. That which refers to

Re: Finding the instance reference of an object

2008-11-07 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 07 Nov 2008 00:44:21 -0500, Steve Holden wrote: > >> Steven D'Aprano wrote: >>> On Thu, 06 Nov 2008 09:59:37 -0700, Joe Strout wrote: >> [...] >>> And by definition, "call by value" means that the parameter is a copy. >>> So if you pass a ten megabyte data structur

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Michele Simionato
On Nov 7, 4:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Seriously, though, although Python does indeed support multiple inheritance, > I have the impression from comments over the years that it's used a lot less > than in other languages where it is more of a common idiom. Certainly in my > own

Simple - Pretty Printing (pprint) a list with a max width?

2008-11-07 Thread rh0dium
Hi all, Perhaps it's not supposed to work like this but I thought if you supplied a width to pprint it would nicely format a list to the width. KEYS = ['search_keys', 'Section', 'site', 'Employee', 'JobClassCode', 'XBoss', 'Department', 'LocationDesc', 'cn', 'Division', 'Fax', 'Secti

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 6, 2008, at 10:35 PM, Steve Holden wrote: That's good to hear. Your arguments are sometimes pretty good, and usually well made, but there's been far too much insistence on all sides about being right and not enough on reaching agreement about how Python's well-defined semantics for ass

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Tim Golden
Aaron Gray wrote: "Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] In article <[EMAIL PROTECTED]>, Tim Golden <[EMAIL PROTECTED]> wrote: Aaron Gray wrote: Wikipedia says Python has Multiple Inheritance, is this true ? http://en.wikipedia.org/wiki/Multiple_inheritan

  1   2   >