(BTW, why 03.02f? The output will always have at least 4 chars, so 03
doesn't mean anything... Maybe you want {0:06.2f} (three places before the
decimal point, two after it, filled with 0's on the left)?)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
']
py> list(myslice(lst, -5, None, None)) # as in lst[-5:]
['v', 'w', 'x', 'y', 'z']
py>py> list(myslice(lst, None, None, -1)) # as in lst[::-1]
['z', 'y', 'x', 'w', 'v', 'u', 't', 's', ..., 'a']
Slice objects are not-so-well known, and are documented here:
http://docs.python.org/reference/datamodel.html#types
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ess only supports a few fields). You can
find the structure definition in the Microsoft documentation:
http://msdn.microsoft.com/en-us/library/ms686285(VS.85).aspx
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
te it for me?
XMLRPCServer doesn't reassign or alter sys.stderr, just uses it in the
log_message method. I'd look in some other place...
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ept a tendency to shrten vrble nmes :) )
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
quot;)
hello
Presumably he's using Python 3:
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
p3> import sys
p3> sys.stdout.write("hello")
hello5
See http://bugs.python.org/issue6345
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
#x27;llh0l' specifies two pad bytes at
the end, assuming longs are aligned on 4-byte boundaries. This only works
when native size and alignment are in effect; standard size and alignment
does not enforce any alignment."""
py> calcsize("BB")
11
py> calcsize("BB0h")
12
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
#x27;llh0l' specifies two pad bytes at
the end, assuming longs are aligned on 4-byte boundaries. This only works
when native size and alignment are in effect; standard size and alignment
does not enforce any alignment."""
py> calcsize("BB")
11
py> calcsize("BB0h")
12
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Thu, 15 Oct 2009 16:28:11 -0300, Peng Yu escribió:
On Thu, Oct 15, 2009 at 12:01 PM, Gabriel Genellina
wrote:
En Thu, 15 Oct 2009 13:05:18 -0300, Peng Yu
escribió:
How do I determine if I have loaded all the elements? I use the
following code. I'm wondering if there is any b
QOTW: "It is however, much like the framework in question, best kept private
and not made public." - Ed Singleton, on a "perfectly healthful and
acceptable" practice ... left unnamed here
http://groups.google.com/group/comp.lang.python/msg/987b1a7a4b9 01f3f
Looking for a sane way of
En Thu, 15 Oct 2009 13:24:18 -0300, Rami Chowdhury
escribió:
On Thu, 15 Oct 2009 09:11:00 -0700, Austin Bingham
wrote:
On Thu, Oct 15, 2009 at 5:15 PM, Gabriel Genellina
wrote:
En Thu, 15 Oct 2009 11:42:20 -0300, Austin Bingham
escribió:
I think you didn't understand corr
ist.output/serialize_list.pkl', 'wb')
for e in alist:
pickle.dump(e, output)
output.close()
input=open('serialize_list.output/serialize_list.pkl', 'rb')
try:
while 1:
e = pickle.load(input)
print e
except EOFError:
pass
Pickle the list length before
ist.output/serialize_list.pkl', 'wb')
for e in alist:
pickle.dump(e, output)
output.close()
input=open('serialize_list.output/serialize_list.pkl', 'rb')
try:
while 1:
e = pickle.load(input)
print e
except EOFError:
pass
Pickle the list length before
unny_key_extractor(o), o) for o in objs)
If you feel so inclined, you could implement the MutableSet ABC based on
this and have a full featured set implementation.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ne instead of generating HTML by code).
Used to be at http://dustman.net/andy/python/HyperText but no more :(
There is a trimmed down version here:
http://www.astro.umass.edu/~dpopowich/python/mpservlets/ (see _HTML.py
inside the tutorial)
--
Gabriel Genellina
--
http://mail.python.o
c", replace_spc_error_handler)
print u"¡añá membuí!".encode("ascii", "replace_spc")
print "¡añá membuí!".decode("ascii", "replace_spc")
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ing server to shut down"
server.shutdown()
if sys.argv[1]=="server": server()
elif sys.argv[1]=="client": client()
=== end xmlrpcshutdown.py ===
C:\TEMP>start python xmlrpcshutdown.py server
C:\TEMP>python xmlrpcshutdown.py client
Connecting to XML-RPC server on
your app), that
depends on the OS and desktop you're using. On Windows I think there's a
library named pyhook or similar.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Wed, 14 Oct 2009 05:19:06 -0300, Ulrich Eckhardt
escribió:
Gabriel Genellina wrote:
#ifdef _DEBUG
#undef _DEBUG
#include
#define _DEBUG
#else
#include
#endif
[...to keep Python from linking against non-existant debug libraries.]
No, don't do that. Just compile your applicati
anced):
http://www.dabeaz.com/generators/
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
twork: DNS
resolution, IPv6 (Windows XP has some timeout issues with IPv6 enabled).
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Thu, 08 Oct 2009 14:18:48 -0300, Gabriel Genellina
escribió:
En Thu, 08 Oct 2009 00:33:04 -0300, §äŽmÅ Ãâ¬vªº...@â¬Ã¹â¬Ã
escribió:
I try to call thread.interrupt_main() function in my child thread's run
method
which is inherit threading.Thread class.
But it didn
.
It's been suggested that I replace the first part of my C++ code with
the following, and then try to compile in release mode:
#ifdef _DEBUG
#undef _DEBUG
#include
#define _DEBUG
#else
#include
#endif
No, don't do that. Just compile your application in release mode.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
.
It's been suggested that I replace the first part of my C++ code with
the following, and then try to compile in release mode:
#ifdef _DEBUG
#undef _DEBUG
#include
#define _DEBUG
#else
#include
#endif
No, don't do that. Just compile your application in release mode.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
rg/dev/peps/pep-0370/
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
I have problem with it then let me know and if is possible please
fix it up .
Because all files in your c:\windows\system directory are older than one
month?
os.walk is simpler to use; stats.st_mtime is less "magical" than stats[8];
and I'd use os.path.join(dirname, filename) inst
ctor.
I think it's easier to pass logRequests=False when creating the server.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Tue, 13 Oct 2009 13:28:05 -0300, Buck escribió:
On Oct 12, 3:34 pm, "Gabriel Genellina"
wrote:
Quoting Steven D'Aprano
(changing names slightly):
"""You would benefit greatly from separating the interface from
the backend. You should arrange matters so tha
your help!!
If all the lines in the file have exactly the same length, you may seek to
the specific line and read it at once.
Otherwise I'm afraid you have to read all the previous n-1 lines to get to
line n, and that's what makes it slow.
--
Gabriel Genellina
--
http://mail.
ess, or attribute-like
access:
class namespace:pass
ns = namespace()
ns.order = .
setattr(ns, variablename, ..)
ns.area = ns.height * ns.width
---
ns = {}
ns['order'] = ...
ns[variablename] = ...
ns['area'] = ns['height'] * ns['width']
Or, s
ubdirectory would make the
disk tree completely flat as seen by the application.
I think this functionality was removed by the time Windows 95 came out
because it was very dangerous. It was extremely easy to open (or even
remove!) the wrong file.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
to pass additional info for each run.
Creating OS threads is somewhat expensive so usually is more efficient to
create them once and keep feeding them with work to be done.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
t if I serialize (using pickle) an object of a class defined in
python library, will it be successfully read in later version of
python?
As JPC said: no guarantees.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
t if I serialize (using pickle) an object of a class defined in
python library, will it be successfully read in later version of
python?
As JPC said: no guarantees.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ues with boilerplate are several. [...]
As pointed out before, all this boilerplate code is actually unnecesary.
Just import the module you want from its package, and you're done
(usually).
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Sun, 11 Oct 2009 18:07:30 -0300, Stef Mientki
escribió:
Gabriel Genellina wrote:
En Sun, 11 Oct 2009 14:50:31 -0300, Stef Mientki
escribió:
Now I finally (after 2 years) knowing there's a difference between
modules and scripts,
I want to guarantee that I always get the
En Sun, 11 Oct 2009 18:07:30 -0300, Stef Mientki
escribió:
Gabriel Genellina wrote:
En Sun, 11 Oct 2009 14:50:31 -0300, Stef Mientki
escribió:
Now I finally (after 2 years) knowing there's a difference between
modules and scripts,
I want to guarantee that I always get the
En Mon, 12 Oct 2009 15:24:34 -0300, Buck escribió:
On Oct 10, 9:44 am, "Gabriel Genellina"
wrote:
The good thing is that, if the backend package is properly installed
somewhere in the Python path ... it still works with no modifications.
I'd like to get to zero-installat
En Mon, 12 Oct 2009 15:24:34 -0300, Buck escribió:
On Oct 10, 9:44 am, "Gabriel Genellina"
wrote:
The good thing is that, if the backend package is properly installed
somewhere in the Python path ... it still works with no modifications.
I'd like to get to zero-installat
== d2.xyz == 456
assert hasattr(d2, 'xyz')
d2['abc'] = 789
assert d2.abc == d2['abc'] == 789
d2.abc = 123
assert d2.abc == d2['abc'] == 123
del d2.abc
assert not hasattr(d2, 'abc')
assert 'abc' not in d2
del d2['xyz']
assert not hasattr(d2, 'xyz')
assert 'xyz' not in d2
d4 = loads(dumps(d2))
assert d2 == d4
assert isinstance(d4, type(d2))
(plus all the expected behavior from dict itself: clear, get, update...)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
plest loop case, with
the test at the start. A loop with the test at the end, on the other hand,
is slightly harder to prove correct (but not much).
As an example, Ada has a general loop construct like this:
loop
...
exit when some_condition;
...
end loop;
and LOTS of work has been done in proving correctness of Ada programs, so
having the test at the start/middle/end of the loop is not an obstacle for
formal verification.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
licated tests and/or duplicated code and/or
artificial boolean variables added.
Some algorithms are *naturally* expressed as a loop with the condition in
the middle. Forcing the condition to always happen at the start requires
artificial steps that complicate unnecesarily the code.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
hat. You can avoid the temptation by
naming your scripts with another extension (or no extension at all).
I found 2 solutions to realize the above.
[...]
Too much hassle and magic for what should be a non-issue.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
hile
condition:" loop, the condition is right at the while statement. In a
"while True:" loop, you have to look for the condition elsewhere (likely,
an "if" statement preceding a "break").
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
/usr/bin/python
from backend import animals
animals.main()
That's all. No need to set PYTHONPATH, nor alter sys.path, nor install the
whole tree in a specific place.
The good thing is that, if the backend package is properly installed
somewhere in the Python path, and the anima
/usr/bin/python
from backend import animals
animals.main()
That's all. No need to set PYTHONPATH, nor alter sys.path, nor install the
whole tree in a specific place.
The good thing is that, if the backend package is properly installed
somewhere in the Python path, and the anima
the
compileall module). Code objects (stored in the .pyc files) carry their
source file name with them.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
instead:
data = []
...
# Populate data
...
plots = []
for dataSet in data:
plots.append(dataSet)
g.plot(plots)
g.plot(*plots) should work; it's like calling g.plot(plots[0], plots[1],
plots[2]...)
See http://docs.python.org/reference/expressions.html#calls for the gory
details.
--
hen changed import and cut the first datetime occurance which looks
good but breaks next sync with other.
Just make sure to replace *all* occurrences of "datetime.datetime" to
"datetime", etc. Should be easy to do.
I don't know what you mean "breaks next sync with other".
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
://bugs.python.org but I can't locate
the issue right now.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
://bugs.python.org but I can't locate
the issue right now.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
?)
After fixing the database, you can omit the unnecesary base64 encoding;
anyway I'd add a Content-Length header to avoid that spurious \n at the
end.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ndows too:
py> import locale
py> locale.localeconv()['decimal_point']
'.'
py> locale.setlocale(locale.LC_ALL, '')
'Spanish_Argentina.1252'
py> locale.localeconv()['decimal_point']
','
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Wed, 07 Oct 2009 12:00:13 -0300, Victor Subervi
escribió:
> print '''Content-Type: image/jpeg
>
> '''
> print
> print content
On Wed, Oct 7, 2009 at 9:51 AM, Gabriel Genellina wrote:
> That's still wrong. The output should be:
>
&g
ntent-Type: image/jpeg
- a blank line (no more!)
- the actual image data
A Content-Type of text/html is just *wrong* for an image...
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Tue, 06 Oct 2009 18:01:34 -0300, Joel Smith
escribió:
Gabriel Genellina wrote:
Note that you don't *have* to use partial in this case, as you're
building the suite yourself. Just create the TestCase instances
manually:
suite = unittest.TestSuite([
TestGenericWind
En Tue, 06 Oct 2009 11:24:23 -0300, MRAB
escribió:
Gabriel Genellina wrote:
En Sat, 03 Oct 2009 21:53:12 -0300, Andrew Savige
escribió:
When I run this little test program on Linux:
import subprocess
subprocess.call(["python","-V"], stderr=open("log.tmp&qu
=100, color=color)
def test_brown(self):
return self._testit('brown') # provide desired parameters
def test_blue(self):
return self._testit('blue')
unittest.main() should still work with this TestCase as written, without a
custom Suite/Loader.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
0 [1]).
So there is no need to set the PYTHONPATH variable, nor alter the standard
site-packages directory, nor play tricks with sys.path - just install the
modules/packages inside the user site directory (or any other directory
named in a .pth file found there).
[1] http://www.python.org/
uot;"
for key, value in _MAP.iteritems():
name = name.replace(key, value)
return name
import unicodedata
def downcode(name):
return unicodedata.normalize("NFD", name)\
.encode("ascii", "ignore")\
.decode("asci
beginning or the end of the file."""
The Linux implementation choose to move the file pointer to the end in
such cases, the Windows one choose to always keep it at the start. Both
are correct according to the specification above. Python 2.X just inherits
that behavior from C. I
milar construct but always returns
True/False, I've submitted a bug+patch: http://bugs.python.org/issue7069
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
at powers that be are going to
deprecate it.
If you want the convenience of shelve without the limitations of dbm,
you can do:
"""Implementation of Python shelves using SQLite."""
See also http://bugs.python.org/issue3783 "dbm.sqlite proof of concept"
--
Gab
s/pep-0318/
[2] http://www.artima.com/weblogs/viewpost.jsp?thread=240808
[3] http://pypi.python.org/pypi/decorator
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
, it's usually better to
directly ask the author.
class dissect:
def __init__(self,pkt,offset):
[...]
You posted only a class definition - how do you *use* it?
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
, it's usually better to
directly ask the author.
class dissect:
def __init__(self,pkt,offset):
[...]
You posted only a class definition - how do you *use* it?
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
only get the old one or the new one, but not something weird
instead (because a different thread changed the value while this thread
was
trying to read it).
See http://effbot.org/zone/thread-synchronization.htm
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ectories,
try to keep the minimum code that still reproduces the problem.
You may solve it yourself in the process.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
no longer possible to read
the EXIF header with EXIF.py.
Furthermore imghdr does not even recognize it as a JPEG anymore. [...]
maybe
pyexiv2 is doing something "wrong" that might cause other problems
later on.
It seems so - don't be so shy and report the problem to the author
ibrary)
or would it be better to handle all dates in the Delphi format (number
of days since 1-1-1900
py> birthdate.toordinal()
698912
(number of days since 1 AD, approximately)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "Forget ethical. We can do his homework for him, we can perhaps pass
exams for him, maybe graduate for him, and then with our luck, he'll get a
job in our office and we get to do his work for him." - Mel
http://groups.google.com/group/comp.lang.python/msg/8f7c1fa393c23476
File "test638580.py", line 5, in foo2
undefinedname()
and that means that foo2 tried to call undefinedname.
NameError: global name 'undefinedname' is not defined
And that's the actual error.
Do you want it to be more nicely formatted? Do you want to includ
all, it's a dispatcher;
you may use a dictionary to map each alternative to the function to be
invoked. If it only depends on the type of the argument, there is a hidden
gem in pkgutil (simplegeneric) that can help you.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
e 1, in
ValueError: unsupported format character '
' (0xa) at index 5
So, look in your file for lines ending in %
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
.conf', ['foo.conf.sample']),
If --install-data is used, one has to edit the /etc/foo.conf file by hand.
I understand you want this step to be automatic, and I admit it would be
great, but none of my users complained until now (not that there are so
many...!)
--
Gabriel Genellina
--
http://mai
e desired descriptor) and set it
as the instance __class__ attribute.
(This was discussed some time ago, try searching the list archives. Uh, I
found this:
http://groups.google.com/group/comp.lang.python/t/bfc093464dd6ba9/
but you should be able to find other threads)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
k SDA_), would it possible with struct?, any
help ?
The chunk module (http://docs.python.org/library/chunk.html) is designed
to work with such file format.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
lucky (or
perhaps my users are "geek" enough to know how to edit a config file, or
dumb enough to never change the system settings...)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
:
http://www.python.org/community/sigs/current/distutils-sig/
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ort module1, module2
elif type_ == 'type2':
from .type2 import module1, module2
else:
raise ValueError, 'unknown type: %s' % type_
A more generic version:
def setType(type_):
global module1, module2
t = __import__(type_, globals(), locals(), ['module1','module2'], 1)
module1 = t.module1
module2 = t.module2
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
nt to rfc822.AddressList
in the email module, which I want to use to parse a _list_ of addresses:
[...]
Is there some non-deprecated method I can use to parse an RFC 2822
address list?
No takers? Should I file a bug?
Seems so...
--
Gabriel Genellina
--
http://mail.python.org/mailman/lis
atch your code so it works
with their file system hierarchy.
* it does not work inside eggs
* it is ugly ;-)
Isn't pkgutil.get_data() what you're looking for?
I'm not sure it covers all your use cases though.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
u're still returning ONE object - a tuple. But since
packing and unpacking of values is done automatically, you may consider it
as returning multiple values at the same time).
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
c names could be expressed.
[1] Colerus, Egmont. Historia de la Matemática. De Pitágoras a Hilbert.
Bs. As, Ediciones Progreso y Cultura, 1943
[2] BTW, the very name 'algebra' comes from a book of Abu Ja'far Muhammad
ibn Musa Al-Khwarizmi, "al-jabr w'al-muqabala". An
nded to be used very locally, delete
those after use.
Why bother? Unless they're big objects and you want to ensure they get
deleted as soon as possible.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
which the script is run.
One may use the Scene class above as the globlal scope when executing the
script:
scene = Scene()
code = "cube1 = Cube(); print cube1.name"
exec code in Scene
(well, not exactly, Scene should inherit from dict and override
__setitem__ instead, but you get th
g day of coding. This is addicting. Does
anybody know of a good Coders Anonymous group, i think i may have an
addiction. 16 hours of strait coding with 4hrs sleep last night and
only stopping for one meal (lunch) still have not ate dinner yet!
Gheez! ;)
Remember, there is a whole world out the
round.
So, I wouldn't worry about that.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "Python the language doesn't try to satisfy all tastes in language
design equally." - Guido van Rossum
Is it really necesary to explicitely close open files?
http://groups.google.com/group/comp.lang.python/t/d794d426a5bef2c1/
Tips for using Unicode text (specia
if i type 'python prova.pyc'?
No; the filename you pass in is just to set the co_filename attribute of
code objects, and such things.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
expr)
raise ValueError('malformed string')
return _convert(node_or_string)
py> print literal_eval("(1, [-2.,'3',4j], {-5:None, u'6':True})")
(1, [-2.0, '3', 4j], {-5: None, u'6': True})
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
En Wed, 16 Sep 2009 03:36:32 -0300, Jason
escribió:
On Sep 16, 2:39 am, "Gabriel Genellina"
wrote:
Looks like a bug in pysvn. Some class (whatever
pysvn.wc_notify_action.status_completed is) is not well written. When
compared against something unknown, it should return NotI
ons.
Your VTK path starts with a space, and that confuses the path
manipulations.
I solved the problem by editing PYTHONPATH in the registry.
Definitely a trap for Windows users.
If you set the VTK path to an absolute path, this should not happen.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ate program mesage to the console without writing it to the file.
You're redirecting stdout, but stderr still goes to the console.
print >>sys.stderr, "This message appears on the console"
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
([object]) -> dictionary
Without arguments, equivalent to locals().
With an argument, equivalent to object.__dict__.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
t):
... foo = 1
... #
... def __eq__(self, other):
... if not isinstance(other, GoodBoy):
... return NotImplemented
... return self.foo==other.foo
...
py> "hello" in [GoodBoy(), "hello"]
True
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
list=filter(None, list)
which is the fastest variant AFAIK.
(Of course, it's even better to use the right split() call so there is no
empty strings to filter out in the first place)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
Any ideas?
Don't run the first module as a program itself. When it's run as a
program, it's known as '__main__'; when someone executes 'import plugin'
*another* copy is imported under the name 'plugin'.
So your plugin classes inherit from plugin.Plugin but you're printing
__main__.Plugin subclasses.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
e read some time ago, that simply caching 0.0 reduced appreciably the
memory usage of a Zope application.
(Note that Zope relies on pickling and unpickling objects all the time, so
even if two objects started as the "same" zero, they may become different
at a later time.)
earch path
(sys.path); whatever is found first, wins.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
501 - 600 of 4798 matches
Mail list logo