On 14 okt 2007, at 01.21, John Velman wrote:
I'm considering moving from Linux to imac. I've recently returned to
Python (was never very expert) to develop a small gui application. At
present I plan to use PyGTK with Pango and Cairo.
What surprises may I be in for :-)
(Currently using
I am trying to retrieve a password protected page using:
get = urllib.urlopen('http://password.protected.url;').read()
While doing this interactively, I'm asked for the username, then the
password at the terminal.
Is there any way to do this non-interactively? To hardcode the user/
pass into
I have found myself writing functions rather like these:
def openfile(filename):
if filename == '-':
# convention for shell scripts in Unix-land is to use
# '-' for stdin/stdout for reading/writing.
outfile = sys.stdout
if filename == '2-':
outfile =
AMD [EMAIL PROTECTED] wrote:
I do the reading one line at a time, the problem seems to be with the
dictionary I am creating.
I don't know whether Python dictionaries must live in a contiguous piece of
memory, but if so, that could be the issue. The system DLLs in Server 2003
have been rebased
Christoph Krammer [EMAIL PROTECTED] wrote:
On 12 Okt., 17:09, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
If you get an incorrect padding error, try appending a = and decoding
again. If you get the error again, try appending one more =. If it
still doesn't work, then you might be out of
Steven D'Aprano wrote:
I have found myself writing functions rather like these:
def openfile(filename):
if filename == '-':
# convention for shell scripts in Unix-land is to use
# '-' for stdin/stdout for reading/writing.
outfile = sys.stdout
if filename ==
John Velman wrote:
I'm considering moving from Linux to imac. I've recently returned to
Python (was never very expert) to develop a small gui application. At
present I plan to use PyGTK with Pango and Cairo.
What surprises may I be in for :-)
(Currently using slackware 11.0 on an old
Just debating somewhere else whether or not Python might be considered a
functional programming language. Lua, Ruby and Perl all seem to provide
first class lexical closures.
What is the current state of affairs in Python? Last time I looked they were
just removing (?!) closures...
--
Dr Jon D
On Oct 14, 7:54 am, Jon Harrop [EMAIL PROTECTED] wrote:
Just debating somewhere else whether or not Python might be considered a
functional programming language. Lua, Ruby and Perl all seem to provide
first class lexical closures.
What is the current state of affairs in Python? Last time I
On Oct 12, 5:58 am, Florian Lindner [EMAIL PROTECTED] wrote:
Hello,
can I determine somehow if the iteration on a list of values is the last
iteration?
Example:
for i in [1, 2, 3]:
if last_iteration:
print i*i
else:
print i
that would print
1
2
9
Can this be
Is there any other option to analyze audio frequencies?
Or
Any here try to use pymedia to a simple audio FingerPrint.
A cant understand what the information the asBands() really giveme.
The Docs, say that asBands() return a List of tupples grouped by
frquenciy, and the first two values are
[EMAIL PROTECTED] wrote:
As a noob I've struggled a bit, but basically what I've come up with
is = if the information is strings and especially strings stored in
any style of list/dict, it takes a loop to write the lines to file
myfile[ i ] + '\n' to keep each line for Python I/O purposes. If
1) Why doesn't the category method raise an Exception, like the name method
does?
As Chris explains, the result category means Other, Not Assigned.
Python returns this category because it's the truth: for those
characters, the value of the category property really *is* Cn;
it means that they
On Oct 14, 2:52 am, Ian Bicking [EMAIL PROTECTED] wrote:
That said, going without a framework (which at least in his article is
what Michele seems to be comparing Pylons against) isn't always so
bad. I started writing an Atompub server in Pylons, but felt like I
was spending too much time
On Oct 14, 6:46 pm, Michele Simionato [EMAIL PROTECTED]
wrote:
Now, since you are here, there is an unrelated question that I want to
ask you, concerning the future of Paste with respect to WSGI 2.0.
I do realize that at this stage WSGI 2.0, is only a draft
Hmmm, not sure where people keep
rodrigo schrieb:
I am trying to retrieve a password protected page using:
get = urllib.urlopen('http://password.protected.url;').read()
While doing this interactively, I'm asked for the username, then the
password at the terminal.
Is there any way to do this non-interactively? To
On Oct 14, 8:00 am, Paul McGuire [EMAIL PROTECTED] wrote:
On Oct 12, 5:58 am, Florian Lindner [EMAIL PROTECTED] wrote:
Hello,
can I determine somehow if the iteration on a list of values is the last
iteration?
Example:
for i in [1, 2, 3]:
if last_iteration:
print i*i
Peter Otten schrieb:
Diez B. Roggisch wrote:
Florian Lindner wrote:
can I determine somehow if the iteration on a list of values is the
last iteration?
def last_iter(iterable):
it = iter(iterable)
buffer = [it.next()]
for i in it:
buffer.append(i)
old,
On Oct 14, 5:01 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
I have found myself writing functions rather like these:
def openfile(filename):
if filename == '-':
# convention for shell scripts in Unix-land is to use
# '-' for stdin/stdout for
Hi all,
I started Python just a little while ago and I am stuck on something
that is really simple, but I just can't figure out.
Essentially I need to take a text document with some chemical
information in Czech and organize it into another text file. The
information is always EINECS number,
On Sun, 14 Oct 2007 13:48:51 +, patrick.waldo wrote:
Essentially I need to take a text document with some chemical
information in Czech and organize it into another text file. The
information is always EINECS number, CAS, chemical name, and formula
in tables. I need to organize them
01smil;Name=01smil
Description: application/smil
--
http://mail.python.org/mailman/listinfo/python-list
www.space666.com
good!
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 14, 2:48 pm, [EMAIL PROTECTED] wrote:
Hi all,
I started Python just a little while ago and I am stuck on something
that is really simple, but I just can't figure out.
Essentially I need to take a text document with some chemical
information in Czech and organize it into another text
Hi,
If I have two dictionaries containing identical values, can I be sure
that the items() method will return tuples in the same order?
I tried an experiment with CPython and it does appear to be the case.
a=dict(a=1, b=1, c=2)
b=dict(c=2, a=1, b=1)
a
{'a': 1, 'c': 2, 'b': 1}
b
{'a':
On Oct 14, 3:28 pm, Will McGugan [EMAIL PROTECTED] wrote:
If I have two dictionaries containing identical values, can I be sure
that the items() method will return tuples in the same order?
...
Can I rely on this behavior?
No. To quote the python documentation:
Keys and values are listed in
On Oct 13, 11:41 pm, rodrigo [EMAIL PROTECTED] wrote:
I am trying to retrieve a password protected page using:
get = urllib.urlopen('http://password.protected.url;').read()
While doing this interactively, I'm asked for the username, then the
password at the terminal.
Is there any way to do
On Oct 14, 1:27 am, James Stroud [EMAIL PROTECTED] wrote:
For OS X 10.4, wx has come as part of the stock python install. You may
want to consider going that route if you develop exclusively for OS
X--it will keep the size of your distribution down.
James
wx works well on Macs... Linux and
Hello there,
I'm exploring possibilities of using python as an alternative to Matlab.
The obvious way to go seems to be matplotlib for plotting, but I do like
GLE URL:http://glx.sourceforge.net/ a lot. One reason is that with GLE
you can also do diagrams, that is, descriptive pictures (like
James Stroud [EMAIL PROTECTED] wrote:
...
For OS X 10.4, wx has come as part of the stock python install. You may
I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any
wx as part of the stock Python (2.3.5). Maybe you mean something else?
Alex
--
On Oct 14, 12:54 pm, Wildemar Wildenburger
[EMAIL PROTECTED] wrote:
Hello there,
I'm exploring possibilities of using python as an alternative to Matlab.
The obvious way to go seems to be matplotlib for plotting, but I do like
GLE URL:http://glx.sourceforge.net/ a lot. One reason is that with
Alex Martelli wrote:
James Stroud [EMAIL PROTECTED] wrote:
...
For OS X 10.4, wx has come as part of the stock python install. You may
I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any
wx as part of the stock Python (2.3.5). Maybe you mean something else?
Cesar G. Miguel wrote:
I think this is what you're looking for:
http://pyx.sourceforge.net/
It damn sure is (a straight ripoff of GLE ;))!
The syntax seems a bit messier than GLE (naturally) but since it is
python I'm willing to bite that bullet.
Thanks :)
/W
--
Thank you both for helping me out. I am still rather new to Python
and so I'm probably trying to reinvent the wheel here.
When I try to do Paul's response, I get
tokens = line.strip().split()
[]
So I am not quite sure how to read line by line.
tokens = input.read().split() gets me all the
Alex Martelli wrote:
I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any
wx as part of the stock Python (2.3.5). Maybe you mean something else?
Very old version, see
/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python/wx-2.5.3-mac-unicode
--
On Oct 14, 5:58 am, Paul Hankin [EMAIL PROTECTED] wrote:
On Oct 14, 8:00 am, Paul McGuire [EMAIL PROTECTED] wrote:
def signal_last(lst):
last2 = None
it = iter(lst)
try:
last = it.next()
except StopIteration:
last = None
for last2 in it:
On Sun, 14 Oct 2007 16:57:06 +, patrick.waldo wrote:
Thank you both for helping me out. I am still rather new to Python
and so I'm probably trying to reinvent the wheel here.
When I try to do Paul's response, I get
tokens = line.strip().split()
[]
What is in `line`? Paul wrote this
Hi..
I have a list as a=[1, 2, 3 ] (4 million elements)
and
b=,.join(a)
than
TypeError: sequence item 0: expected string, int found
I want to change list to a=['1','2','3'] but i don't want to use FOR
because my list very very big.
I'm sorry my bad english.
King regards
--
Raffaele Salmaso [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any
wx as part of the stock Python (2.3.5). Maybe you mean something else?
Very old version, see
Thanks to all. I'll look into wx before I get too much further.
John V.
--
http://mail.python.org/mailman/listinfo/python-list
1. Use a generator expression:
b = ,.join(str(i) for i in a)
or
2. Use imap
from itertools import imap
b = ,.join(imap(str, a))
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I need help with pydev code completion...
Let's assume that we have something like this:
class One:
def fun(self):
return 1
class Two:
li = []
li.append(One())
one = li[0]
print one.fun()
one2 = li.pop()
print one2.fun()
Will McGugan wrote:
If I have two dictionaries containing identical values, can I be sure
that the items() method will return tuples in the same order?
I tried an experiment with CPython and it does appear to be the case.
a=dict(a=1, b=1, c=2)
b=dict(c=2, a=1, b=1)
a
{'a': 1,
crappy, waaay better
I will not feed the troll...
Pygtk on mac just do the work for me on a more than satisfying way.
David
2007/10/13, Diez B. Roggisch [EMAIL PROTECTED]:
David Tremouilles schrieb:
No issue with pygtk on mac!
Actually I develop on this platform everyday. Macport take care
On Sun, 14 Oct 2007 19:45:07 +, Lukasz Mierzejewski wrote:
Let's assume that we have something like this:
class One:
def fun(self):
return 1
class Two:
li = []
li.append(One())
one = li[0]
print one.fun()
one2 = li.pop()
print
On Oct 13, 2007, at 8:23 PM, Adam Atlas wrote:
On Oct 13, 7:21 pm, John Velman [EMAIL PROTECTED] wrote:
I'm considering moving from Linux to imac. I've recently
returned to
Python (was never very expert) to develop a small gui
application. At
present I plan to use PyGTK with Pango
Confirmed (with exactly the same software).
Please discuss this issue at the PyDev discussion forum:
http://sourceforge.net/forum/forum.php?forum_id=293649
2B
--
http://mail.python.org/mailman/listinfo/python-list
The function I wrote (below) reverses lists all right:
def reverse(xs):
if xs == []:
return []
else:
return (reverse (xs[1:])) + [xs[0]]
reverse ([1,2,3])
[3, 2, 1]
Yet when I try to reverse a string I get:
reverse (abc)
...
...
...
File
On Oct 14, 11:48 pm, [EMAIL PROTECTED] wrote:
Hi all,
I started Python just a little while ago and I am stuck on something
that is really simple, but I just can't figure out.
Essentially I need to take a text document with some chemical
information in Czech and organize it into another text
On Oct 15, 4:02 am, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I have a list as a=[1, 2, 3 ] (4 million elements)
and
b=,.join(a)
than
TypeError: sequence item 0: expected string, int found
I want to change list to a=['1','2','3'] but i don't want to use FOR
because my list very very
I can confirm and it's something I would expect. It is obvious to *you*
that there is a `One` object in that list, but it would get very
Thank you for confirmation and your time!
quickly very complicated for an IDE to keep track of objects if not
even impossible.
I guess that you are
On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote:
Confirmed (with exactly the same software).
Please discuss this issue at the PyDev discussion forum:
http://sourceforge.net/forum/forum.php?forum_id=293649
Thank you for replay, but I'm still not sure what to think about it...
Marc
Lukasz Mierzejewski schrieb:
On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote:
Confirmed (with exactly the same software).
Please discuss this issue at the PyDev discussion forum:
http://sourceforge.net/forum/forum.php?forum_id=293649
Thank you for replay, but I'm still not sure what
Hi Hi Hi
my name is tagreed , I am from Syria
I've seen many places of the world on TV screen and few that I've
visited either for fun or/ and business
as you know when we travel we meet a lot different cultures and
people.
I found in many places I've been to ; that people stereotyped Islam
Rafael Marin Perez [EMAIL PROTECTED] wrote:
Hello
I'm Rafael Marin, and work as reseacher in University of Murcia (Spain).
I want to install and compile modules of python2.4 in a ARMv5b
architecture.
Any idea?
Use OpenEmbedded [http://openembedded.org], I've already done everything
On Sun, 14 Oct 2007 21:57:12 +, Lukasz Mierzejewski wrote:
On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote:
Confirmed (with exactly the same software).
Please discuss this issue at the PyDev discussion forum:
http://sourceforge.net/forum/forum.php?forum_id=293649
Thank you for
But maybe someone use Komodo IDE or Wing IDE and can tell how they handle
situations like this? How works code completion in those IDE's?
I've downloaded and checked both of them (both have Linux version which is
nice thing). Both did worse job with code completion then PyDev with my
simple
On Sun, 14 Oct 2007 13:26:27 -0700, Erik Max Francis wrote:
Will McGugan wrote:
If I have two dictionaries containing identical values, can I be sure
that the items() method will return tuples in the same order?
[...]
Can I rely on this behavior?
Probably not.
Definitely not. See Paul
He is right. What would you expect from this piece of code:
foo = random.choose([A(), B(), C(), ..., Z()])
Thank you all for dispelling my stupid doubts!
What PyDev does is to implement some heuristics that can guess easy
cases - as you saw for yourself. But there is a limit to what can
In message [EMAIL PROTECTED], Barb Knox wrote:
Instead of function A returning to its caller, the
caller provides an additional argument (the continuation) which is a
function B to be called by A with A's result(s).
That's just a callback. I've been doing that in C code (and other
On Oct 15, 8:27 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
I've never seen the point of a sorted dictionary, it's easy to just say:
for key, value in sorted(D.items())
There are several applications that involve finding i such that key[i]
= query key[i+1] where the keys
Steven D'Aprano [EMAIL PROTECTED] writes:
I've never seen the point of a sorted dictionary, it's easy to just say:
for key, value in sorted(D.items())
You might want just a subrange of the dictionary (say the 100th
through 150th items in sorted order) without having to sort the entire
On Oct 13, 7:21 pm, John Velman [EMAIL PROTECTED] wrote:
I'm considering moving from Linux to imac. I've recently returned to
Python (was never very expert) to develop a small gui application. At
present I plan to use PyGTK with Pango and Cairo.
You should be aware that unless something has
Travis Oliphant added the comment:
This issue may be closed.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1268
__
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Guido van Rossum:
--
resolution: - fixed
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1268
__
___
Python-bugs-list mailing list
Alexandre Vassalotti added the comment:
Christian wrote:
Alexandre's mangle loop doesn't do the same job as mine. Chars like _
and - aren't removed from the encoding name and the if clauses don't
catch for example UTF-8 or ISO-8859-1 only UTF8 or ISO8859-1.
That isn't true. My mangler does
Brett Cannon added the comment:
So the descriptor idea didn't work.
Another idea is to have the C code that relies on attributes on warnings
that are allowed to change have an initial check for warnings, and if
that fails to fall back on C code. That way the module can still be
completely
Changes by Georg Brandl:
--
versions: +Python 3.0
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1276
__
___
Python-bugs-list mailing list
Unsubscribe:
vila added the comment:
I'm planning to do a package for 2.3...
Any progress on that package ?
I'd like to do the same for python 2.4 and 2.5 as I have a need for it
for both versions.
I don't know what you call a package though, but I'm willing to learn :)
--
nosy: +vila
Matthias Kievernagel added the comment:
Moved my patch from Issue1643641 to this Issue.
(duplication was created when moving from SF bugs/patches)
Patch to be applied with 'patch -p0'
I have also attached a demo where you can test
all Text.edit_* functions.
Regards,
Matthias Kievernagel
Changes by Matthias Kievernagel:
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue961805
___
Python-bugs-list mailing list
Unsubscribe:
Matthias Kievernagel added the comment:
Moved my patch to Issue961805.
(duplication was created when moving from SF bugs/patches)
This issue should be closed down.
Regards,
Matthias Kievernagel
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1643641
Matthias Kievernagel added the comment:
Hint: There is also Issue1522587,
which contains a large patch
(by klappnase) for Tix.Grid addressing
xview/yview and several other issues.
I do not know if it fixes this issue exactly.
Can you take a look at it, ocean-city?
Regards,
Matthias Kievernagel
Changes by Matthias Kievernagel:
--
nosy: +mkiever
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1522587
_
___
Python-bugs-list mailing list
Unsubscribe:
Christian Heimes added the comment:
Alexandre Vassalotti wrote:
That isn't true. My mangler does exactly the same thing as your
original one.
However, I forgot to add Py_CHARMASK to the calls of tolower() and
isalnum() which would cause problems on platforms with signed char.
I wasn't
Guido van Rossum added the comment:
Only a few modules are involved in the bootstrap. The filename is
mostly used to display in the traceback. There is already a fallback
in the traceback-printing code that tries to look through sys.path for
a file matching the module if it can't open the
Christian Heimes added the comment:
Can this be closed now that Travis reverted his patch?
Yes, it can be closed.
By the way svn.python.org and the anon svn server are down the third
time this week. Something is wrong with the server.
Christian
__
Tracker
Alexandre Vassalotti added the comment:
I have a question for Alexandre related to frozen.c -- why is there a
mode line with an encoding involved in freezing hello.py?
For some reason which I don't know about, freeze.py tries to read all
the modules accessible from sys.path:
# collect
New submission from Bernd Wurst:
The factory-argument to the constructorof mailbox.Maildir is not
used as it should be.
First, it's default is set to rfc822.Message instead of MaildirMessage
and then, inside the module's code, MaildirMessage is hard-coded as a
message constructor.
If I need
Alexandre Vassalotti added the comment:
I thought of another way to implement PyUnicode_DecodeFSDefault. If
Py_FileSystemDefaultEncoding is set, decode with the codecs module,
otherwise use UTF-8 + replace. This works because when
Py_FileSystemDefaultEncoding is initialized at the end of
Christian Heimes added the comment:
Alexandre Vassalotti wrote:
Alexandre Vassalotti added the comment:
I thought of another way to implement PyUnicode_DecodeFSDefault. If
Py_FileSystemDefaultEncoding is set, decode with the codecs module,
otherwise use UTF-8 + replace. This works because
Christian Heimes added the comment:
Oh stop, the array module doesn't build for me (Ubuntu Linux, i386,
UCS-4 build, rev58458):
Modules/arraymodule.c: In function 'array_buffer_getbuf':
Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats'
Please replace formats with
Christian Heimes added the comment:
Changes since updated_file_fsenc-5.patch:
* Fix for hard coded FS default encoding on Apple and Windows
* Added two notes to unicode_default_encoding and
Py_FileSystemDefaultEncoding
__
Tracker [EMAIL PROTECTED]
Bill Janssen added the comment:
See the SSL package on PyPI. Should work on 2.3, 2.4, and 2.5.
Bill
On 10/14/07, vila [EMAIL PROTECTED] wrote:
vila added the comment:
I'm planning to do a package for 2.3...
Any progress on that package ?
I'd like to do the same for python 2.4 and 2.5
Guido van Rossum added the comment:
Oh stop, the array module doesn't build for me (Ubuntu Linux, i386,
UCS-4 build, rev58458):
Modules/arraymodule.c: In function 'array_buffer_getbuf':
Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats'
Please replace formats
Guido van Rossum added the comment:
This looks promising. I'm working on the freeze issue. Once I get that
working I'll check this in. Thanks Alexandre and Christian for all
your hard work!!!
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1272
Guido van Rossum added the comment:
The problem is the imp module, which modulefinder uses, does not
detect the encoding of the files from the mode-line. This causes
TextIOWrapper to crash when it tries to read modules using an encoding
other than ASCII or UTF-8. Here an example:
import
Christian Heimes added the comment:
UnicodeDecodeError: 'utf8' codec can't decode bytes in position
1428-1430: invalid data
I can't reproduce this. Can you open a separate issue?
It breaks for me with the same error message on Ubuntu Linux, i386,
UCS-4 build and locale de_DE.UTF-8.
Christian Heimes added the comment:
This looks promising. I'm working on the freeze issue. Once I get that
working I'll check this in. Thanks Alexandre and Christian for all
your hard work!!!
You're welcome. Does the patch qualify me for Misc/ACKS? :)
I'm going to work on the basestring
Christian Heimes added the comment:
I found two minor bugs in the fix. In Modules/posixmodule.c the tmpnam()
and tempnam() methods return a PyString instance. Please change line
5373 and 5431 to use PyUnicode_DecodeFSDefault().
Index: Modules/posixmodule.c
Guido van Rossum added the comment:
This looks promising. I'm working on the freeze issue. Once I get that
working I'll check this in. Thanks Alexandre and Christian for all
your hard work!!!
You're welcome. Does the patch qualify me for Misc/ACKS? :)
Yes, and also Alexandre. :-)
I'm
New submission from Christian Heimes:
imp.find_module() returns an io.TextIOWrapper instance first value. The
encoding of the TextIOWrapper isn't set from a -*- coding: Latin-1 -*- line.
import imp
imp.find_module(heapq)
(io.TextIOWrapper object at 0xb7c8f50c,
92 matches
Mail list logo