with stdin??.
robert.
--
http://mail.python.org/mailman/listinfo/python-list
.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
I just tried to convert a (hugh size) ftp.retrbinary run into a
pseudo-file object with .read(bytes) method in order to not consume
500MB on a copy operation.
First I thought, its easy as usual with python using something like
'yield' or so.
Yet I didn't manage to do (without using threads or
Dear group,
I have a problem with importing MySQLdb in a cgi-script.
The code fragment at the beginning:
1 #!/usr/bin/env python
2
3 print Content-Type: text/html\n\n
4
5 import re
6 import cgi
7 import MySQLdb
8 print something
but the print statement in line 8 will never be executed.
I am sending it again, since it didn't appear on the mailing list.
Dear group,
I have a problem with importing MySQLdb in a cgi-script.
The code fragment at the beginning:
1 #!/usr/bin/env python
2
3 print Content-Type: text/html\n\n
4
5 import re
6 import cgi
7 import MySQLdb
8 print
Martin v. Löwis schrieb:
Robert wrote:
Wouldn't it be an issue to think about if future win-python distributions
should keep on including the asian codecs in the main-dll?
Indeed, it would. As I said before: if somebody defines a clear, fair
policy which finds agreement in the community
.
* _ssl.pyd has not the recent fixes.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
.
* _ssl.pyd has not the recent fixes.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
()
app.MainLoop()
###
Thanks for any help.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
If I have Python 2.4 installed and I want to install the latest stable
Zope, will Zope have problems or does Zope looks to its own setup and
not my install of Python 2.4?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
VS7 is a really a vastly different beastie than VS6.
On 12/10/04 9:31 PM, in article [EMAIL PROTECTED],
Jive [EMAIL PROTECTED] wrote:
Can someone explain to me why Python 2.4 on MS Windows has these backward
compatibility problems? What am I missing? Why won't extensions compiled
to run
strings should be displayed as nice as possible at the
console with normal print-s to stdout (on varying platforms, different
windows/countries and linux, ...; I py2exe/cxfreeze apps) ...
Any hints how to do this and make it as complete and automated as
possible?
Robert
--
http://mail.python.org
Martin v. Löwis schrieb:
Robert wrote:
I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this:
I want to use win32-fuctions like win32ui.MessageBox,
listctrl.InsertItem . to get unicode strings on the screen - best
results according to the platform/language settings
encoding on tty's
should be tolerant/replace-mode by default.
Robert
PS:
this guy also is somewhat angry about the current situation:
http://blog.ianbicking.org/do-i-hate-unicode-or-do-i-hate-ascii.html
GvR felt save with 'ascii' for future improvements like utf-8 :
http://mail.python.org
gregarican wrote:
Robert wrote:
(windows or linux console)
print u'\u034a'
Traceback (most recent call last):
File stdin, line 1, in ?
File C:\PYTHON23\lib\encodings\cp850.py, line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError
.
Shouldn't something like that (or 'replace') (or a prominent
switch-function for such behaviour) be the default for python - output
the maximum, not minimum ?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Martin v. Löwis schrieb:
Robert wrote:
win32ui.MessageBox(s)
Traceback (most recent call last):
File interactive input, line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode characters in position
12-16: ordinal not in range(128)
Can't comment on that - this is a PythonWin
Neil Hodgson schrieb:
Robert:
PythonWin did have some Unicode support but I think Mark Hammond was
discouraged by bugs. In pythonwin/__init__.py there is a setting
is_platform_unicode = 0 with a commented out real test for Unicode on
the next line. Change this to 1 and restart and you
Neil Hodgson wrote:
Robert:
After is_platform_unicode = auto, scintilla displays some unicode
as you showed. but the win32-functions (e.g. MessageBox) still do not
pass through wide unicode.
Win32 issues are better discussed on the python-win32 mailing list
which is read by more
Martin v. Löwis schrieb:
Robert wrote:
is in a PythonWin Interactive session - ok results for cyrillic chars
(tolerant mbcs/utf-8 encoding!).
But if I do this on Win console (as you probably mean), I get also
encoding Errors - no matter if chcp1251, because cyrillic chars raise
Thomas Heller schrieb:
Robert [EMAIL PROTECTED] writes:
Neil Hodgson wrote:
Robert:
After is_platform_unicode = auto, scintilla displays some unicode
as you showed. but the win32-functions (e.g. MessageBox) still do not
pass through wide unicode.
Win32 issues are better
%Y %H:%M:%S
I also don't see how to alter the pattern for strptime to be tolerante for
more long weekday strings?
Any ideas?
Shouldn't it be possible to insert real regexp-like stuff in the pattern?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
updating a py2exe'd software I was impressed by python24.dll's footprint -
double size of python23.dll
Is there a version without/separate asianc codecs (which seem to mainly blow
up python24.dll)? Or how to build one?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
codecs?
Robert
Martin v. Löwis [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Robert wrote:
Or how to build one?
Just download the source, and follow the instructions in
PCBuild/readme.txt. Then, edit the pythoncore project to remove
the files you don't want to include
=wx.Point(0, 0),
size=wx.Size(510, 328), style=0)
and I don't now how to do that.
thanks for any help.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Maebe, does anyone have some examples with wxPython and pyplot?
Thanks again,
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Philippe C. Martin wrote:
I think wxWidget comes with a sample
Philippe
Yes I use it, but there is not a sample with pyplot.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
('xy')
exec co in mod.__dict__
Robert
--
http://mail.python.org/mailman/listinfo/python-list
...
Regards
Robert
--
http://mail.python.org/mailman/listinfo/python-list
?) occures? What can be done to
handle/circumvent that problem?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Robert [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
On some connections only from some computers/network setups I get this
error:
Traceback (most recent call last):
File interactive input, line 1, in ?
File ClientCookie\_urllib2_support.pyo, line 524, in open
File
such a mini-python be worth using over C, Forth, etc?
guess so if your app has non-trivial complexity: Faktor 5 in programming
speed and clarity of code - if you can grant 0.5..2MB overhead.
but guess you still need some 1%..5% C for time critical stuff.
Robert
--
http://mail.python.org
\', 600, \'_send_output\', None), (\'httplib.pyo\', 567,
\'send\', None), (\'httplib.pyo\', 988, \'connect\', None), (\'socket.pyo\',
73, \'ssl\', None)]
Robert
--
http://mail.python.org/mailman/listinfo/python-list
..., Also a fair amount of googling. I'll say there's a large
amount of technology to pick from. Rather than spend time going down
the wrong road, can I get some feedback as directions from you folks
that's been there, done that.
thanks a bunch.
Robert
--
http://mail.python.org/mailman/listinfo
/routers are in use.
What is the nature of this error? How is it possible that an EOF in
ssl-connections (during connect?) occures?
What can be done to handle/circumvent that problem?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
.py and has to do with my (undefined?) files? A
very cice language, which cannot print by default... go to Java ...
Bye
My recommendation is to use 'backslashreplace as default mode. Nobody
is angry when alien chars are printed in this style.
Robert
--
http://mail.python.org/mailman/listinfo
, but
'ISO-8859-1' or 'Windows-1252' are usually used for that area.
Robert
PS: side-question: why is there a latin_1.py and a iso8859_1.py in
lib/encodings ? Shouldn't they be the same?
--
http://mail.python.org/mailman/listinfo/python-list
()
...
...
=
Robert
--
http://mail.python.org/mailman/listinfo/python-list
the issue by not creating cycles containing
objects with __del__() methods, and garbage can be examined in that case
to verify that no such cycles are being created.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
sslerror: (1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
protocol')
using python 2.3.5
any Ideas about the problem?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
did you solve this problem? It seems to be still present here with
py2.3.5.
Robert
--
From: Manish Jethani [EMAIL PROTECTED]
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b)
Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups
Hi,
I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk and was wondering what
command I use to a) invoke the command and b) how to capture it's out put
and
On Sun, 24 Apr 2005 19:46:52 -0600, Daniel Cer wrote:
Daniel Cer wrote:
Robert wrote:
I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk
I would like to count lines in a file using the fileinput module and I
am getting an unusual output.
--
#!/usr/bin/python
import fileinput
# cycle through files
for line in fileinput.input():
if
On Feb 13, 8:31 pm, 7stud [EMAIL PROTECTED] wrote:
On Feb 13, 6:47 pm, Robert [EMAIL PROTECTED] wrote:
I would like to count lines in a file using the fileinput module and I
am getting an unusual output
Somebody who uses my app gets a error :
os.stat('/path/filename')
OSError: [Errno 75] Value too large for defined data type:
'/path/filename'
on a big file 4GB
( Python 2.4.4 / Linux )
How about that? Does Python not support large files? Or which
functions do not support?
Robert
--
http
Or some other pre-packaged parser tool?
--
http://mail.python.org/mailman/listinfo/python-list
Is there a API/possibilty for readingwriting (live) in the mail
box tree of Thunderbird/Seamonkey with Python?
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
On Sun, Apr 5, 2009 at 1:04 AM, robert rob...@nowhere.invalid wrote:
Is there a API/possibilty for readingwriting (live) in the mail box tree of
Thunderbird/Seamonkey with Python?
From what I can google, they're already in mbox format, so you can use
mailbox.mbox to read
I want to detect changes in a directory tree fast with minimum
overhead/load. In order to check the need for sync tasks at high
frequency.
It must not be 100% reliable (its also forced time periodic), so
kind of hashing would be ok.
How?
Robert
--
http://mail.python.org/mailman/listinfo
about voluptuous
multimulti..possibilites, not worth the play: one-ness of mind
If insistent, you could sometimes save lines like this ;-)
x=1
while x=100: print x; x+=x
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Aaron Brady wrote:
Gandalf wrote:
On Oct 18, 12:39 pm, Duncan Booth [EMAIL PROTECTED]
wrote:
Gandalf [EMAIL PROTECTED] wrote:
how can I do width python a normal for loop width tree conditions like
for example :
for x=1;x=100;x+x:
print x
What you wrote would appear to be an infinite
)
(or the second refcount) to fall below 1 plus number of extra
local refs. In case execute your obj.__deregister() or so ...
Robert
--
http://mail.python.org/mailman/listinfo/python-list
not reachable through
gc.get_objects() - as used by the script above. So be aware. Maybe
you've got the same motive for your counter.
I was somewhat stunn seeing, that obviously almost any serious
bigger app needs to watch and handle/free the gc.garbarge list by
hand, to remain stable.
Robert
What is the most Pythonic way to maintain a configuration file?
Are there any libraries mimicking registry / ini file writing that many
windows programming languages/environments offer?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Does ConfigParser allow writing configuration changes also?
Dennis Lee Bieber [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
On Sat, 14 Jun 2008 21:27:19 +0200, Robert [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
What is the most Pythonic way to maintain
)
- a wxPython2.8-win32-unicode-2.8.7.1-py25.exe install
- a py2exe-0.6.8.win32-py2.5.exeinstall.
I have deleted C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython
because there indications that this is not needed, but other problems
emerged.
Any clues how to proceed next?
Robert
--
http
(without need
for callback functions,classes.. for basic tasks)?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Tim Cook wrote:
On Sun, 2008-07-06 at 14:40 +0200, robert wrote:
Often I want to extract some web table contents. Formats are
mostly static, simple text numbers in it, other tags to be
stripped off. So a simple fast approach would be ok.
What of the different modules around is most easy
given d:
d = [soep, reeds, ook]
I want it to print like
soep, reeds, ook
I've come up with :
print (%s+, %s*(len(d)-1)) % tuple(d)
but this fails for d = []
any (pythonic) options for this?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
\n']
re.split(r'(?m)$',ss)
['owi\nweoifj\nfheu\n']
re.split(r'(?m)\Z',ss)
['owi\nweoifj\nfheu\n']
re.split(r'(?m)\A',ss)
['owi\nweoifj\nfheu\n']
re.split(r'(?s)\A',ss)
['owi\nweoifj\nfheu\n']
re.split(r'(?s)(?m)\A',ss)
['owi\nweoifj\nfheu\n']
how to do?
Robert
--
http
in that regard: there is always a last empty or half
line, which can be fed readily as start to the further input
buffering.
With the .splitlines(True/False) results you need to fiddle, test
the last result's last char... Or you fail altogether with False.
So I'd call this a wrong implementation.
Robert
()]
['owi\n', 'eoifj\n', 'heu\n', 'xxx\n']
as another try for your edge case. It's understandable and
natural-looking
nice for some display purposes, but wrong regarding a general
logic. The 'xxx' is not a complete line in the general case. Its
and (open) part and should appear so.
Robert
Jeffrey Froman wrote:
robert wrote:
thanks. Yet this does not work naturally consistent in my line
processing algorithm - the further buffering. Compare e.g.
ss.split('\n') ..
'owi\nweoifj\nfheu\n'.split('\n')
['owi', 'weoifj', 'fheu', '']
'owi\nweoifj\nfheu\nxx'.split('\n')
['owi
Steve Holden wrote:
robert wrote:
[...]
but its also wrong regarding partial last lines.
re.split obviously doesn't understand \A \Z ^ $ and also \b etc. empty
matches.
[...]
Or perhaps you don't understand re?
It's a tricky thing to start playing with. Look up re.MULTILINE ans
On a server the binary (red hat) installed python2.4 and also a
fresh compiled python2.5 spits sem_post: Invalid argument.
What is this and how can this solved?
Robert
==
server [~]# python2.4
sem_post: Invalid argument
sem_post: Invalid argument
sem_post: Invalid argument
sem_post
Jonathan Gardner wrote:
On Oct 25, 12:56 pm, robert [EMAIL PROTECTED] wrote:
On a server the binary (red hat) installed python2.4 and also a
fresh compiled python2.5 spits sem_post: Invalid argument.
What is this and how can this solved?
...
Python 2.4.3 (#1, Jun 6 2006, 21:10:41)
[GCC
Jonathan Gardner wrote:
On Oct 25, 2:19 pm, robert [EMAIL PROTECTED] wrote:
Jonathan Gardner wrote:
On Oct 25, 12:56 pm, robert [EMAIL PROTECTED] wrote:
On a server the binary (red hat) installed python2.4 and also a
fresh compiled python2.5 spits sem_post: Invalid argument.
What
In a makefile I want to locate the .so for a dynamically linked
Python on Linux. (for cx_Freeze's --shared-lib-name)
e.g. by running a small script with that Python. How to?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
robert wrote:
In a makefile I want to locate the .so for a dynamically linked Python
on Linux. (for cx_Freeze's --shared-lib-name)
e.g. by running a small script with that Python. How to?
Robert
def findaso(aso):
import os
for apath in os.sys.path
Neal Becker wrote:
robert wrote:
In a makefile I want to locate the .so for a dynamically linked
Python on Linux. (for cx_Freeze's --shared-lib-name)
e.g. by running a small script with that Python. How to?
Robert
How about run python -v yourscript and filter the output?
for examples
with Python/Pythonwin specific for dual
core's (py2.3.5 / pywin203) ?
What could I do to find the problem?
Robert
--
PS: there is very little C extension-code (SWIG) involved, yet I looked
over that so often, I guess its save:
//
#include stdafx.h
#include commctrl.h
#include ext.h
os.popen3 delivers no error exit status on .close() - while os.popen does
Is this intended or a bug? How do I get the status?
Robert
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type help, copyright, credits or license for more information.
import os
.
( When I made a test with wxPython some years ago, it had no option to
step/share its Messageloop. Interaction was crusty and I didn't manage
to get smooth debugging (on Windows). )
Robert
--
http://mail.python.org/mailman/listinfo/python-list
))
Traceback (most recent call last):
File interactive input, line 1, in ?
File string, line 1, in connect
error: (10061, 'Connection refused')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('existing-proxy-server',3128))
1
1
Robert
--
http://mail.python.org/mailman
directly compare agains and update
a single consistent file like
ftp:///archive.zip.gpg
Is something like this possible?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
On Fri, 10 Mar 2006 15:13:07 +0100, robert wrote:
Hello,
I want to put (incrementally) changed/new files from a big file tree
directly,compressed and password-only-encrypted to a remote backup
server incrementally via FTP,SFTP or DAV At best within a closed
to not fail?
Or can I only retry several times in case of RuntimeError? (which would
apears to me as odd gambling; retry how often?)
Robert
PS: Zope dumps thread exposed data structes regularly. How does the ZODB
in Zope handle dict/list changes during its pickling operations?
---
Python 2.4.1
Is a copy.deepcopy ( - cPickle.dump(copy.deepcopy(obj),f) ) an
atomic opertion with a guarantee to not fail?
Or can I only retry several times in case of RuntimeError? (which would
apears to me as odd gambling; retry how often?)
For an intermediate solution, I'm playing roulette:
robert wrote:
Is a copy.deepcopy ( - cPickle.dump(copy.deepcopy(obj),f) ) an
atomic opertion with a guarantee to not fail?
Or can I only retry several times in case of RuntimeError? (which
would apears to me as odd gambling; retry how often?)
For an intermediate solution, I'm
archive slices is arduous
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Felipe Almeida Lessa wrote:
Em Sáb, 2006-03-11 às 12:49 +0100, robert escreveu:
Meanwhile I think this is a bug of cPickle.dump: It should use .keys()
instead of free iteration internally, when pickling elementary dicts.
I'd file a bug if no objection.
AFAICS, it's a problem with your
EleSSaR^ wrote:
robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:
[cut]
I don't know what's your code like, but a similar error occurred in some of
my software and it was my fault indeed. I think you should either use a
lock, or implement a deepcopy
Steven D'Aprano wrote:
On Sat, 11 Mar 2006 16:09:22 +0100, robert wrote:
Lastly, have you considered that your attempted solution is completely the
wrong way to solve the problem? If you explain _what_ you are wanting to
do, rather than _how_ you want to do it, perhaps there is a better way
Alex Martelli wrote:
robert [EMAIL PROTECTED] wrote:
...
99.99% no. I would have to use a lock everywhere, where I add or remove
something into a dict or list of the struct. Thats not the purpose of
big thread locks. Such simple operations are already atomic by the
definition of Python
EleSSaR^ wrote:
robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:
own deepcopy: thus, do you already know if the existing deepcopy has the
same problem as cPickle.dump ?(as the problem araises rarely, it is
difficult for me to test it out)
I don't
Tim Peters wrote:
[robert]
...
PS: how does ZODB work with this kind of problem? I thought is uses cPickle?
It does. Each thread in a ZODB application typically uses its own
connection to a database. As a result, each thread gets its own
consistent view of database objects, which can
robert wrote:
Guess it would be more wise to not expose deepcopy, cPickle.dump etc. to
this kind of RuntimeError unnecessarily.
The speed gain of the iterator-method - if any - is minor, compared to
the app crash problems, which are not easy to discover and work-around
(because
Alex Martelli wrote:
robert [EMAIL PROTECTED] wrote:
...
What? When I add/del an item to a dict or list, this is not an atomic
thread-safe operation?
Exactly: there is no such guarantee in the Python language.
E.g.:
One thread does things like d['x']='y'
Another thread reads d['z
the loop and may probably not switch at all ...
Robert
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Would rsync into a remote encrypted filesystem work for you?
the sync (selection) is custom anyway. The remote filesystem is
general/unknow. FTP(S) / SFTP is the only standard given.
--
http://mail.python.org/mailman/listinfo/python-list
are pulled
off at exit() )
Somehow I miss a nice standard method for using globals in an
unfragmented way everywhere. What do you think?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Xaver Hinterhuber wrote:
Hi Robert,
I was using global variables some time ago, too.
But with the time the program simply got unmaintainable, because it is very
hard
to trace, why a global variable has some special value and not the one, you
thought it should have.
So I redesigned
a real Python GUI toolkit and unite the
OS'es directly - as good as it does for the os module ?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
robert wrote:
Most variable read-s in Python anyway go to module globals - as there
are no other kinds of namespaces except __builtins__
your post made some sense until I got to this paragraph, which appears to
completely ignore local variables, arguments
). One could steal a few principles,
abstract algs. and even names in less time than gluing the fragile C++.
Robert
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
robert [EMAIL PROTECTED] wrote:
...
( And that later scheme is fairly wonderful - compare for example the
namespace fuzz in C/C++, Pascal, Ruby, ... where you never know which
module file addeds what to which namespace;
Pascal (per se) doesn't really have much
Alex Martelli wrote:
robert [EMAIL PROTECTED] wrote:
Using global variables in Python often raises chaos. Other languages use
a clear prefix for globals.
Ruby does ($ means global), but, what other languages? Perl, C, C++,
Java (taking a class's statics as Java's equivalent of other
Alex Martelli wrote:
robert [EMAIL PROTECTED] wrote:
...
I think its good to leave the default global binding (that is probably
whats Guido doesn't want to give up for good reason)
Then, on the principle that there should be preferably only one obvious
way to do something, we'll never
is maybe for a (slow) breakpoint b
Unfortunately such method is not encouraged and exposed (clearly) in the
big IDE's. Those' overall style is a lazy copy of C, Java I do-hacker
history. Im curious much about their value at all. Keep it simple and
let Python do.
Robert
--
http://mail.python.org
1 - 100 of 5353 matches
Mail list logo