ll get an easier way to get a mapping of ids to
shell folders: os.path.getshellfolders() -> dict
Christian
--
http://mail.python.org/mailman/listinfo/python-list
e the win32
api. All shell folder names are localized and depend on the language
version.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ly *once* and shared across all instaces of A.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
gging. Check gc.garbage. It should be empty.
http://docs.python.org/lib/module-gc.html
Christian
--
http://mail.python.org/mailman/listinfo/python-list
't checked all the docs since I wrote it
> to see what's been "deprecated" this week).
A lot has been deprecated :(
MS has deprecated all functions which are using CSIDL and introduced a
new stack for Vista.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Jeroen Ruigrok van der Werven wrote:
> Hi Christian,
>
> -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote:
>> I forgot one important point in my reply. The GC module contains some
>> useful methods for debugging. Check gc.garbage. It should be empty.
>
sign?
I changed the __hello__ frozen module a while ago. The print was
unreliable for some new unit tests.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
= True
Christian
--
http://mail.python.org/mailman/listinfo/python-list
rupert.thurner wrote:
> i forgot to mention that i cannot see any explicit sys._getframe(), or
> __del__ in the genshi code, while the ones in trac-core seemed to be
> there in 0.10.4.
Does the code keep a reference to a traceback object or an attribute of
a traceback object?
Christian
Grant Edwards wrote:
> The problem and the one-line soulution have been known for over
> two years and it's still an open bug?
Nobody was interested to provide a patch. I raised the level of the bug.
It's going to be fixed soonish.
Christian
--
http://mail.python.org/mailman
Grant Edwards wrote:
> If the solution shown in the bug report is correct, I'd be more
> than happy to generate a patch.
The solution seems fine but IMO it should be fixed in the ssl socket and
not in imaplib. I like to get it *fixed* and not *worked around*. :)
Christian
>'''Check the bitmask of `func` for the magic generator flag.'''
>return bool(func.func_code.co_flags & CO_GENERATOR)
Can you please write a function for the inspect module + docs + a small
unit tests and submit a patch? The inspect module is missing the
isgenerator function.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
de a virtual machine just like Java or C#. It's even
possible to write code with Python assembly and compile the Python
assembly into byte code.
You most certainly meant: Python code is not compiled into machine code.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
or the broad mass?
* Has the feature been implemented and contributed for Python?
* Is the code well written, tested and documented?
* Is the code mature and used by lots of people?
Can you answer every question with yes?
Christian
--
http://mail.python.org/mailman/listinfo/python-list
, see
http://en.wikipedia.org/wiki/Program_database. Python doesn't ship the
files. You have to compile Python yourself to get the pdb files.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
://en.wikipedia.org/wiki/Interpreted_language#Languages_usually_compiled_to_a_virtual_machine_code
IMHO .NET/C# is missing from the list.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ead local or global flag for
NaN support. Depending on a flag Python turns a NaN into an exception.
The feature needs a proper PEP. Maybe Mark has time to write a PEP in time.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ewbies or developers without a numerical background.
It's very easy to create an inf or nan in Python:
inf = 1E+5000
ninf = -inf
nan = inf * 0.
1E5000 creates a nan because it is *much* bigger than DBL_MAX (around
1E+308). In fact it is even larger than LDBL_MAX (around 1E+4932).
Chris
Please report the problem. cmp(), min() and max() don't treat NaNs
right. I don't think that x < nan == False is the correct answer, too.
But I've to check the IEEE 754 specs. IMHO < nan and > nan should raise
an exception.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
GW32 to compile the extension, too. Or use the free
toolchain as described at
http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit
Christian
--
http://mail.python.org/mailman/listinfo/python-list
memory consumption depends on the application.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
er. While
Java's JIT optimizes the code at run time Python executes the byte code
without additional optimizations.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
self by one. A class
ordinary doesn't implement a __del__ function. The C implementation of
classes use different methods to remove a class from memory (tp_dealloc,
tp_clear and more).
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Arash Arfaee wrote:
> Hello,
>
> I have problem installing psyco on my mac. Can anybody help me?
Psyco doesn't work on a PowerPC Mac. It requires a i4986 compatible CPU
(aka x86 or IA32).
Christian
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote:
> There doesn't seem to be any way to portably kill another process
> in Python. "os.kill" is Mac/Unix only. The "signal" module only lets
> you send signals to the current process. And the "subprocess" module
> doesn't have a "kill" function.
>
> Subprocess objects re
Joshua Kugler wrote:
> That page has a link to the Microsoft Visual C++ Toolkit 2003 page, which
> then says it's been discontinued and to use Visual C++ 2005 Express
> Edition. Sigh...
You can still find some copies of the free toolkit on the internet.
Christian
--
http://m
André
>> Thanks. If I read this correctly, this PEP is on track for Python 3.0.
>> Wonderful!
>
> Note that annotations do not provide explicit typing, AFAIK:
>
> def f(x:int) -> int: return x*2
>
> is stricly equivalent to
>
> def f(x): return x*2
> f
thon developer list. Several decorators
are either already implemented (e.g. the first decorator is
functools.wraps) and others are too special but some of the decorators
including auto assignment seem useful.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> def rationalise_signs(s):
> while "++" in s or "+-" in s or "-+" in s or "--" in s:
> s = s.replace("++", "+")
> s = s.replace("--", "+")
> s = s.replace("+-", "-")
> s = s.replace("-+", "-")
> return s
I assume it's faster to check
corresponding to a Python tuple.
That's it. Thanks. Think I just need a different approach. I got completely
on the wrong track here.
Thanks
Christian
--
http://mail.python.org/mailman/listinfo/python-list
return NULL;
dummy_list = PySequence_Fast(dummy_list, "argument must be iterable");
lenght = PyObject_Length(dummy_list);
for (i=0; i < lenght; i++) {
// part which does not work:
ax = dummy_list[i][0];
ay = dummy_list[i][1];
az = dummy_list[i][2];
in the right
> dir-ection. :)
dir(), inspect and help() can't retrieve the method signature from a C
function (builtin_function_or_method type).
Christian
--
http://mail.python.org/mailman/listinfo/python-list
that I
want to try to write a C-function myself. My goal is not to avoid
PyObjects* and the corresponding reference handling - apart from the head
and end of the function. (I could use ctypes instead, but that again would
obfuscate the API of my package a bit.)
Christian
--
http://mail.pyth
*self, PyObject *args) {
double *v;
if (!PyArg_Parse(args, "(d)", &v))
return NULL;
to get a list as an array of doubles into 'v' (and back to Python)?
I did read the API-description, but still am lost at this point. I presume,
once I get to know the answer I'll b
return *v
return with something like PyBuildValue (but didn't get so far)
}
Can somebody give me a hint here, please? Passing simple arguments to and
fro (e. g. single integer values) is no problem, but lists of unknown size?
TIA
Christian
--
http://mail.python.org/mailman/listinfo/python-list
he reference count of object. The count returned is generally
one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I'm trying to sharpen some JPEGs after resizing and am being given a
valueError as per the below:
File "getGraphicDetails.py", line 32, in main
enhancer = ImageEnhance.Sharpness(img)
File "/usr/local/lib/python2.3/site-packages/PIL/ImageEnhance.py",
line 89, in __init__
FireNWater wrote:
> I'm curious why the different outputs of this code. If I make the
> dictionary with letters as the keys, they are not listed in the
> dictionary in alphabetical order, but if I use the integers then the
> keys are in numerical order.
>
> I know that the order of the keys is no
there a way around it that does not involve (say) tempfile?
imp.load_module is implemented in C. The API expects a file object or a
file descriptor number. Internally the code creates a file pointer *FILE
from a file descriptor. You have to create a temporary file.
Christian
--
http://ma
James Matthews wrote:
> Just a side question!
>
> Does QT support Events from multiple threads without any special calls!
> Example when i use WX i have to call wx.CallAfter()
Yes, you can send signal across threads with some precaution.
Christian
--
http://mail.python.org/mail
3 and Qt4 allow many more open source licenses but PyQt's
license module doesn't.
Christian
PS: I also prefer Qt4 over wx and GTK. :)
--
http://mail.python.org/mailman/listinfo/python-list
e
> done in other threads.
I'm sorry, but you are totally wrong. Threads are a very bad idea for IO
bound operation. Asynchronous event IO is the best answer for any IO
bound problem. That is select, poll, epoll, kqueue or IOCP.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ect or indirect instance of type.
o = someobject
while o is not type:
o = type(o)
print o
The code will eventually print "type".
Christian
--
http://mail.python.org/mailman/listinfo/python-list
os.close(fd)
> # do stuff
>
> Although bear in mind it's pretty UNIX-y.
IIRC you have to fork a second time after you have changed the working
dir and created a new session group.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Jon Ribbens wrote:
> Why? I don't think you do.
> Neither does BSD daemon.c or glibc daemon.c
The problem is well documented at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012
"""
The second fork _is_ necessary, Jonathan Bartlett, 2003/10/31
The first fork accomplishes two things -
s.stdin is more magic
> than I'm aware of.
Jon is correct here. You must close or redirect the underlying C file
descriptor. Python's sys.std streams don't magically do this for you
because Python keeps a backup of the standard streams for internal
purpose in sys.__std*__.
new data to disk.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
than one stream and the buffer of the other stream is full.
You can find some insight at http://bugs.python.org/issue1606. I
discussed the matter with Guido a while ago.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Multi-threaded control flow is a worthwhile priority.
It is? That's totally new to me. Given the fact that threads don't scale
I highly doubt your claim, too.
--
http://mail.python.org/mailman/listinfo/python-list
e IronPython in Linux?
IronPython implements only a limited subset of Python. [1] All extension
that depend on a C code don't work under IronPython.
Christian
[1]
http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home
--
http://mail.python.org/mailman/listinfo/python-list
o(i) by i*i and see how much function calls affect
the speed.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Huayang Xia wrote:
> Is there anyway to import class (to generate objects) from .NET DLL?
You can use PythonDotNET if you want to access .NET assemblies in
CPython (the standard Python implementation written in C).
Christian
--
http://mail.python.org/mailman/listinfo/python-list
You can see the DLL as a container for the CIL code.
clr.AddReference('ClassLibrary1') makes the namespaces of the
ClassLibrary1 assembly available to IronPython and PythonDotNET. import
ClassLibrary1 imports the name space. You must import the assembly
before you can use its name spaces.
Chr
e('ClassLibrary1') loads the assembly 'ClassLibrary1' and
makes all namespaces available to Python.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
y function call.
type_set=frozenset(('D', 'E'))
def yourfunction(self, ..., type_set=type_set):
...
if type in type_set:
...
...
Christian
--
http://mail.python.org/mailman/listinfo/python-list
orithm. The code
predates Python's pymalloc code. I'm working on replacing the code with
pymalloc because pymalloc-ed memory is given back to the OS. The int
and float free lists keep their sizes until the Python process ends.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
for a while now. I've limited some free lists and
I've a patch that gives allocated memory back to the OS earlier.
Have you followed my advice and checked all places that deal with
frames, tracebacks, exception objects and __del__ methods?
Christian
--
http://mail.python.org/mailman/listinfo/python-list
n does the right thing, too. 1/0 is
not defined, only the lim(1/x) for x -> 0 is +INF. From the PoV of a
numerics guy it's surprising.
Do you suggest that 1./0. results into +INF [1]? What should be the
result of 1/0?
Christian
[1]
http://en.wikipedia.org/wiki/Division_by_zero#Divisi
all platforms. Simply removing
those lines and praying that it works won't do it.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ross
platforms. So far we have fixed a lot of problems but we haven't
discussed the a/0 matter.
The best we could give you is an option that makes Python's floats more
IEEE 754 like:
>>> from somemodule import ieee754
>>> with ieee754:
...r = a/0
...print r
inf
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> That would be great.
I'm looking forward to review your patch anytime soon. :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
self.old_state = math.set_ieee754(self.new_state)
def __exit__(self, *args):
math.set_ieee754(self.old_state)
usage:
with contextlib.ieee754():
...
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> Or, better, as a property, 'math.ieee754'.
No, it won't work. It's not possible to have a module property.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Christian Heimes wrote:
> Mark Dickinson wrote:
>> Any suggestions about how to achieve the above-described state of
>> affairs are welcome!
>
> I have worked out a suggestion in three parts.
[snip]
I've implemented my proposal and submitted it to the expe
Jon wrote:
> Can someone tell me an idiom to choose the right one?
You can check the size of a void pointer with ctypes:
>>> import ctypes
>>> ctypes.sizeof(ctypes.c_void_p) * 8
32
Christian
--
http://mail.python.org/mailman/listinfo/python-list
core claims all rights for __magic__ methods with a leading
and trailing double underscore. Of course Python won't stop you from
introducing your own magic names but you are on your own.
Future versions of Python may introduce a magic hook with the same name.
Be warned and don
special handler for print. The tp_print slot is not available
from Python code and most people don't know about it. :]
Christian
--
http://mail.python.org/mailman/listinfo/python-list
.
Search for float_print and tp_print in
http://svn.python.org/view/python/trunk/Objects/floatobject.c?rev=60567&view=auto
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Robin Becker wrote:
> except that unfortunately python 3.0 doesn't have type.InstanceType and
> module
> types doesn't have those old style ones any more :(
Old style classes and hence InstanceType are gone in py3k.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
feed that in but
> that is pretty hacky.
You don't need a file like object:
popen = subprocess.Popen(..., stdin=subprocess.PIPE)
popen.stdin.write("yourstring")
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> Christian told you how to work with popen. Just for the record thogh:
> there are the StringIO and cStringIO-modules.
IIRC subprocess requires a real file with a file descriptor for the
standard streams. An object with a write or read method isn't enough.
on.h: No such file or directory
> I feel gcc is unable to get the path for Python.h
> What should i do to get rid of this problem. If i have to add any path pls
> give me details of how to do that.
Most distributions don't install the Python development files. You have
to install a pack
I guess you have to
connect the streams manually when you create a console window. C code
can use freopen() but I don't know how to properly redirect the streams
from Python.
MSDN has probably some docs for you.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Schwab wrote:
> I'm not sure how superuser-only space would be reserved in the first
> place. I don't see anything relevant in the fdisk man page.
man mkfs
:)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Harlin Seritt wrote:
> When x is typed, everything does shut down but the main script never
> fully ends. Is there any way to get it to quit?
You don't need threads. Please use the subprocess module instead of
threads + os.system.
Christian
--
http://mail.python.org/mailman/list
don't mix well and you can get in all sorts of trouble.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
sure how to deal with updating all
> program pointers to objects on the heap, and thought perhaps an answer
> to this question would give me some ideas. (Also, if you know any
> resources for things like this, I'd be grateful for links/names)
I don't think it's possi
Tobiah wrote:
>>>> print float(3.0) is float(3.0)
> True
>>>> print float(3.0 * 1.0) is float(3.0)
> False
>>>>
Thumb rule: Never compare strings, numbers or tuples with "is". Only
compare an object with a singleton like a type or None. &qu
27;%over = (njobs => '+str(answer)+');\n')
> o.close
> ### sleep now #####
> sleep(refresh)
Try o.close() ;)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
a huge speed impact. Therefor Python uses free lists
to keep some empty objects around for recycling. Small integers are
cached, too.
Compare
>>> id(0)
135689168
>>> id(1)
135689184
>>> id(2)
135689200
with
>>> id(2000)
3084440752
>>> id(2001)
3084440752
t at all. Even
in CPython the interning and free lists are an implementation detail
that may chance between releases. In a matter of fact I'm messing around
with free lists to speed up Python 2.6/3.0 and to give back memory earlier.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
with IO bound applications like
select(), poll(), epoll(), kqueue() or IOCP.
Use Twisted :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
es from
a remote site (IO).
Your application is most certainly not using the CPU much. All you do is
serving data or reading data - input and output - IO. :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
every day new files at
midnight are uploaded.
Can anyone help?
Thanks
--
Christian Kortenhorst
--
http://mail.python.org/mailman/listinfo/python-list
t century and not the early
90ties of the last century. Java favors threads because back in the
90ties it was design for dumb set-top boxes which neither supported
separate process spaces nor threads.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Customers who would
> purchase my End-Sollution like with:
Source code encryption can't stop people from reading or stealing your
code. Microsoft tries it, Apple tries it and even the RIAA tries it.
None of them had success in the past. :]
A proper service contract is more important.
Chr
script instead of from the
> package. How can I fix this?
Move the code from food.py to food/__init__.py. You can't have a package
and a module with the same name.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
l. It's only available on UNIX.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
argument). I try to use os.environ to do this, as follows:
Don't use os.system or the popen functions. They have been substituted
with the subprocess module. It has a way to pass a new environment to a
process.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> Yes, TTBOMK. The site hasn't been updated for a while, but I follow
> the mailing list and activity continues on the code itself.
Python 2.6 and newer are using reST for documentation, see
http://docs.python.org/dev/
Christian
--
http://mail.python.org/mailm
But there is no rsync for windows without using cygwin
On 2/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>
> En Thu, 21 Feb 2008 09:32:23 -0200, Christian Kortenhorst
> <[EMAIL PROTECTED]> escribió:
>
>
> > I am new to python and the list.
>
>
>
bbing Jobs
running create
Jobs runnning
Creating environment ckortenhorst1
/usr/bin/xen-create-image --hostname=ckortenhorst1 --ip=192.168.0.111
DONE
Can anyone help
--
Christian Kortenhorst
+353-(0)87-6183349
+353-(0)1-4966287
--
http://mail.python.org/mailman/listinfo/python-list
d commit it.
Yes, the datetime module is written in C. But we may move the C code to
_datetime and create a facade module in Python.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
tings like:
In the year 2008 after the birth of Christ I, the son of Jone, son of
James ...
Do you get my point? :] I suggest you start with a short introduction of
yourself and your proposal. Short paragraphs and short sentences are
easier to read than long. You'll do fine ;)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ivide.
Yes, the Julian date family is very useful when dealing with dates
before 1900. I'm +1 for adding JDT and MJD.
TAI64 is another time format used for high precision and real time
measurement. http://cr.yp.to/libtai/tai64.html
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Siddhant schrieb:
> Hi.
> How can I implement a tab-completing code using Python?
> Like for example, I want to design a simple shell (using Python, of
> course), which could support tab completion as well. How do I go about
> it?
http://docs.python.org/lib/module-rlcompleter.
Matthias Götz schrieb:
> So if somebody can help me, it would be nice. Thanks.
The complex type is implemented in C. It's totally unrelated to Complex.py.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
complex to a complex is not defined?
Raising a complex to a complex power is well defined, although the
mathematical proof isn't trivial. You have to use the Euler form. Ask
Google for some examples
Christian
--
http://mail.python.org/mailman/listinfo/python-list
f I think this problem
> right. I don't know if there are some python core developers around
> but I would like to hear all opinions towards this.
Unless stated otherwise no Py* or PY* function is NULL safe. You have to
check for NULL unless the docs *explicitly* say it's safe to ca
he cycle GC or circular referneces aren't broken. Have you
tried calling PyGC_Collect() multiple times?
Christian
--
http://mail.python.org/mailman/listinfo/python-list
1101 - 1200 of 1986 matches
Mail list logo