Hi all,
I'm thinking to speed up a process, I like to use multiple threads to
get data fractions from multiple servers and place those data fragments
into a local dictionary for further processing, the dictionary will look
like this:
self.dic = {'thread_a':dict(),
'thread_b':dict()
Thomas Nelson schrieb:
> On Jan 28, 3:13 pm, Wojciech Muła
> <[EMAIL PROTECTED]> wrote:
>> Define method __gt__.
>
> This works, thanks. I was a little surprised though. is __cmp__ used
> by any builtin functions?
It is used by max() if the object doesn't im
both reference by
Unicode ordinal, so it is "the same".
> (3) Is there a way to find out at runtime what encoders/decoders/error
> handlers are available, and what they do?
Not through Python code. In C code, you can look at the
codec_error_registry field of the interpreter object.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
hon.org/doc/2.3/lib/lib.html
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
on your disk, you can use dumpbin /all on
each of them to find out which one is right.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
o some cases which I'm completely uncertain about,
e.g. ORIYA VOWEL SIGN AI decomposes to ORIYA VOWEL SIGN E +
ORIYA AI LENGTH MARK. Is it correct to drop the length mark?
It's not listed as a combining character. Likewise,
MYANMAR LETTER UU decomposes to MYANMAR LETTER U +
MYANMAR VOWEL SIGN II; same question here.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
it may have fixed your
problem.
> PC: What Python version supports VC6.0?
The last version where the official Windows binaries were built with
VC6 was Python 2.3.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
>> Hi all,
>>
>> I'm interested in Parallel Python and I learned from the website of
>> Parallel Python
>> that it can run on SMP and clusters. But can it run on a our muti-CPU
>> server ?
>> We are running an origin3800 server with 128 CPUs.
>>
azrael wrote:
> On Feb 7, 3:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> Hi all,
>>
>> I'm interested in Parallel Python and I learned from the website of
>> Parallel Python
>> that it can run on SMP and clusters. But can it run on a our muti-CPU
>> server ?
>> We are running an origi
Andy Dingley wrote:
> I'm trying to write rot13, but to do it in a better and more Pythonic
> style than I'm currrently using. What would you reckon to the
> following pretty ugly thing? How would you improve it? In
> particular, I don't like the way a three-way selection is done by
> nesting t
[EMAIL PROTECTED] wrote:
> Martin P. Hellwig
>> for me (personal) being Pythonic means that I should
>> separate the logic and variables, etc...
>
> Well, for me me Pythonic means using built-in functionalities as much
> as possible (like using encode("rot13")
oss versions.
This would require both a change to the interpreter (to really mark
all API that is or is not "stable"), and to extension modules (to
restrict themselves to only this API).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
y compatibility with
earlier versions.
Another example is Java and JNI, which is an interface that just
won't change (AFAIK).
Similar to Python, Tcl has a layer of function pointers that is
designed to be version-indepdendent - whether this actually works,
I don't know.
and updated the numeric properties to
Unicode 4.1, for Python 2.5.
There is still a patch pending generating this function, instead
of maintaining it manually.
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ther than have it grow as needed. I've
> had a scan through the archives of comp.lang.python and the python
> docs but cannot find a way to do this. Is this possible to configure
> the PVM this way?
You can configure your operating system. On Unix, do 'ulimit -m 20'.
R
regular
termination, break, or an exception) (unlike list comprehensions, where
the variable also stays, but only as a side effect of the implementation
strategy).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
u can see that a string is unicode of
print isinstance(s,unicode)
prints True. Make sure *every* string you put into the Document
actually is a Unicode string. Then it will just work fine.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
that cannot be converted this way, but
it's not true that *nobody* who want there app to be portable will be
able to use print until *everybody* has converted to Python 3.x.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ustomers with
> compiler switches that enable backwards compatibility.
That's a bold statement, after I V already gave two examples
(g++ and MSVC 2005) of compilers that broke backwards compatibility
without providing compiler switches to bring it back. These two
aren't "minor
Andi Clemens wrote:
> Hi,
>
> I want to update our DNS servers periodically with some IP addresses. But I
> don't know how to do this.
> I searched the Internet quite a while but I haven't found a good example how
> to do this.
> I want to change the A-Record for some IPs, this shouldn't be too ha
you really managed to use bsddb 4.4.
Can you please report the specific error you got? According to the
Berkeley DB documentation, there was no change to database formats
in Berkeley DB 4.5 (but there was a change to the log file format).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
les to 4.5? Just run the
proper db_upgrade binary.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
om/en-us/library/ms724509.aspx
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> On the problem PCs, both of these methods give me the same information
> (i.e. only the processor name). However, if I go to "System
> Properties" and look at the "General" tab, it lists the CPU name and
> processor speed. Does anyone else know of another way to get at this
> information?
I'm no
> Any suggestions for a workaround?
You could silence the warning, using the warnings module.
Alternatively, I think you should be able to replace sqlite3.dll
with a newer version.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
s and crashes. In particular, it *will* cause crashes if you
pass FILE* opened by the debug CRT to PyRun_File and friends. That's
an inherent limitation of Windows DLLs, and the way Microsoft set
up global variables in the VC CRT.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
", your users will enjoy
easy installation, and, for Linux, also convenient deinstallation
(for Mac, you can get easy deinstallation if you put everything in
a single root directory).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
for the dict need no
additional dictionary lookup.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ore generally, things in a collection).
For the __declspec(export) thing, there are the PyAPI_FUNC and
PyMODINIT_FUNC macros.
For detecting platform-specific details, autoconf is used,
which defines things like HAVE_STRDUP. autoconf also defines
WORDS_BIGENDIAN if the system uses the bigendian by
nvironment batch file from the SDK), and then also
set DISTUTILS_USE_SDK. Then distutils will trust that the environment
you set up works correctly, and will use it without further questioning.
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
anness during configure only once. This is
due to an OSX-specific hack in pyconfig.h, which hides the
definition of the computed endianness value, and uses the
value that the compiler provides as a macro instead.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
und
process, but instead, you register your service with the system, and
it will get started automatically (if you wish so) or manually
(through the management interface).
You can use the Win32 extensions to create services, with the
win32serviceutil module.
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
at somehow; the official Python
release does not support such an operation.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Either I misunderstand, or you do. If it wasn't clear, I have already
> rebuilt Python using Visual Studio 2005.
I see. I must have misunderstood then - if you already rebuilt Python
itself, all is fine.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
umber of things you can
have. More precisely, you should use it if the maximum number of things
you could possibly have correlates to the available address space.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ny real keyword parameters. E.g.
> with 'maxsize' that restricts the dictionary size or 'unique' that
> would throw an Exception if an existing key gets reassigned.
For your own dictionary implementation, you are not required to follow
this interface - in particular if
> Neither seems to work. What am I missing here?
You forgot to install the zlib header files, which come in
an RPM provided by Redhat (probably called zlib-dev or some
such).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
the
site in an excessive manner, but we don't (currently) block entire networks.
It's not normally the fear of Spam or a DOS that causes such blocking,
but just regular overloading, typically from a machine that fails to
honor robots.txt.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Those headers are already installed, according to "up2date". Is there
> a way to specify the header files used?
It will automatically use them if they are good. What's the value of
ZLIB_VERSION in /usr/include/zlib.h?
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
with *any* MSI package, and always in the same manner.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
gzip operates
on byte streams, not character streams.
> Is it possible to express "unzip, then decode utf8" via
> "codecs.open"?
If that's the processing you want to do - sure
fd0 = gzip.open(fname, 'rb')
fd = codecs.getreader("utf-8")(fd0)
data = fd.readline()
You can combine that to
fd = codecs.getreader("utf-8")(gzip.open(fname))
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
then do use the prebuilt binaries, at least
where available, i.e.
http://www.python.org/download/releases/3.0/
For OSX, I recommend to use a different --prefix for installing,
e.g. /usr/local/py3k. All files then go into that directory, and
nothing else lives in it. To invoke it, you giv
om a byte string against a Unicode string,
or vice versa. I believe it operates on the internal representation,
so \xf6 in a byte string expression matches with \u00f6 in a Unicode
string; it won't try to convert one into the other.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
hat breaks building Python, and also managed to break
the autoconf procedure that was designed to deal with the uncertainty
of the setpgrp declaration.
An expert of OSX will need to look into this and propose a solution;
if you think you need to get this working, just remove setpgrp from
posixmodu
is best generated with string.maketrans.
table=string.maketrans("áží","azi")
print s.translate(table)
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
first and has no sax package in it.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
lication using TKinter that I was working on under
> Linux.
X11 Tk or Aqua Tk? If Aqua Tk, this would contradict to my theory above.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
t; cause it not to see A as a function. I'm stumped, and this is over my
> head as far as intimate knowledge of the direct loading of python
> bytecode via marshal is concerned...so I'm not clear on the best way to
> debug it.
I would trace through the loading, either in a
for col in self.cols:
vals.append(col(self, per))
return vals
line1 = lineClass1('Some Description', [1,2,3,4,5,6,7,8,9,10,11,12])
line1.cols = [lineClass1.Ptd, lineClass1.Ytd]
print line1.getLine(5)
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
could try to detect the errnos that indicate a problem
with the link itself, and pass all other errors through.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ately, too imprecise to allow reproducing
that effect. What precisely do you mean by "I move My Documents to
this e:\test folder"?
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
sk, and AccessCheck. These are
all functions from the NT security API, and unavailable
on Win9x - which is the likely reason why the MS CRT did
not use them, either. Providing a proper access() implementation
for NT+ then only becomes possible for 2.6 (where W9x
is no longer supported).
Regards,
M
This sounds like Python
2.4 and earlier. Microsoft has broken compatibility with standard C in
VS 2005, in a way that breaks Python on startup. In Python 2.5, a
work-around was added.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ys use os.system to do what the shell does, ie.
os.system("/bin/mkdir -p /Volumes/A_Share")
os.system('/sbin/mount_afp "afp://username:[EMAIL PROTECTED]/A_Share"
"/Volumes/A_Share" ')
In the case of mkdir, you could also use os.mkdir instead, or
os.makedir
> Martin. Could you confirm that the outline below correctly
> describes the behaviour of the os.access function under
> Windows, please?
It's correct for Python 2.5.2 and 2.6; for 2.5.1 (as discussed)
the test "if directory:return True" was not implemented.
Notice that
". It suggests that we already have a mechanism
to determine accessibility.
The case you are referring to is when GetFileAttributes fails, with
a permission error, right?
I'm not quite sure why it could fail in cases where the file is
present, in particular, if the user has the privi
s/library/aa379648.aspx
and thought it was linked from AccessCheck, but
it apparently isn't.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
that it's possible for os.access to return True
> for a W_OK check on a file which can't then be opened for, say,
> appending.
Or any other kind of writing.
> * X_OK: No idea what we should do with this.
Well, there is the "Traverse Folder / Execute File" permissi
stdout = codecs.getwriter("utf-8")(sys.stdout)
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
and defined in the ppc
invocation.
If you are curious as to how it arranges that, read the source.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
for an approach to solve it there.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
e is used
On your normal big-endian compiler (e.g. SPARC), it's the
configure-time value that makes WORDS_BIGENDIAN defined.
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
le, also broken for fat binaries. Indeed,
although the current solution for WORDS_BIGENDIAN is good for ppc
vs. x86, many of the other configure-time detected properties are
incorrect for ppc vs. ppc64 or x86 vs. amd64, such as SIZEOF_LONG)
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
or
__LITTLE_ENDIAN__ is defined, anyway - just use that!
If neither is defined, you are still lost, unless you use pyconfig.h,
in which case, you don't need anything of that.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
__LITTLE_ENDIAN__)
#undef WORDS_BIGENDIAN
#elif defined(__BIG_ENDIAN__)
#undef WORDS_BIGENDIAN
#define WORDS_BIGENDIAN 1
#endif
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ng is. So you should send
Content-type: text/html; charset="your-encoding-here"
Use "extras/page information" in Firefox to find out what the web
browser thinks the encoding of the page is.
Regards,
Martin
P.S. Please, stop shouting.
--
http://mail.python.org/mailman/listinfo/python-list
Hi. Python newbie speaking,
I've copy/pasted the example of the echo server that comes in the IDLE
documentation ("Python Library Reference" section 17.2.3) to see how
the sockets work. The only change I've made is in the host address
which I've set to 'localhost' in the client. You can see the co
On Dec 10, 1:48 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Mon, 10 Dec 2007 04:16:03 -0800 (PST), [EMAIL PROTECTED] wrote:
> >Hi. Python newbie speaking,
>
> >I've copy/pasted the example of the echo server that comes in the IDLE
> >documentation ("Python Library Reference" section 17.
> No what? YES, the "decode error" is complaining that the data supplied
> is NOT valid utf-8 data. So it's not utf-8, it's windows-1252, so stop
> lying to browsers: like I said, use charset="windows-1252"
I think weheh can manage to resist good advise for
re for specific
advise on specific issues you encounter.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
t implementation for the python.org distribution,
the easiest (but perhaps not fastest) solution would be to use
fcrypt.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
as built.
If you want to install it, you either have to copy the files into
place yourself, or you can try building an MSI file with Tools/msi/msi.py.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
did you configure it to default to
UTF-8 for all pages? (which you should not have done)
Try "telnet server 80", then type
GET /path HTTP/1.1
Host: server
and report what response from the server is (the complete one,
not just the character in question)
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ltCharset declaration.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
> "Ron Provost" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> But here's my problem, most of my coworkers, when they see my apps and
> learn that they are written in Python ask questions like, "Why would you
> write that in a scripting language?" Whenever I
st try running a 32-bit Python interpreter on your 64-bit system,
and you may find that it actually runs better because it uses less
memory.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
fine. Is
> there another way to do this so I can change over to the 869 code
> page and continue on with the Greek letters printing correctly?
You'll have to call SetConsoleOutputCP (see MSDN). Python does not
directly expose that, so you'll have to use ctypes or PythonWin to
call
tCore into Modules/config.c, preferably by
adding it to Modules/Setup.local.
HTH,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
5kb.
>
> Is there some else available?
I don't think so. For a Python novice, I'd firmly advise against trying
to decompile Python byte code.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
environment variables, associating files
> etc,
> Bill is always doing that for me !! ;-)
And so is Python. Just install the MSI file, and don't worry.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
atically?
Why do you want to do this? If qt isn't actually *used* in Python (as
you don't include the pyqt modules), what effect do you expect from
such linking?
I think it linked just fine - it just didn't include any symbols,
because none were needed. That is the correct, expected
s, so it's
difficult to help in correcting it.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> For the word "Pure", I mean it is not a C/C++/Z++.. extension, so that
> we can use it under pythons of different version. Is it possible?
The python-xlib project provides such a module. It implements the X11
protocol directly.
Regards,
Martin
--
http://mail.python.org/
l output goes either to the browser via html or to an output file.
Then sys.stdout.encoding will not be set to anything.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
hat the
> regular expressions that are loaded from the file conform to Unicode
> regular expressions.
It's not supported in the standard re module. Contributions are welcome.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Is there any plan of implementing real (lightweight) fiber in Python?
I have no such plan, and I don't know of anybody else's plan, either.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Mon, 24 Dec 2007 17:14:58 +0100, Martin P. Hellwig wrote:
>
>> As Dennis already pointed out I like to use dictionaries in these cases,
>> so I would use sand = dict() instead of sands = list() and would do
>> sand[i] = pygame.image.
the Python installer should issue a warning that pywin32 will
> not be able to work when using the option "just for me"?
That is not supposed to happen; pywin32 should work. Just COM servers
written in Python may not.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ctual problem is, it is hard to tell.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Any help in tracking down the source of this problem
> would be appreciated.
You could try installing a debugger on machine H, hoping
that the debugger gets entered when pythonw crashes. The
stack trace may provide some insight on what precisely fails.
HTH,
Martin
--
http://mail.pyth
file may include
an encoding declaration (XML declaration or http-equiv header). So if
you recode it, you might have to change such declarations as well.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
ike a Greek capital letter alpha here.
Sure, however, your first version ALSO has the Greek capital letter
alpha there; it is just spelled as Α (which *is* a valid spelling
for that latter in XML).
> I hope the above is of some help.
Thanks; I now think that htmlentitydefs is just as fine as it
Paul Sijben wrote:
> I am stumped by the following problem. I have a large multi-threaded
> server accepting communications on one UDP port (chosen for its supposed
> speed).
>
> I have been profiling the code and found that the UDP communication is
> my biggest drain on performance! Communication
you all keep versions of python addons
> up-to-date? Manually?
I use Debian; this automatically gives me updates of all of
my packages.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
is no "handler" in Python,
so you just omit the handler_name part of the method string.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
don't
want to use mingw to build extensions on Windows, I cannot understand.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
message
that AIM is getting.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Python must be able to do so with
Microsoft C++, since some of these extensions are written using MFC.
- developing Python itself in Visual Studio is quite convenient; in
particular, the debugger works "better" than gdb.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
> Oh, that's right, you need an import library for Python24.dll .
That shouldn't be a problem: that library is included with Python.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
If you only have the time to make sure the examples work, that would
be fine. If you can spend time redoing them where necessary, that would
be even better.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
2901 - 3000 of 4331 matches
Mail list logo