Hi all,
I have been trying out to wrap my mind around the advantages of
decorators and thought I found a use in one of my experiments. (see code
after my sig).
Although it works, I think it should be able to do it better.
My particular problem is that I want to remove an argument (say always
round the issue aside from forking new
processes or using something else?
If you know that your (C) code is thread safe on its own, you can
release the GIL around long-running algorithms, thus using as many
CPUs as you have available, in a single process.
Regards,
Martin
--
http://mail.pyt
round the issue aside from forking new
processes or using something else?
If you know that your (C) code is thread safe on its own, you can
release the GIL around long-running algorithms, thus using as many
CPUs as you have available, in a single process.
Regards,
Martin
--
http://mail.pyt
Bruno Desthuilliers wrote:
Short answer: this makes no sense.
Absolutely right, took me a while to figure that out though :-)
Lesson learned (again): If it really seems impossible to do something in
Python, it is likely the proposed solution is flawed.
--
MPH
http://blog.dcuktec.com
'If con
Chris Rebert wrote:
In the future, also NOTE THAT SHOUTING TYPICALLY DOES NOT EARN ONE SYMPATHY.
Cheers,
Chris
Let me demonstrate: Chris, I have no sympathy for you :-)
--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'
--
http://mail.python.
probably best described
as coming from LISP (in the sense of caller and callee sharing
references).
FWIW, Simula has also inheritance, but that specific notion of
inheritance did not transfer to any other language, except for Beta.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
s "one big garbage"?
> I'm out of ideas: my script is UTF-8 in 101%; Mac and Windows both
> support UTF-8, Python also supports it - so where is the problem?
Most likely, Tk does not work correctly on your system. See whether
you can get correct results with wish.
Regards,
Ma
> is there a switch to suppress those encoding errors for standard print's
> on the console
No, there is no such switch.
> or a new filter file class necessary?
You can wrap sys.stdout with a codecs.StreamWriter, passing "replace"
as the error handler.
try installing Tk separately.
> (isn't Tk build-in Python?).
Depends on where exactly you got your Python from, and what exactly
is your OSX version. Recent releases of OSX include a copy of Tcl/Tk,
and some sets of Python binaries link against the Apple Tk.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
rowser that works.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
t what is in the toolkit, but what isn't.
It must not require lots of lines of code to produce a simple
GUI, it must not require specification of absolute coordinates,
... - you should be able to continue the list yourself.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
rogates).
See PEP 383.
> However, sys.std{in,out,err} are still created as text streams, and AFAICT
> there's nothing you can do about this from within your code.
That's intentional, and not going to change. You can access the
underlying byte streams if you want to, as you could
erals.
In that sense, the encoding declaration only "matters" for Unicode
literals (of course, it also matters for source editors, and in a few
other places).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> 2. How do you do this for non-invertible encodings (e.g. ISO-2022)?
ISO-2022 cannot be used as a system encoding.
Please do read the responses I write, and please do identify yourself.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
t was his first release of a large
open source software package. Knowing that you have worked so long
on a single project, to see the project then finally completed,
is exciting - just try it out for yourself.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
s impossible to specify pass phrase while
> constructing URLopener.
> So what should I do?
You can remove the passphrase on the private key, e.g. with the
openssl rsa utility.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Thanks for the reply. I want my key to be as secure as possible. So I
> will remove pass phrase if only there is no other possibility to go
> through authentication.
And you put the passphrase into the source code instead? How does it
make that more secure?
Regards,
Martin
utines.
I don't think this has anything to do with the case statement.
Regards,
Martin
diff -r 30ba63d28b1b python/src/html5lib/filters/validator.py
--- a/python/src/html5lib/filters/validator.py Fri Jul 03 17:47:34 2009 +0300
+++ b/python/src/html5lib/filters/validator.py Sun Jul 05 21:10:06
> Why does
> print "GarbageCollector: collected %d objects." % (gc.collect())
>
> work in 2.4 but not in 3.1?
Because print is a function in 3.1, so you have to follow it with
a parenthesis.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
candide wrote:
To add to your implementations; a readable version:
+++file parantheses.py+++
"""Parentheses Module Test"""
def parentheses_are_paired(input_string):
"Check if 'input_string' contains paired parentheses, if so return
True."
parenthesis_count = 0
parenthesis_open = '(
Martin P. Hellwig wrote:
candide wrote:
To add to your implementations; a readable version:
+++file parantheses.py+++
"""Parentheses Module Test"""
def parentheses_are_paired(input_string):
"Check if 'input_string' contains paired parentheses
Aahz wrote:
In article <4a5ccdd6$0$32679$9b4e6...@newsspool2.arcor-online.net>,
Stefan Behnel wrote:
Deep_Feelings wrote:
So you have chosen programming language "x" so shall you tell us why
you did so , and what negatives or positives it has ?
*duck*
Where do you get the duck programming
ary
> for write (I expect so) but then what encoding should I write in?
You need to tell us how precisely you tried to do this. My guess is:
if you now try again, with the filenames being Unicode strings, it
will work fairly well.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
_bsddb.c to the newer db versions. BSDDB
is in the tradition of both breaking the data format and the API
frequently, so we (python-dev) have given up on it.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
sightseer wrote:
Error Installing Service: Access is Denied. (5)
Are you trying to do this on windows vista?
--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'
--
http://mail.python.org/mailman/listinfo/python-list
David Adamo Jr. wrote:
On Jul 21, 10:40 am, "Martin P. Hellwig"
wrote:
sightseer wrote:
Error Installing Service: Access is Denied. (5)
Are you trying to do this on windows vista?
--
MPHhttp://blog.dcuktec.com
'If consumed, best digested with added seasoning to own pref
Krishnakant wrote:
I've seen a method before in a MS cmd script (MakeMeAdmin.cmd) for the
purpose of temporarily elevating your rights but remaining the same user.
There was a need trick in that the script checks itself on what
credentials it runs, if it is not the appropriate one it will ca
David Adamo Jr. wrote:
My
attempt was to create a windows service that start automatically and
runs this batch file using a Network Service account on the server
system. Although, I'm having a hard time with this (temporarily), I
would love to ask if there are any alternatives to using a windows
;msiexec /i /l*v python.log", and search the log file
for 1602. This should give a clue.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> I am very confused about unicode. Can someone point me in the right
> direction?
Try Python 3.1. This should accept Unicode strings directly for sp.call,
so you wouldn't need to encode first.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
y wants to set
the attributes, and never read them. It's easier to maintain: if you
want to add a field with tp_members, you have to change multiple places,
and you have to consider garbage collection (assuming you have embedded
objects). With tp_dictoffset, adding another attribute is easy.
ers list:
static PyMemberDef example_members[] = {
{"__dict__", T_OBJECT, offsetof(Example, dict), READONLY},
{0}
};
Perhaps dir() should know about tp_dictoffset, but alas, it doesn't.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
the
>> field in the class.
>
> So is that intentional or is it dir() that could be improved there?
It's probably both.
> Should I file a bugreport?
Only if you can provide a patch also. My guess is that when you have
the patch completed, you might realize that it is not an improve
John Nagle wrote:
John Nagle wrote:
John Nagle wrote:
There's something strange about this URL:
"https://sagar310.pontins.com/sraep/";
It hangs Firefox 2; there's no short timeout, the web page just gets
stuck in initial load for about ten minutes. Then
"The connection to sagar310.pontins.co
John Nagle wrote:
Martin P. Hellwig wrote:
John Nagle wrote:
John Nagle wrote:
John Nagle wrote:
There's something strange about this URL:
"https://sagar310.pontins.com/sraep/";
...
It looks to me like the SSL handshake is not done properly from the
server side.
Compar
NighterNet wrote:
I am trying to make a simple splash screen from python 3.1.Not sure
where to start looking for it. Can any one help?
Sure, almost the same as with Python 2 :-)
But to be a bit more specific:
"""Only works if you got Python 3 installed with tkinter"""
import tkinter
IMAGE
> Are there any known issues with dictionaries in Python 2.6 (not 2.6.2)
> when running on a 64-bit platform?
No, none.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
NighterNet wrote:
Thanks it help. Sorry about that, I was just wander what kind of
answer and if there are other methods to learn it.
Is there a way to position image to the center screen?
Yes there is, just start reading from here:
http://effbot.org/tkinterbook/
Though because Python 3 has
MalC0de wrote:
hello there, I've a question :
I want to know does python have any capability for using Ring0 and
kernel functions for driver and device development stuff .
if there's such a feature it is very good, and if there something for
this kind that you know please refer me to some referen
Rodrigo S Wanderley wrote:
What about user level device drivers? Think the Python VM could
communicate with the driver through the user space API. Is there a
Python module for that?
Sure why not?
Look for example to libusb, which provides a userspace environment and
pyusb which uses that
Marcus Wanner wrote:
Look for example to libusb, which provides a userspace environment and
pyusb which uses that and provides an interface to Python.
iicr pyusb uses a c interface to libusb, not python...
According to them they use ctypes indeed. Sorry if I was misleading in
my explanati
Michel Claveau - MVP wrote:
Hi!
Python is interpreted
No. Python is compiled (--> .pyc)
But the term "to compile" is not always unambiguous...
And the notion of "compiler" is not attached to Python (the language), but is
attached to the implementation.
@+
MCI
Well the pyc, which I though
Dave Angel wrote:
Ah yes, we thread on the territory of word definition and difference in
interpretation. Any argument is doomed to fail if not agreed or at least
taken in perspective of the terminology used by users.
I could be (well it is quite likely) wrong in my interpretation of the
ter
Ben Finney wrote:
"Martin P. Hellwig" writes:
Machine Code:
Whatever the machine executes, it could be that the CPU uses an
abstraction of microcode to do this but from the perspective of the
user, this is all done in the same 'black box'
This requires, of course,
is written in. For a Python library, it
surely would make most sense to specify the Python version it supports -
notice, however, that this is *also* the Python version the library is
written in.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
kj wrote:
Well to a level I agree with you.
If you are totally new to programming
_and_
you won't/can't invest in educational material
_and_
have an adversity for looking up resources using a web browser
_and_ don't have the patience for trial and error
*then*
getting proficient with the langua
Hi List,
On several occasions I have needed (and build) a parser that reads a
binary piece of data with custom structure. For example (bogus one):
BE
+-+-+-+-+--++
| Version | Command | Instruction | Data Length | Data | Filler |
+-+-
Jon Clements wrote:
IIRC (and I have my doubts) the BitVector module may be of use, but
it's been about 3 years since I had to look at it. I think it used the
C equiv. of short ints to do its work. Otherwise, maybe the array
module, the struct module or even possibly ctypes.
Not much use, but m
Paul Rubin wrote:
"Martin P. Hellwig" writes:
what I usually do is read the packet in binary mode, convert the
output to a concatenated 'binary string'(i.e. '0101011000110') and
Something wrong with reading the data words as an integer and using
old fashioned
Paul Rubin wrote:
"Martin P. Hellwig" writes:
Is there an advantage using shifts and masks over my kitchen type solution?
Weren't you complaining about the 8-to-1 expansion from turning each bit
to an ascii char?
Yes you are (of course) right, my 'dream' solution
Jon Clements wrote:
Now please piddle off...
I am guessing west-midlands? :-)
--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'
--
http://mail.python.org/mailman/listinfo/python-list
mkident(s):
return "foo"
It returns a valid Python identifier for any random string.
If you now complain that this gives too many collisions, I propose
def mkident(s):
return "foo%d" % (hash(s) & 0x7fff)
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Is there a mechanism for submitting comments on a Python PEP?
You post to python-dev or comp.lang.python, and you CC the author.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Thanks all for your insights and suggestions.
It seems to me that there are a couple of ways to this bit manipulation
and a couple of foreign modules to assist you with that.
Would it be worth the while to do a PEP on this?
Personally I think that it would be nice to have a standard module in
", "credits" or "license" for more information.
py> file
Traceback (most recent call last):
File "", line 1, in
NameError: name 'file' is not defined
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
l haven't given up on the original disks: they are (probably)
fine; it's just the RAID controller that has failed (and we can't buy a
replacement before Monday).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
now don't
make this distinction; there is only a single set of header files that
you can choose to install.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Python packages for multiple
versions on a single system.
Specifically, put the source code into /net/source/python/foo/*.py.
Then, on each system, put symlinks to all .py files into
lib/site-packages/foo. Then Python will place the .pyc files next
to the symlinks, not next to the actual .py
he need two sets of .py files?
As Dave explains:
So that the Python 2.4 installation on HP can write its own .pyc
files on disk next to the source files, and Python 2.6 can write
its .pyc files next to the sources on Linux.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Python on different systems - I also assume that he
has an NFS server that both can mount (or that one machine can NFS mount
the other).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Sounds like a bad case of STRIS
http://blog.dcuktec.com/2009/08/stris.html
--
http://mail.python.org/mailman/listinfo/python-list
malloc will not return anything from the brk
heap to the system.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Shailen wrote:
Is there any Python module that helps with US and foreign zip-code
lookups? I'm thinking of something that provides basic mappings of zip
to cities, city to zips, etc. Since this kind of information is so
often used for basic user-registration, I'm assuming functionality of
this so
ry: a
short-term one, that operates as a hook and has limitations, and
a long-term one, that improves the hook system of Mercurial to
implement the proper functionality (which then might get shipped
with Mercurial in a cross-platform manner).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
sturlamolden wrote:
The human brain is bad at detecting
computational bottlenecks though. So it almost always pays off to
write everything in Python first, and use the profiler to locate the
worst offenders.
+1 QOTW
--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoni
Christian Heimes wrote:
Ray wrote:
I already find the way to fix it. :-)
I consider it good style when people describe their solution to a
problem, too. Other Python users may run into the same issue someday. :)
Christian
He probably used: pythoncom.CoInitialize()
--
MPH
http://blog.dcu
python.org, along with a
list of packages that are already on PyPI that could use that
classifier.
Having a classifier that classifies zero or one package is pointless.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
d.
In principle, Python doesn't need any registry settings or environment
variables in order to run.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
allation won't.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Deep_Feelings wrote:
can python make powerfull database web applications that can replace
desktop database applications? e.g: entrprise accounting
programs,enterprise human resource management programs ...etc
As the other replies already mentioned that these already exists, I
would like to add t
> I don't understand why I'm getting an encode error in python 3.1.
The default encoding is not relevant here at all. Look at
sys.stdout.encoding.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
gravityzoo-dmo wrote:
Hello everyone,
I was wondering if anyone here has had any experience in running
Python in a virtualized server environment?
The reason I'm asking is the recent thing I noticed when running my
server application (written in Python + Twisted);
The memory of the server applic
> I can't figure out a way to programatically set the encoding for
> sys.stdout. So where does that leave me?
You should be setting the terminal encoding administratively, not
programmatically.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
gravityzoo-dmo wrote:
On 24 aug, 20:35, "Martin P. Hellwig"
wrote:
gravityzoo-dmo wrote:
Hello everyone,
I was wondering if anyone here has had any experience in running
Python in a virtualized server environment?
The reason I'm asking is the recent thing I noticed when ru
kj wrote:
Here's a toy example illustrating what I mean. It's a simplification
of a real-life coding situation, in which I need to initialize a
"private" class variable by using a recursive helper function.
eh?
class Demo(object):
def fact(n):
if n < 2:
return 1
kj wrote:
First, one of the goals of OO is encapsulation, not only at the
level of instances, but also at the level of classes.
Who says?
Anyway, you could be right (I am not capable to judge it) and Python
should change on this issue but from what I gathered, Pythons OO is
inspired by the fo
line 1, in
unichr(65600)
ValueError: unichr() arg not in range(0x1) (narrow Python build)
This is
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
(Intel)] on win32
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote:
CPython's performance problems
come from excessive dictionary lookups, not from instruction decode.
John Nagle
Could you please suggest some background information/links to this?
I tried to Google for it but unsurprisingly any combination with
'cpython' and
upports?
See PEP 261, http://www.python.org/dev/peps/pep-0261/
It specifies all this.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
wer is "because the PEP says so".
Only *then* the question is "what is the rationale for
the PEP specifying things the way it does". The PEP is
relevant so that we can both agree that Python behaves
correctly (in the sense of behaving as specified).
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Esam Qanadeely wrote:
who cares if a language is compiled or interpreted as long as it runs
and perform the function.
second thing is : even if java is faster than python , unless you are
making performance critical operations : who cares? computers are
getting faster all the time and languages
on-dev/2001-July/016153.html
http://mail.python.org/pipermail/python-dev/2001-July/016155.html
http://mail.python.org/pipermail/python-dev/2001-July/016186.html
Eventually, in r28142, MAL changed it to give it its current
state.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
o a new code base, and nobody upgraded the buildbot
configuration file.
So I have now removed it from the web server configuration, and put a
notice on the web site.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
g if I'm in charge of it, I'm now lead to believe that
> no one contacted Grig. Is this the case? In case it is, I'm cc'ing him
> on this email.
I sent a message to Grig right after I sent the other one, and he
already responded.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
I'd like to add the following:
It is an intriguing human trade to attribute emotions and reasons to
things that have none. Intriguing because I haven't observed yet that it
provides an advantage, but it happens so often that I can't exclude it
either.
I find that evol
MacRules wrote:
What I am looking for is this.
Oracle DB in data center 1 (LA, west coast)
MSSQL DB in data center 2 (DC, east coast)
So network bandwidth is an issue, I prefer to have gzip fist and deliver
the data.
If bandwidth is really an issue, you should send compressed delta's.
I n
Timothy Madden wrote:
>>> conn = pyodbc.connect('DRIVER={PostgreSQL
Unicode};Servername=127.0.0.1;UID=pikantBlue;Database=pikantBlue')
Traceback (most recent call last):
File "", line 1, in
pyodbc.Error: ('0', '[0] [nxDC (202) (SQLDriverConnectW)')
Not sure (i.e. wild guess) but that l
hould also work on W7
just fine.
If there is a specific problem, we would need a specific test case,
to be reported to bugs.python.org.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> Given that the problem is with reading the file system, it is likely to
> be w/ sth else
>
> than Windows 7, maybe some weird HD partition combination?
Without having seen any details, I refuse to guess. Most likely, it is
a user mistake.
Regards,
Martin
--
http://mail.python
Timothy Madden wrote:
Martin P. Hellwig wrote:
Timothy Madden wrote:
>>> conn = pyodbc.connect('DRIVER={PostgreSQL
Unicode};Servername=127.0.0.1;UID=pikantBlue;Database=pikantBlue')
Traceback (most recent call last):
File "", line 1, in
pyodbc
Michel Claveau - MVP wrote:
Du coup, j'ai envie de déduire :
- Que certains étudiants d'écoles de commerce françaises préfèrent travailler avec "l'étranger" plutôt qu'avec "le français".
- Il faudra dire à d'autres étudiants d'écoles de commerce françaises que le
fait de ne pas arriver/sav
Timothy Madden wrote:
Thank you.
The precompiled psqlodbca.so driver from apt-get worked on one of the
Ubuntu machines that I tried.
I would still like o use the Unicode driver if possible. Do you know
what the problem could be ? Or where ? pyodbc/unixODBC/psqlodbcw.so ?
Thank you,
Timot
hrishy wrote:
Hi
What does rsplit(None,1)[1] accomplish.
Can somebody please decompose that to me.
regards
Sure:
>>> test = 'This is a test'
>>> help(test.rsplit)
Help on built-in function rsplit:
rsplit(...)
S.rsplit([sep [,maxsplit]]) -> list of strings
Return a list of the word
John Machin wrote:
On Sep 22, 7:10 pm, hrishy wrote:
Hi Martin
Many thanks
And by the way great way to explain that thing
great way to find out for yourself faster than waiting for a response
from the internet ;-)
I have been called many things in the past but being labeled 'the
int
snfctech wrote:
Does anyone have experience building a data warehouse in python? Any
thoughts on custom vs using an out-of-the-box product like Talend or
Informatica?
I have an integrated system Dashboard project that I was going to
build using cross-vendor joins on existing DBs, but I keep hea
snfctech wrote:
Thanks for your replies, Sean and Martin.
I agree that the ETL tools are complex in themselves, and I may as
well spend that learning curve on a lower-level tool-set that has the
added value of greater flexibility.
Can you suggest a good book or tutorial to help me build a data
snfctech wrote:
@Martin: I originally thought that there was nothing "magical" about
building a data warehouse, but then I did a little research and
received all sorts of feedback about how data warehouse projects have
notorious failure rates, that data warehouse design IS different t
Tony Schmidt wrote:
So do you think it would be very beneficial for me to start with an
Inman or Kimball book? Or do you think it would be just leisure
reading and not very practical at best - fill my head with needless
jargon and inflexible dogmas, at worst?
You have an unique opportunity he
sk that it tries to compile
and it won't, because of a syntax error.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Am 01.09.2010 23:32, schrieb Stef Mientki:
> in winpdb I see strings like this:
>
>>>> a = b'string'
>>>> a
> 'string'
>>>> type(a)
>
>
> what's the "b" doing in front of the string ?
It's redundant.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
4201 - 4300 of 4332 matches
Mail list logo