g this:
>>> doStuff()
First call!
Function call!
>>> doStuff()
Function call!
>>> doStuff()
Function call!
>>> doStuff()
Function call!
>>> doStuff.timesUsed
4
Is this concidered bad coding practice since I guess persistent
variables in
uess :)
It just feels so ugly to use try/except to enable the variable but I've
found it useful at least once.
/buffi (buffis.com)
--
http://mail.python.org/mailman/listinfo/python-list
side the class containing it :)
/buffi
--
http://mail.python.org/mailman/listinfo/python-list
of init not being called until you make an instance of
that class, and by then all classes are loaded.
/buffi (buffis.com)
--
http://mail.python.org/mailman/listinfo/python-list
Kajsa Anka wrote:
> I would like some advice, I'm going to build a small app that will, among
> other things, scale images so that they can be published on a web site. I've
> never done any image processing in python before so I would like to ask what
> is the best way of doing this, I will not do
Am I the only one that thinks that python statements should force
whitespace before and after them?
Right now this is not enforced and for an example these statements are
valid
print"hello"
"foo"if"bar"else"foobar"
for(x,y)in[(1,2),(3,4)]:print(x,y)
[(y)for(x,y)in[("foo",2),("bar",4)]if"foo"in(x)
On Sep 15, 10:11 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > Am I the only one that thinks that python statements should force
> > whitespace before and after them?
>
> > Right now this is not enforced and for an example these st
On Sep 15, 3:55 pm, [EMAIL PROTECTED] wrote:
> Hi,everyone: I am a c programmer,and want using Python instead of C
> I can change backcolor using C,like this:
>
> textbackground(color);
>
> How can I do in Python?
>
> Best regards
>
> 点 击 此 处!免 费 试 玩 07 年 最 受 期 待 的 游 戏 大 作 !
textbackgrou
On Sep 15, 11:11 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm trying to test the tempfile module with the following script,
> which basically creates a temporary file, fills the file with some
> test data and prints it.
>
> import tempfile
>
> t = tempfile.TemporaryF
On Sep 15, 11:49 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > On Sep 15, 10:11 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> >> buffi wrote:
> >>> Am I the only one that thinks that python statements should force
> >&g
On Sep 15, 11:58 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I was staring at a segment of code that looked like this today:
>
> for something in stuff[x:y]:
> whatever(something)
>
> and was wondering if the compiler really made a copy of the slice from
> stuff as the co
On Sep 16, 12:20 am, James Stroud <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > On Sep 15, 11:58 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> >> Hello all,
>
> >> I was staring at a segment of code that looked like this today:
>
> >> for
On Sep 16, 12:25 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote:
> This is a case where its up to the type involved. For example,
> xrange() slices the way you want but range() does not.
Coul you explain this?
As far as I know you can't slice a xrange
- Björn Kempén
--
http://mail.python.org/m
Pretend that you have a number that is always pointing somewhere in
your temporary file.
It starts a 0.
If you then write "lalalala" (8 characters) it will point after these
at position 8, so that you can write more stuff after your previous
text later by calling write.
The read method reads all t
On Sep 16, 11:56 am, cesco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following list:
> l = [1, 2, 3, 4]
> and I'd like to obtain a list like the following:
> l_partial_sum = [1, 3, 6, 10] (that is [1, 1+2, 1+2+3, 1+2+3+4])
>
> Is there a simple way to accomplish this?
>
> I came up with the f
Uh... that turned out weird.
Anyways, here goes again
l = [1, 2, 3, 4]
[sum(l[:x+1]) for x in xrange(len(l))]
--
http://mail.python.org/mailman/listinfo/python-list
16 matches
Mail list logo