Shane Geiger wrote:
> If I understand you correctly, you want this:
>
> module.__file__
No, this is for a module that isn't loaded, and
I don't want to load it. What I needed was "imp.find_module()".
I don't want to load the module in the current Python instance.
I need its path so I can star
Miki wrote:
> http://docs.python.org/lib/module-imp.html
Ah. "imp.find_module". I was looking in "sys" and
path-related places. Thanks.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
<[EMAIL PROTECTED]> wrote:
>> > fact 1: CPython compiles source code to byte-code.
>> > fact 2: CPython executes this byte-code.
>> > fact 3: Sun's JDK compiles source code to byte-code.
>> > fact 4: Sun's JDK executes this byte-code.
>>
>> Fact 4 is misleading because it is only one option availa
If I understand you correctly, you want this:
module.__file__
John Nagle wrote:
>Python's own loader searches "sys.path" for module names, but is there
> some function that makes that search functionality accessible to
> Python programs? I need the absolute pathname of a module, with the
Hello John,
> Python's own loader searches "sys.path" for module names, but is there
> some function that makes that search functionality accessible to
> Python programs? I need the absolute pathname of a module, with the
> search being done exactly the same way "import" does it. The loader f
Python's own loader searches "sys.path" for module names, but is there
some function that makes that search functionality accessible to
Python programs? I need the absolute pathname of a module, with the
search being done exactly the same way "import" does it. The loader for
"egg" files has th
Benjamin wrote:
> On Jan 14, 6:26 pm, Bjoern Schliessmann [EMAIL PROTECTED]> wrote:
>> John Nagle wrote:
>>> It turns out that the strings in the "env" parameter have to be
>>> ASCII, not Unicode, even though Windows fully supports Unicode in
>>> CreateProcess.
>> Are you sure it supports Unicode,
Hello Eric,
> I'd appreciate any pointer on a simple way to tell within an event handler
> where the event came from.
def HandleSomething(self, event):
generating_control = event.GetEventObject()
print generating_control
HTH,
--
Miki Tebeka <[EMAIL PROTECTED]>
http://pythonwise.blogspot.c
Thanks it's good to know. iPyton looks really neat.
On 15/01/2008, Ben Finney <[EMAIL PROTECTED]> wrote:
> John Machin <[EMAIL PROTECTED]> writes:
>
> > C:\junk>python demomore.py | more
>
> Your example uses the OS shell to invoke a pager on the output of the
> Python process. The OP was asking a
>Has it been decided how Python 3.0 will implement os.listdir on Unix?
> Will there be only a single attempt to encode using the current locale
> or will there be a backup technique?
That's what it currently does.
> I'd probably define an optional
> encoding parameter so you can ask for os.li
On Jan 14, 11:47 pm, Richard Szopa <[EMAIL PROTECTED]> wrote:
> Could you tell me what are the pros and cons of the two approaches
> (i.e. writing a decorator function and a decorator descriptor class)?
I prefer to use a class for introspection sake, since
there is no way to get information about
I'd appreciate any pointer on a simple way to tell within an event handler
where the event came from.
I want to have "while" condition in a handler to stop or change processing
if an event occurs from some other button click.
Trying to bind more than one event to the same handler still doesn't t
Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> Ben Finney <[EMAIL PROTECTED]> writes:
>
> > Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> >> __init__ *is* the closest equivalent to what other languages
> >> would call a constructor.
> >
> > No. That would be '__new__', which actually constructs the
>
George Sakkis <[EMAIL PROTECTED]> writes:
> On Jan 14, 5:39 pm, Ben Finney <[EMAIL PROTECTED]>
> wrote:
>
> > I think of NotImplemented as equivalent to None; it's useful as a
> > sentinel value to set an attribute to in (e.g.) an abstract class.
>
> My guess would be that it is more of an imple
grackle <[EMAIL PROTECTED]> writes:
> On Jan 14, 6:28 pm, Ben Finney <[EMAIL PROTECTED]>
> wrote:
> > Release your package as free software on the Cheeseshop
> > http://cheeseshop.python.org/>. If the name you want is
> > already taken, pick one that will help users distinguish yours
> > from the
Hi everyone,
I'm trying to write a python script to whois a few domains twice a day
so I get notified when they become available. I did it 2 ways, but
neither way is very reliable, so I'm asking here.
1) I tried just calling "whois %s" using popen, but I found that once
every few weeks, I get err
On Tue, 15 Jan 2008 00:00:45 +0100, Hrvoje Niksic wrote:
> Ben Finney <[EMAIL PROTECTED]> writes:
>
>> Hrvoje Niksic <[EMAIL PROTECTED]> writes:
>>
>>> Wildemar Wildenburger <[EMAIL PROTECTED]> writes:
>>> > __init__() /initializes/ an instance (automatically after creation).
>>> > It is called,
On Jan 14, 6:26 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> I passed a dict for the "env" variable to Popen with Unicode strings
> for the dictionary values.
>
> Got:
>
>File "D:\Python24\lib\subprocess.py", line 706, in _execute_child
> TypeError: environment can only contain s
On Jan 14, 6:26 pm, Bjoern Schliessmann wrote:
> John Nagle wrote:
> > It turns out that the strings in the "env" parameter have to be
> > ASCII, not Unicode, even though Windows fully supports Unicode in
> > CreateProcess.
>
> Are you sure it supports Unicode, not UTF8 or UTF16? Probably using
>
http://weblogs.asp.net/bsimser/archive/2008/01/10/simcity-source-code-released-to-the-wild-let-the-ports-begin.aspx
The release appears to include both a C/Tcl/TK version and a C++/Python
version of at least part.
"The code hopefully serves as a good example of how to use SWIG to
integrate C++
On Mon, 14 Jan 2008 15:15:28 -0800, Paul Rubin wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>> map = {'a': Aclass, 'b': Bclass, 'c': Cclass} class_ = map.get(astring,
>> default=Zclass)
>>
>> The result I want is the class, not the result of calling the class
>> (which would be an instanc
Hi,
I have a python module that keeps on crashing with various windows
errors (not BSOD but the less lethal windows XP popup ones). Now these
are intentional and rather sporadic so I cant really solve it by
attempting to fix the crash; rather what Im trying to do is make another
module outside
Thanx
However I knew Chaco and matplotlib, and I use matplotlib during my
school days. And as I have pointed out, they are for "plot", but not
"chart". If you don't know the difference between plot and chart, you
can have a look at at http://www.jfree.org/jfreechart,
http://www.rmchart.com
Yes, it
On Jan 14, 7:53 am, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> I really need to publish this one day or another, since these
> questions
> about super keeps coming out:
>
> http://www.phyast.pitt.edu/~micheles/python/super.html
Please do. It is a very enlightening discussion, and I'm sure a bu
On Jan 14, 5:39 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> I think of NotImplemented as equivalent to None; it's useful as a
> sentinel value to set an attribute to in (e.g.) an abstract class.
My guess would be that it is more of an implementation performance
decision than semantic. Checking 'i
George Sakkis <[EMAIL PROTECTED]> writes:
> What's the best way to simulate dynamically scoped variables ala Lisp ?
Ugh check the docs for the python 2.5 "with" statement, which
gives you sort of a programmable unwind-protect (more powerful than
try/except). You'd have an environment diction
On Jan 14, 6:28 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> grackle <[EMAIL PROTECTED]> writes:
> What do you mean by "top-level module", and "the same top-level name"?
> Do you mean "the same fully-qualified name"? If two modules are in
> separate places in the hierarchy, they will have different
I am writing an order management console. I need to create an import
system that is easy to extend. For now, I want to accept an dictionary
of values and map them to my data model. The thing is, I need to do
things to certain columns:
- I need to filter some of the values (data comes in as -MM
On Jan 14, 11:44 am, grackle <[EMAIL PROTECTED]> wrote:
> Obviously Java-style naming is a mistake in Python, since top-level
> names have to be unique. Is there a standard naming convention to
> facilitate mixing code from different sources, such as
> mygroupname_modulename? Is there a best prac
grackle <[EMAIL PROTECTED]> writes:
> I do use packages. I mentioned the Java naming conventions because
> they were my first thought for solving the problem of name clashes,
> and they work well in some non-Java languages. They don't apply well
> to Python, since every top-level module has a uniq
John Nagle wrote:
> It turns out that the strings in the "env" parameter have to be
> ASCII, not Unicode, even though Windows fully supports Unicode in
> CreateProcess.
Are you sure it supports Unicode, not UTF8 or UTF16? Probably using
something like u"thestring".encode("utf16") will help.
Rega
I passed a dict for the "env" variable to Popen with Unicode strings
for the dictionary values.
Got:
File "D:\Python24\lib\subprocess.py", line 706, in _execute_child
TypeError: environment can only contain strings
It turns out that the strings in the "env" parameter have to b
Martin v. Löwis:
> That's not true. Try open("\xff","w"), then try interpreting the file
> name as UTF-8. Some byte strings are not meaningful UTF-8, hence that
> approach cannot work.
Has it been decided how Python 3.0 will implement os.listdir on
Unix? Will there be only a single attempt t
On Jan 14, 4:47 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> I'm not sure, but it sounds as though you have yet to discover Python
> module packages http://www.python.org/doc/essays/packages.html>.
> They allow a hierarchy of modules in directories.
I do use packages. I mentioned the Java naming c
On Jan 14, 11:05 pm, thebjorn <[EMAIL PROTECTED]>
wrote:
> I don't remember if CLOS was changed to use C3 Linearization also, but
> the concept came from Dylan (http://www.webcom.com/haahr/dylan/
> linearization-oopsla96.html) and that's what is implemented in Python.
The Common Lisp ANSI standar
On Jan 14, 2:37 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> Unless I missed it, PEP 328 doesn't mention anything about this.
> What's the reason for not allowing "from .relative.module import *' ?
I'm just guessing: it could accidentally create infinite recursion.
Or, perhaps something more sub
Ben Finney <[EMAIL PROTECTED]> writes:
> I think of NotImplemented as equivalent to None
Not "equivalent"; rather "comparable in usage".
--
\ "[W]e are still the first generation of users, and for all that |
`\ we may have invented the net, we still don't really get it." |
_o__)
On Jan 14, 4:22 pm, iu2 <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I've got three files:
>
> file a1.py:
>
> the_number = None
>
> file a2.py:
>
> import a1
>
> def init():
> a1.the_number = 100
>
> file a3.py:
>
> from a1 import the_number
> import a2
>
> a2.init()
> pr
> Ah. Can one call it after the full call has been done:
> locale.setlocale(locale.LC_ALL,'')
> locale.setlocale(locale.LC_ALL)
> Without any issues?
If you pass LC_ALL, then some systems will give you funny results
(semicolon-separated enumerations of all the categoryies). Instead,
pick a specifi
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> map = {'a': Aclass, 'b': Bclass, 'c': Cclass}
> class_ = map.get(astring, default=Zclass)
>
> The result I want is the class, not the result of calling the class
> (which would be an instance). If I wanted the other semantics, I'd be
> using defaultd
Ben Finney <[EMAIL PROTECTED]> writes:
> Hrvoje Niksic <[EMAIL PROTECTED]> writes:
>
>> Wildemar Wildenburger <[EMAIL PROTECTED]> writes:
>> > __init__() /initializes/ an instance (automatically after
>> > creation). It is called, /after/ the instance has been constructed
>>
>> I don't understand
On Jan 14, 6:01 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> George Sakkis <[EMAIL PROTECTED]> writes:
> > Unless I missed it, PEP 328 doesn't mention anything about this.
> > What's the reason for not allowing "from .relative.module import *'
> > ?
>
> It makes the code much harder to follow visua
John Machin <[EMAIL PROTECTED]> writes:
> C:\junk>python demomore.py | more
Your example uses the OS shell to invoke a pager on the output of the
Python process. The OP was asking about paging *within* the Python
shell.
To my knowledge there's nothing in the default Python shell that
enables wha
On Jan 14, 5:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> BerlinBrown schrieb:
>
> > Is it possible to just build the binary content of a zip file. I want
> > to create the content in memory (e.g. return binary data) and then get
> > those byte strings representing the zip file? Is that
George Sakkis <[EMAIL PROTECTED]> writes:
> Unless I missed it, PEP 328 doesn't mention anything about this.
> What's the reason for not allowing "from .relative.module import *'
> ?
It makes the code much harder to follow visually and inspect with
static analysis tools, since there's no way to s
I'd like to inform the Python community that the powerful and popular
Template Toolkit system, previously available only in its original
Perl implementation, is now also available in a beta Python
implementation:
http://tt2.org/python/index.html
I created this port both as a fun programming proje
BerlinBrown schrieb:
> Is it possible to just build the binary content of a zip file. I want
> to create the content in memory (e.g. return binary data) and then get
> those byte strings representing the zip file? Is that possible?
>
> Or could I possibly override functions in the zip class.
>
On Jan 14, 1:53 pm, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> I really need to publish this one day or another, since these
> questions
> about super keeps coming out:
>
> http://www.phyast.pitt.edu/~micheles/python/super.html
Thanks, Michele! Your essay was enlightening [2]. Specially if yo
grackle <[EMAIL PROTECTED]> writes:
> Obviously Java-style naming is a mistake in Python, since top-level
> names have to be unique. Is there a standard naming convention to
> facilitate mixing code from different sources, such as
> mygroupname_modulename? Is there a best practices guide for mod
> You get the full locale name with locale.setlocale(category) (i.e.
> without the second argument)
Ah. Can one call it after the full call has been done:
locale.setlocale(locale.LC_ALL,'')
locale.setlocale(locale.LC_ALL)
Without any issues?
> > I need that two-letter code that's hidden in a
> > t
George Sakkis <[EMAIL PROTECTED]> writes:
> By the way, why do we need both NotImplementedError and the
> NotImplemented singleton object ? Couldn't we have just one of them ?
One of them is an exception class, the other is not. They have rather
different semantics.
I think of NotImplemented as
Sylvain Thénault <[EMAIL PROTECTED]> writes:
> I'm pleased to announce a new release of pylint [1] and logilab-astng
> [2]. I haven't personally found a lot of time to work on those projects
> since the latest releases but others contributors have and so I decided
> to publish releases including v
Michele Simionato <[EMAIL PROTECTED]> writes:
> I really need to publish this one day or another, since these
> questions about super keeps coming out:
>
> http://www.phyast.pitt.edu/~micheles/python/super.html
Yes, please. Your article has improved my understanding just from
skimming the main h
Robert Latest <[EMAIL PROTECTED]> writes:
> And, contrary to the advice I gave elsethread, unfortunately it's
> impossible to just drop uncooperative customers when you develop GPL
> software ;-)
On the contrary. The GPL includes a big fat "NO WARRANTY" clause. If
you're not selling warranties to
Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> Wildemar Wildenburger <[EMAIL PROTECTED]> writes:
> > __init__() /initializes/ an instance (automatically after
> > creation). It is called, /after/ the instance has been constructed
>
> I don't understand the purpose of this "correction". After all,
>
Is it possible to just build the binary content of a zip file. I want
to create the content in memory (e.g. return binary data) and then get
those byte strings representing the zip file? Is that possible?
Or could I possibly override functions in the zip class.
1. Create a zip file object (e.g.
On Jan 14, 1:41 pm, Richard Szopa <[EMAIL PROTECTED]> wrote:
> On Jan 13, 3:31 pm, thebjorn <[EMAIL PROTECTED]>
> wrote:
>
> > They do, except for when it comes to what super(..) returns. It isn't
> > really an object in the sense that they're presented in the tutorial,
> > but rather a sort of pro
> But how can Python determine when you want the result to be *the
> callable* and when you want it to be *the result of calling the
> callable*?
>
> Functions and other callables are first-class objects, and it is quite
> reasonable to have something like this:
>
> map = {'a': Aclass, 'b': B
teddyber wrote:
> here's the solution i have for the moment :
>
> t = shlex.shlex(data)
> t.wordchars = t.wordchars + "/+.-"
> r=''
> while 1:
> token = t.get_token()
> if not token:
> break
> if not token==',': r = r+token
>
On Jan 14, 1:20 pm, jerryji <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Sorry for this newbie question, I was puzzled why the existing
> property of an object is not shown in the dir() function output.
>
> "v" is an lxml Element object variable --
>
> In [44]: v
> Out[44]:
>
> In [45]: dir(v)
> Out[45]:
> Given that getlocale() is not to be used, what's the best way to get the
> locale later in the app?
You get the full locale name with locale.setlocale(category) (i.e.
without the second argument)
> I need that two-letter code that's hidden in a
> typical locale like en_ZA.utf8 -- I want that
Thank you Jorgen. Your answer helped me a lot.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 14 Jan 2008 12:08:52 -0800, Paul Rubin wrote:
> aspineux <[EMAIL PROTECTED]> writes:
>> Yes, I missed 'get' and 'setdefault' are functions :-) Then why not
>> some new semantic
>>
>> d.get('a', f()) --> d['a', f()]
>> d.setdefault('a', f()) --> d['a'=f()]
>>
>> Is is a good idea enou
On Jan 14, 5:46 pm, Karsten Hilbert <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have a problem withloggingan exception.
>
> environment:
>
> Python 2.4, Debian testing
>
> ${LANGUAGE} not set
> ${LC_ALL} not set
> ${LC_CTYPE} not set
> ${LANG}=de_DE.UTF-8
>
On Mon, 14 Jan 2008 12:46:48 +, Robert Latest wrote:
> And, contrary to the advice I gave elsethread, unfortunately it's
> impossible to just drop uncooperative customers when you develop GPL
> software ;-)
Just because you are writing GPLed code doesn't mean you are permanently
linked to an
Hi all
I've got three files:
file a1.py:
the_number = None
file a2.py:
import a1
def init():
a1.the_number = 100
file a3.py:
from a1 import the_number
import a2
a2.init()
print the_number, type(the_number)
Runninr a3.py I get:
None
Changing a3.py to:
import a
On Mon, 14 Jan 2008 22:18:44 +1100, Ben Finney wrote:
> What one is "in reality" calling is the '__new__' method of the Person
> class. That function, in turn, is creating a new Person instance, and
> calling the '__init__' method of the newly-created instance. Finally,
> the '__new__' method retu
Hi,
Sorry for this newbie question, I was puzzled why the existing
property of an object is not shown in the dir() function output.
"v" is an lxml Element object variable --
In [44]: v
Out[44]:
In [45]: dir(v)
Out[45]:
['__copy__',
'__deepcopy__',
'__reduce__',
'append',
'clear',
'find',
On 12 jan, 19:37, marcstuart <[EMAIL PROTECTED]> wrote:
> How do I divide a list into a set group of sublist's- if the list is
> not evenly dividable ?
> consider this example:
>
> x = [1,2,3,4,5,6,7,8,9,10]
> y = 3 # number of lists I want to break x into
> z = y/x
>
> what I would like to ge
Thanks John, but would it be possible to remain in the python interpreter?
On 14/01/2008, John Machin <[EMAIL PROTECTED]> wrote:
> On Jan 15, 7:35 am, "Alex K" <[EMAIL PROTECTED]> wrote:
> > Hi Tim,
> >
> > Yes I mean piping the output into "more" for example.
> >
>
> Why don't you "suck it and se
On Jan 15, 7:35 am, "Alex K" <[EMAIL PROTECTED]> wrote:
> Hi Tim,
>
> Yes I mean piping the output into "more" for example.
>
Why don't you "suck it and see"???
E.g.
C:\junk>copy con demomore.py
for i in range(100):
print 'line', i
^Z
1 file(s) copied.
C:\junk>python demomore.py | m
On Jan 15, 4:50 am, [EMAIL PROTECTED] wrote:
> """
>
> time.clock() isn't high enough resolution for Ubuntu, and time.time()
> isn't
> high enough resolution on windows.
>
> Take a look at datetime. It is good to the micro-second on Linux and
> milli-second on Windows.
> """
On Windows, time.clo
Hi Tim,
Yes I mean piping the output into "more" for example.
Alex
On 14/01/2008, Tim Roberts <[EMAIL PROTECTED]> wrote:
> "Alex K" <[EMAIL PROTECTED]> wrote:
> >
> >Does anyone know if the python shell supports paging or if I should
> >look into iPython? Thank you so much.
>
> "Paging" is an ov
What's the best way to simulate dynamically scoped variables ala
Lisp ? The use case is an open-ended set of objects that need to
access the same piece of information (e.g. a dict, a ConfigParser
object, a logger etc.). I know that the "proper" OO and functional way
is to pass the information expl
Thanks to Tim Golden suggestions I solved my problem.
...In case it would help someone:
import _winreg
import win32security
username = 'Administrator'
sid = win32security.ConvertSidToStringSid(
win32security.LookupAccountName(None, username)[0]
)
key = _winreg.OpenKey(
_win
aspineux <[EMAIL PROTECTED]> writes:
> Yes, I missed 'get' and 'setdefault' are functions :-)
> Then why not some new semantic
>
> d.get('a', f()) --> d['a', f()]
> d.setdefault('a', f()) --> d['a'=f()]
>
> Is is a good idea enough to change the python semantic ?
> Or simply is it a good idea
Michael Sparks wrote:
> It is sufficient, and running with Kamaelia from /trunk, your
> listener does indeed shutdown correctly
Great, thanks for validating. :)
> My suggestion for the moment would be to use the code on /trunk
> since this is stable at present (development happens on branches
>
Dan Stromberg wrote:
> Is there a particular reason why bags didn't go into 2.5.x or 3000?
>
> I keep wanting something like them - especially bags with something akin
> to set union, intersection and difference.
>
How about this recepie
http://www.ubookcase.com/book/Oreilly/Python.Cookbook.2nd
Unless I missed it, PEP 328 doesn't mention anything about this.
What's the reason for not allowing "from .relative.module import *' ?
George
--
http://mail.python.org/mailman/listinfo/python-list
Erik Lind wrote:
> I see a more complicated thread on a similar sounding question, but my
> question is simpler, I hope.
numpy questions are usually answered better on the numpy mailing list.
http://www.scipy.org/Mailing_Lists
> I have a large numpy matrix, initially created as:
>
> Mat = z
[EMAIL PROTECTED] wrote:
> """
>
> time.clock() isn't high enough resolution for Ubuntu, and time.time()
> isn't > high enough resolution on windows.
>
> Take a look at datetime. It is good to the micro-second on Linux and
> milli-second on Windows.
datetime.datetime.now() does the same thing
I see a more complicated thread on a similar sounding question, but my
question is simpler, I hope.
I have a large numpy matrix, initially created as:
Mat = zeros((a,b), int)
and a smaller array with other data
Sub = [1,2,3,4,5],[6,7,8,9,0]
I want to replace a section of Mat matrix with Sub m
On Jan 14, 7:49 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On Jan 14, 2008 12:39 PM, aspineux <[EMAIL PROTECTED]> wrote:
>
>
>
> > This append in both case
>
> > dict(a=1).get('a', f())
> > dict(a=1).setdefault('a', f())
>
> > This should be nice if f() was called only if required.
>
> Think a
On Jan 14, 8:21 am, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote:
> Giampaolo Rodola' wrote:
> > Hi all,
> > I'm trying to use the pywin32 extension to find out the user's home
> > directory but currently I didn't find a solution yet.
> > What I'd need to do is not getting the home directory of th
"Reedick, Andrew" <[EMAIL PROTECTED]> writes:
>> Only if by "construct" you mean "allocate". __init__ starts out
>> with an empty object and brings it to a valid state, therefore
>> "constructing" the object you end up with. That operation is
>> exactly what other languages call a constructor.
>
On Jan 14, 2008 1:39 PM, aspineux <[EMAIL PROTECTED]> wrote:
>
> This append in both case
>
> dict(a=1).get('a', f())
> dict(a=1).setdefault('a', f())
>
> This should be nice if f() was called only if required.
Shortcomings of those methods is probably why collections.defaultdict
is so popular.
>
Hi Rüdiger,
Thanks for your message. I liked your approach and I've been trying
something along exactly these sorts of lines, but I have a few
problems and queries.
The first problem is that the id of the frame object can be re-used,
so for example this code (where I haven't defined InstanceTrac
On Jan 14, 1:51 am, "Mark Tolonen" <[EMAIL PROTECTED]>
wrote:
> "Lie" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
>
>
> >A built-in exceptions, when raised, would print traceback that points
> > out the offending code, like this:
>
> > Traceback (most recent call last):
> > F
On Jan 14, 2008 12:39 PM, aspineux <[EMAIL PROTECTED]> wrote:
>
> This append in both case
>
> dict(a=1).get('a', f())
> dict(a=1).setdefault('a', f())
>
> This should be nice if f() was called only if required.
>
Think about the change to Python semantics that would be required for
this to be tru
On Jan 14, 2008 12:08 PM, Reedick, Andrew <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of Hrvoje Niksic
> > Sent: Monday, January 14, 2008 11:29 AM
> > Only if by "construct" you mean "allocate". __init__ star
This append in both case
dict(a=1).get('a', f())
dict(a=1).setdefault('a', f())
This should be nice if f() was called only if required.
Regards.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 13, 9:22 am, Massi <[EMAIL PROTECTED]> wrote:
> Hi everyone! In my application (under windows) I'm using a
> wx.checklistbox. I would like the background color of an item to
> become red whenever an EVT_LISTBOX_DCLICK occurs. Is there any simple
> way to achieve it?
> Thanks in advance.
Did
On Jan 7, 2:46 am, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Lie a écrit :
>
> > On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote:
>
> >>Jeroen Ruigrok van der Werven wrote:
>
> >>>Shouldn't this be:
>
> >>>self.startLoc = start
> >>>self.stopLoc = stop
>
> >>Thanks! Of course it should. Old Java
Hello,
I have a html file over here by the name guide_ind.html and it
contains links to other html files like guides.html#outline . How do I
point BeautifulSoup (I want to use this module) to
guides.html#outline ?
Thanks
Shriphani P.
--
http://mail.python.org/mailman/listinfo/python-list
"""
time.clock() isn't high enough resolution for Ubuntu, and time.time()
isn't
high enough resolution on windows.
Take a look at datetime. It is good to the micro-second on Linux and
milli-second on Windows.
"""
import datetime
begin_time=datetime.datetime.now()
for j in range(10):
x =
Dear all,
I have a problem with logging an exception.
environment:
Python 2.4, Debian testing
${LANGUAGE} not set
${LC_ALL} not set
${LC_CTYPE} not set
${LANG}=de_DE.UTF-8
activating user-default locale with returns: [de_DE.UTF-8]
local
Is there a particular reason why bags didn't go into 2.5.x or 3000?
I keep wanting something like them - especially bags with something akin
to set union, intersection and difference.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 12, 6:56 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 12 Jan 2008 15:47:05 -0500, Mike Meyer wrote:
> > There's an apparently common bug here: you don't want to pass super
> > self.__class__, but the class that the method is bound to.
>
> Given an instance met
I was able to start IDLE from the command line, and reset my keyboard
shortcuts. It works fine now. In case this happens again, where
would I find the config file?
--
http://mail.python.org/mailman/listinfo/python-list
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Hrvoje Niksic
> Sent: Monday, January 14, 2008 11:29 AM
> To: python-list@python.org
> Subject: Re: __init__ explanation please
>
> Mel <[EMAIL PROTECTED]> writes:
>
> >> I don't understand the
1 - 100 of 153 matches
Mail list logo