Hi,
I have a web client which send a file to a server as multipart form
data, the sending of data is from
http://code.activestate.com/recipes/146306-http-client-to-post-using-multipartform-data/.
I dont want to open the whole file to memory(at cliend end) and then
send, i just want to send part by
Hi Christiaan,
> Instances of a class have no means of storing the bound method object.
> The or unbound bound method is a simple and small wrapper that keeps a
> reference to the class, "self" and the function object. Python keeps a
> pool of empty method objects in a free list. The creation of
Hi Gregory,
> You can create your own wrapper that keeps a weak reference to
> the underlying object. Here's an example.
> [...]
Thanks for the code!
Regards,
Vincent
--
http://mail.python.org/mailman/listinfo/python-list
If you just click in my web page to see the script run in action due
to the cgitb module i use it will provide you both the source code
that the error appears and the error as well.
All you have to do is click here: http://www.webville.gr/cgi-bin/koukos.py
As for the encoding why when i print gre
Michele Simionato writes:
> I am actually more radical than that. From
> http://www.artima.com/weblogs/viewpost.jsp?thread=237121:
> In this series I have argued that super is tricky; I think nobody can...
When I look at that URL, I see a Java stack dump:
java.lang.RuntimeException:
com.jives
On Jul 31, 5:08 am, Steven D'Aprano wrote:
> I have read Michelle Simionato's articles on super in Python.
One "l" please! I am a man! ;-)
>
> But Michelle is wrong to conclude that the problem lies with the concept
> of *superclass*. The problem lies with the idea that there is ONE
> superclass
Anyone,
I have the two dictionaries below. How can I merge them, such that:
1. The cluster dictionary contains the additional elements from the
default dictionary.
2. Nothing is removed from the cluster dictionary.
The idea here is that the two dictionaries are read from different
files where, i
On 08/01/2010 07:09 PM, John Bokma wrote:
>> One thing that comes to mind is that it's much easier to distribute C
>> libraries than C++ libraries.
>
> In the beginning of C++ there were programs that just converted C++ to C
> (frontends). At least that is how the C++ compiler Acorn sold worked.
On Sun, 1 Aug 2010, Albert Hopkins wrote:
> C seems to be a good, portable language for writing interpreters and
> compilers.
And one should not forget about performance. C++ was for a long time
behind C, and even now some parts (like iostreams) should be avoided in
fast code.
BTW, C++ can be
On Sun, 01 Aug 2010 20:30:22 +1200, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>
>> If you mean a runtime optimization with no change to the source file,
>> then maybe, tell me more.
>
> Note that you don't necessarily need a separate file for this. It could
> just be a separate part of the s
On Sun, 01 Aug 2010 19:16:29 -0700, Νίκος wrote:
>>On 2 Αύγ, 03:52, Steven D'Aprano
>>wrote:
>
>> Neither do I. What makes you think there is an error? What sort of
>> error? Do you get a core dump, an exception, or something else?
>>
>> Please report what you get, and what you expect, and how t
On Aug 1, 7:12 pm, Chris Hare wrote:
> Here is the situation:
>
> I have a window with a bunch of widgets in it. I want to clear the objects
> in a given frame and recreate them to update them.
You need to check out the "w.update" and "w.update_idletasks" methods
available on all Tkinter widg
Hey, Georg! Congrats on your first release!
2010/8/1 Georg Brandl :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On behalf of the Python development team, I'm happy to announce the
> first alpha preview release of Python 3.2.
>
> Python 3.2 is a continuation of the efforts to improve and
Νίκος wrote:
Also my greek print appear in funny encoding although i do use # -*-
coding: utf-8 -*-
That line just tells Python what encoding the source file itself uses.
It doesn't affect what the program does or how it runs.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 2010-08-02 at 01:08 +0200, candide wrote:
> Python is an object oriented langage (OOL). The Python main
> implementation is written in pure and "old" C90. Is it for historical
> reasons?
>
> C is not an OOL and C++ strongly is. I wonder if it wouldn't be more
> suitable to implement an
On Aug 1, 4:26 pm, Terry Reedy wrote:
> On 8/1/2010 4:30 AM, Gregory Ewing wrote:
>
> > Steven D'Aprano wrote:
>
> >> If you mean a runtime optimization with no change to the source file,
> >> then maybe, tell me more.
>
> > Note that you don't necessarily need a separate file for this.
> > It cou
Also my greek print appear in funny encoding although i do use # -*-
coding: utf-8 -*-
--
http://mail.python.org/mailman/listinfo/python-list
>On 2 Αύγ, 03:52, Steven D'Aprano wrote:
> Neither do I. What makes you think there is an error? What sort of error?
> Do you get a core dump, an exception, or something else?
>
> Please report what you get, and what you expect, and how they are
> different.
Hello Steven,
Here is the script whe
Hello,
I've been tinkering with __code__.co_firstlineno for testing the trace.py
module (Python Issue 9315), and ran into an interesting problem. Consider
this code:
def dummydecorator(f):
return f
def foo(a):
return a
@dummydecorator
def bar(a):
return a
if __name__ == "__main__
On Aug 1, 6:09 pm, John Bokma wrote:
> Roy Smith writes:
> > In article <4c55fe82$0$9111$426a3...@news.free.fr>,
> > candide wrote:
>
> >> Python is an object oriented langage (OOL). The Python main
> >> implementation is written in pure and "old" C90. Is it for historical
> >> reasons?
>
> >>
On Sun, 1 Aug 2010, John Bokma wrote:
> In the beginning of C++ there were programs that just converted C++ to C
> (frontends). At least that is how the C++ compiler Acorn sold worked.
> So I don't think your argument was much true back then.
Those that I (tried to) used on Amiga were based aroun
于 2010-8-2 6:15, Chris Hare 写道:
I hope I can explain this correctly.
I have a GUI, which is already being processed by a mainloop. I want to be
able to open a second window so the user can interact with specific information
in the second window. I pulled together this code example
from Tkin
On Aug 1, 5:43 pm, Lawrence D'Oliveiro wrote:
> In message
> <96e47fd8-c939-48a2-9a2b-92afa720c...@k1g2000prl.googlegroups.com>, Carl
>
> Banks wrote:
> > My general feeling is that ElementTree is a lot handier for reading
> > and writing your own XML formats, than for handling XML files produced
Am 02.08.2010 01:08, schrieb candide:
> Python is an object oriented langage (OOL). The Python main
> implementation is written in pure and "old" C90. Is it for historical
> reasons?
Python is written in C89 to support as many platforms as possible. We
deliberately don't use any new features and
I'm writing a python script which runs as a windowsxp service.
The problem is how to catch the windows shutdown/reboot message and do
some cleaning job when system is going down?
The atexit module and signal module on windows dont seems to work. I
guess the python win32api may be of help, but I am
Roy Smith writes:
> In article <4c55fe82$0$9111$426a3...@news.free.fr>,
> candide wrote:
>
>> Python is an object oriented langage (OOL). The Python main
>> implementation is written in pure and "old" C90. Is it for historical
>> reasons?
>>
>> C is not an OOL and C++ strongly is. I wonder i
Terry Reedy writes:
> On 8/1/2010 7:08 PM, candide wrote:
>> Python is an object oriented langage (OOL). The Python main
>> implementation is written in pure and "old" C90. Is it for historical
>> reasons?
>
> Python was first released before C++.
C++ was named C++ in 1983 (development on it st
On Sun, 01 Aug 2010 05:05:39 -0700, Mohseniaref wrote:
> Dear Friend
> I have this erorr after running pyhon script with header
> /usr/lib/python2.6 : permisson denied I change ownership with -hR in
> super user terminal
Please COPY AND PASTE (do NOT retype them):
(1) the header from the script
Currently, I have a bash shell script which does timing for me. For
example, if I have a Unix Command I typically run time against it for
10 times and then get an average. It works fine but I have to write a
post processing script to get the time and then do a graph on
matplotlib.
I was wondering
On Sun, 01 Aug 2010 09:56:48 -0700, Νίκος wrote:
> Hello fellow Python Coders!
>
> I don't see the error in my attempt to set a a cookie in this test
> script.
Neither do I. What makes you think there is an error? What sort of error?
Do you get a core dump, an exception, or something else?
Pl
In message
<96e47fd8-c939-48a2-9a2b-92afa720c...@k1g2000prl.googlegroups.com>, Carl
Banks wrote:
> My general feeling is that ElementTree is a lot handier for reading
> and writing your own XML formats, than for handling XML files produced
> by other tools.
Why is that? I’ve successfully used it
In message <87k4oah1rp@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote:
> Lawrence D'Oliveiro writes:
>
>> No, I deliberately put it in that order to ensure that the value for l
>> can only ever be evaulated once.
>
> Try this (essentially equivalent to your code):
>
> def f():
> print "
In article <4c55fe82$0$9111$426a3...@news.free.fr>,
candide wrote:
> Python is an object oriented langage (OOL). The Python main
> implementation is written in pure and "old" C90. Is it for historical
> reasons?
>
> C is not an OOL and C++ strongly is. I wonder if it wouldn't be more
> suita
Here is the situation:
I have a window with a bunch of widgets in it. I want to clear the objects in
a given frame and recreate them to update them.
The example below destroys the top level frame, and so I can't recreate the
widgets. I am likely doing this wrong.
should I be doing this in a
On 8/1/2010 7:08 PM, candide wrote:
Python is an object oriented langage (OOL). The Python main
implementation is written in pure and "old" C90. Is it for historical
reasons?
Python was first released before C++. C is available on, and hence
Python runs on, systems that do not have C++ availab
On Mon, Aug 2, 2010 at 1:50 AM, Terry Reedy wrote:
> On 7/30/2010 7:46 AM, Lawrence D'Oliveiro wrote:
>>
>> Say a vector V is a tuple of 3 numbers, not all zero. You want to
>> normalize
>> it (scale all components by the same factor) so its magnitude is 1.
>>
>> The usual way is something like th
On 8/1/10 4:08 PM, candide wrote:
> Python is an object oriented langage (OOL). The Python main
> implementation is written in pure and "old" C90. Is it for historical
> reasons?
Portability if nothing else has been a strong reason to keep the Python
implementation to standard C. Its not as bad as
On 7/30/2010 7:46 AM, Lawrence D'Oliveiro wrote:
Say a vector V is a tuple of 3 numbers, not all zero. You want to normalize
it (scale all components by the same factor) so its magnitude is 1.
The usual way is something like this:
L = math.sqrt(V[0] * V[0] + V[1] * V[1] + V[2] * V[2])
On 7/30/2010 2:16 PM, Mahmood Naderan wrote:
So is it a compiler or interpreter?
Python is a language. It does not 'work' in the sense of your subject
line. CPython is a Python compiler/interpreter, as described. When
loaded, it may be named python.exe, depending on system and
installation.
On 8/1/2010 4:30 AM, Gregory Ewing wrote:
Steven D'Aprano wrote:
If you mean a runtime optimization with no change to the source file,
then maybe, tell me more.
Note that you don't necessarily need a separate file for this.
It could just be a separate part of the same file.
Which is to say,
Thanks Peter - I know what I said sounded stupid :-)
I have been working with Python for a week and as you know sometimes it is
easier to learn by seeing what you did wrong as compared to what should have
been done with the same example. I loved your code by the way -
Thanks for help just ano
Python is an object oriented langage (OOL). The Python main
implementation is written in pure and "old" C90. Is it for historical
reasons?
C is not an OOL and C++ strongly is. I wonder if it wouldn't be more
suitable to implement an OOL with another one.
Has it ever been planned to rewrite i
And I see now what I did wrong - thanks for putting up with the questions.
On Aug 1, 2010, at 4:32 PM, Peter Otten wrote:
> Chris Hare wrote:
>
>> Thanks for the help. My one week of python is getting a workout.
>>
>> I have shortened it all down and made it a standalone example, using yours
>
I hope I can explain this correctly.
I have a GUI, which is already being processed by a mainloop. I want to be
able to open a second window so the user can interact with specific information
in the second window. I pulled together this code example
from Tkinter import *
class Net:
d
Chris Hare wrote:
> Thanks for the help. My one week of python is getting a workout.
>
> I have shortened it all down and made it a standalone example, using yours
> as a model. Your example, works, but it will take a lot of effort to
> retrofit it into the code I have. (which is maybe not a b
I am using SQLite with Python 2.5 for an app and every now and then
get an error when trying to write to the database. So far I haven't
been careful about noting these down, but now I would like to address
them. The two errors I've noticed are:
1) "database is locked" errors (probably due to wri
On Aug 1, 2010, at 1:08 PM, Peter Otten wrote:
> Chris Hare wrote:
>
>
>> On Aug 1, 2010, at 10:24 AM, rantingrick wrote:
>>
>>> On Aug 1, 7:35 am, Chris Hare wrote:
I have the following chunk of code. Although it seems to execute fine,
no errors
>>>
>>> Not True! it contains synt
On 7/31/2010 2:00 PM, Christian Heimes wrote:
Your answer is confusing even me. ;)
Yeah, I get that a lot. :-)
Let me try an easier to understand explanation. defaultdict *implements*
__missing__() to provide the default dict behavior.
In my experience, the word *implements* is commonly u
Chris Hare wrote:
> On Aug 1, 2010, at 10:24 AM, rantingrick wrote:
>
>> On Aug 1, 7:35 am, Chris Hare wrote:
>>> I have the following chunk of code. Although it seems to execute fine,
>>> no errors
>>
>> Not True! it contains syntax errors. Check the posted code and next
>> time post all th
On 1 Aug, 16:43, News123 wrote:
> On 08/01/2010 05:34 PM, Steven W. Orr wrote:
>
>
>
> > On 08/01/10 07:27, quoth News123:
> >> On 08/01/2010 01:08 PM, News123 wrote:
> >>> I wondered, whether there's a simple/standard way to let
> >>> the Optionparser just ignore unknown command line switches.
>
Hello fellow Python Coders!
I don't see the error in my attempt to set a a cookie in this test
script. Can you help please?! Thank you!
[code]
#!/usr/bin/python
# -*- coding: utf-8 -*-
import Cookie
print ( "Content-type: text/html\n" )
cookie = Cookie.SimpleCookie()
if cookie.has_key('visito
On 08/01/2010 05:34 PM, Steven W. Orr wrote:
> On 08/01/10 07:27, quoth News123:
>> On 08/01/2010 01:08 PM, News123 wrote:
>>> I wondered, whether there's a simple/standard way to let
>>> the Optionparser just ignore unknown command line switches.
>>>
>>
>> In order to illustrate, what I try to ac
Dear Colleagues,
I recently started a recruiter project at Google and am working with Partner
Solutions Organization and recruiting Technical Account Managers for the group
so I am actively networking with those who may know great software engineers
with client-facing experience (or wanting to
On Aug 1, 2010, at 10:24 AM, rantingrick wrote:
> On Aug 1, 7:35 am, Chris Hare wrote:
>> I have the following chunk of code. Although it seems to execute fine, no
>> errors
>
> Not True! it contains syntax errors. Check the posted code and next
> time post all the code.
> --
> http://mail.p
On 08/01/10 07:27, quoth News123:
> On 08/01/2010 01:08 PM, News123 wrote:
>> I wondered, whether there's a simple/standard way to let
>> the Optionparser just ignore unknown command line switches.
>>
>
> In order to illustrate, what I try to achieve:
>
>
> import optparse
> parser = optparse.O
On Aug 1, 7:35 am, Chris Hare wrote:
> I have the following chunk of code. Although it seems to execute fine, no
> errors
Not True! it contains syntax errors. Check the posted code and next
time post all the code.
--
http://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro writes:
>>> V = tuple \
>>> (
>>> x
>>> /
>>> l
>>>for x in V
>>>for l in
>>>(math.sqrt(reduce(lambda a, b : a + b, (y * y for y in V),
>>>0)),)
>>> )
>>
>> You got the order wrong (it has
Tim,
> Sounds like the shlex module...
> http://docs.python.org/library/shlex.html
Cheers for the link - that's *exactly* what I was searching for.
For the archives: Here's an excellent tutorial on this module.
http://www.oreillynet.com/onlamp/blog/2007/10/pymotw_shlex.html
Malcolm
--
http://m
Mohseniaref writes:
> Dear Friend
> I have this erorr after running pyhon script with header
> /usr/lib/python2.6 : permisson denied
> I change ownership with -hR in super user terminal
Why /usr/lib... and not in bin?
I guess this is the directory, of course if you put it in the header
(shabang)
On 08/01/10 08:12, pyt...@bdurham.com wrote:
Before I reinvent the wheel, is there a module that provides a
command-line like parser that I can use? By command-line like
parser, I mean that I would like to pass a string to this
function and get back a list in the same manner as the OS
receives a
Before I reinvent the wheel, is there a module that provides a
command-line like parser that I can use? By command-line like
parser, I mean that I would like to pass a string to this
function and get back a list in the same manner as the OS
receives a command line string which it parses into discre
In article ,
Lawrence D'Oliveiro wrote:
> In message <8bkosifpi...@mid.individual.net>, Gregory Ewing wrote:
>
> > Don't you just leave the machine on overnight and wait
> > for Microsoft to download all the stuff they think
> > you should be using?
>
> Thatâs fine, but it doesnât handle t
I have the following chunk of code. Although it seems to execute fine, no
errors, the image is never resized. What am I missing?
imagePNG = Image.open("image.png")
photo = ImageTk.PhotoImage(imagePNG
canvasWidth = 300
canvasHeight
I am a newbie to python, but not programming.
I have a menubar item
displaySubMenu.add_command(label="External", command=externalDisplay)
externalDisplay is a new class, which I have already imported. The class is
here:
from Tkinter import *
from datetime import datetime, date, time
import u
Dear Friend
I have this erorr after running pyhon script with header
/usr/lib/python2.6 : permisson denied
I change ownership with -hR in super user terminal
--
http://mail.python.org/mailman/listinfo/python-list
On 08/01/2010 01:08 PM, News123 wrote:
> I wondered, whether there's a simple/standard way to let
> the Optionparser just ignore unknown command line switches.
>
In order to illustrate, what I try to achieve:
import optparse
parser = optparse.OptionParser()
parser.add_option("-t","--test",des
In message , Mark
Lawrence wrote:
> On 01/08/2010 08:18, Lawrence D'Oliveiro wrote:
>
>> In message, Mark
>> Lawrence wrote:
>>
>>> On 01/08/2010 07:50, Lawrence D'Oliveiro wrote:
>>>
In message, Mark
Lawrence wrote:
> Personally I find double clicking on an msi file rather eas
I wondered, whether there's a simple/standard way to let
the Optionparser just ignore unknown command line switches.
thanks in advance for any ideas
--
http://mail.python.org/mailman/listinfo/python-list
On 22 Lug, 01:13, Terry Reedy wrote:
> If you do not get an answer here, file a bug report. If you can, put
> orsenthil,benjamin.peterson,ezio.melotti
> on the nosy list, as they are recent committers to this file. Say I said
> to do so if you want. Add tjreedy also so I can see responses and lea
On 08/01/2010 03:41 AM, Lawrence D'Oliveiro wrote:
> In message <87sk2zhpcj@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote:
>
>> Lawrence D'Oliveiro writes:
>>
>>> V = tuple \
>>> (
>>> x
>>> /
>>> l
>>>for x in V
>>>for l in
>>>
On 2010-08-01, Mark Lawrence wrote:
> On 01/08/2010 06:17, Tim Harig wrote:
>> On 2010-08-01, Lawrence D'Oliveiro wrote:
>>> In message, Tim Harig wrote:
>>>
It would be rewarding as it would make writing cross-platform charactor
mode applications possible.
>>>
>>> I thought Windows use
Hi,
On 07/31/2010 11:04 AM, Matteo Landi wrote:
> What are the messages one should really care about while evaluating
> its code using pylint? It's easy to get 5 scored with a "lot of public
> methods" or bad named variables such as 'x' or 'y' .. Have you got any
> config file to share?
The mos
In message <8bkosifpi...@mid.individual.net>, Gregory Ewing wrote:
> Don't you just leave the machine on overnight and wait
> for Microsoft to download all the stuff they think
> you should be using?
That’s fine, but it doesn’t handle the non-Microsoft stuff.
--
http://mail.python.org/mailman/li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On behalf of the Python development team, I'm happy to announce the
first alpha preview release of Python 3.2.
Python 3.2 is a continuation of the efforts to improve and stabilize the
Python 3.x line. Since the final release of Python 2.7, the 2.x li
Steven D'Aprano wrote:
If you mean a runtime optimization with no change to the source file,
then maybe, tell me more.
Note that you don't necessarily need a separate file for this.
It could just be a separate part of the same file.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-li
Lawrence D'Oliveiro wrote:
How many .msi files would you have to click on to achieve the Windows
equivalent?
Don't you just leave the machine on overnight and wait
for Microsoft to download all the stuff they think
you should be using?
--
Greg
--
http://mail.python.org/mailman/listinfo/python
Steven D'Aprano wrote:
super(C, self)
shouldn't be interpreted as "call C's superclasses from self". It means
"starting just after C in the MRO, call self.__class__'s superclasses".
My contention is that nobody has any chance of guessing what
it does based on the name "super". Superness does
On 01/08/2010 08:18, Lawrence D'Oliveiro wrote:
In message, Mark
Lawrence wrote:
On 01/08/2010 07:50, Lawrence D'Oliveiro wrote:
In message, Mark
Lawrence wrote:
Personally I find double clicking on an msi file rather easier.
Easier than apt-get dist-upgrade?
I'm sorry but I only do Eng
On Sat, 31 Jul 2010 13:29:25 +, Brian Victor wrote:
> Steven D'Aprano wrote:
>> On Sat, 31 Jul 2010 14:25:39 +1200, Gregory Ewing wrote:
>>
>>> Steven D'Aprano wrote:
>>>
A
/ \
C B
\ /
D
/ \
E F
Yes, a super
In message , Mark
Lawrence wrote:
> On 01/08/2010 07:50, Lawrence D'Oliveiro wrote:
>
>> In message, Mark
>> Lawrence wrote:
>>
>>> Personally I find double clicking on an msi file rather easier.
>>
>> Easier than apt-get dist-upgrade?
>
> I'm sorry but I only do English, could you please transl
On Sat, 31 Jul 2010 19:52:05 -0700, Carl Banks wrote:
> PEP 3174 got me to thinking.
>
> There is now a subdirectory to deposit as many *.pyc files as you want
> without cluttering the source directory (never mind the default case).
> Which means you can pretty much write files with impunity.
>
On 01/08/2010 07:50, Lawrence D'Oliveiro wrote:
In message, Mark
Lawrence wrote:
Personally I find double clicking on an msi file rather easier.
Easier than apt-get dist-upgrade?
I'm sorry but I only do English, could you please translate. :)
Mark Lawrence.
--
http://mail.python.org/mailm
82 matches
Mail list logo