Colin J. Williams wrote:
Piet van Oostrum wrote:
tinn...@isbd.co.uk (t) wrote:
t> I've had this trouble before, how do I find the details of how "in"
t> works in the documentation. E.g. the details of:-
t> if string in bigstring:
t> It gets a mention in the "if" section but not a l
On Fri, Mar 13, 2009 at 10:29 PM, Paul Rubin wrote:
> Saurabh writes:
>> Hi all,
>> I am an experienced C programmer, I have done some perl code as well.
>> But while thinking about large programs,I find perl syntax a
>> hinderance.
>
> I would say read the online tutorial, then "Python in a Nuts
I am the author of MyHDL, a Python package that turns Python
into a hardware description language (HDL).
Integer arithmetic is very important in hardware design,
but with traditional HDLs such as Verilog and VHDL it is
complicated and confusing. MyHDL has a better solution,
inspired by Python's n
In message <302dd4f5-e9b3-4b0a-b80c-
ae43810d8...@e18g2000yqo.googlegroups.com>, aiwarrior wrote:
> I recently am meddling with threads and wanted to make a threaded
> class that instead of processing anything just retrieves data from a
> file and returns that data to a main thread that takes all
>
> I don't get *why* someone would like to write that. Does it look "cool"? Is
> it some kind of "Look, ma, I know those hidden names!" syndrome? Is it
> contagious?
>
I think thats what it is. It does look cool, thats for telling me about the
fact that
prevents the interpreter from doing many o
I'm actually still getting to this section of my code, I've been working a
logging,stdout colors lately, Although I am going to need __import__ in
several places in this program
-Alex Goretoy
http://www.goretoy.com
On Sat, Mar 14, 2009 at 3:05 AM, alex goretoy
wrote:
> I don't get *why* someon
I can show you people more code if you want :) I like to learn
-Alex Goretoy
http://www.goretoy.com
On Sat, Mar 14, 2009 at 3:09 AM, alex goretoy
wrote:
> I'm actually still getting to this section of my code, I've been working a
> logging,stdout colors lately, Although I am going to need __imp
On Thu, 2009-03-12 at 14:49 -0700, John Machin wrote:
> I see that you haven't had the evil spirits exorcised from your mail/
> news client ... it's hijacked a thread again :-(
> don't worry, won't happen this time.
It seams I did some thing wrong with the settings and it drops out
mails.
Now the
This is a chunk of what its starting to look like now, thanks
from colors import _available_colors as _ck
from has_colors import _has_colors as _ha
from log import _brush as _er
class stdout_colors(object):
def
__init__(self,colors_active=1,output_caller=1,caller_color="red",default=1,
Peter Billam wrote:
> I've got this tkinter program which allows you to load a file with
> File/LoadFile or Ctrl-L or from the Alt-F menu, as usual. But I'd
> also like to be able to invoke it with:
> shellprompt> midimix x.mid
> and have it invoke its usual loadFile method on x.mid
> But with t
"John Nagle" wrote:
> Yes. In COBOL, one writes
>
> PICTURE $999,999,999.99
>
> which is is way ahead of most of the later approaches.
That was fixed width. For zero suppression:
PIC ,$$$,$99.99
This will format 1000 as $1,000.00
For fixed width zero suppression:
PIC $ZZZ,ZZZ,Z9
How can I convert the following string:
'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
into this sequence:
['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
Thanks a lot,
Mattia
--
http://mail.python.org/mailman/listinfo
>>> a = eval("[%s]" %
"'AAR','ABZ','AGA','AHO','ALC','LEI','AOC','EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'")
>>> a
['AAR', 'ABZ', 'AGA', 'AHO', 'ALC', 'LEI', 'AOC', 'EGC', 'SXF', 'BZR',
'BIQ', 'BLL', 'BHX', 'BLQ']
On Sat, Mar 14, 2009 at 5:09 PM, mattia wrote:
> How can I convert the following
> Peter Billam wrote:
> window = MainWindow(application)
> if (len(sys.argv) > 1) and os.path.exists(sys.argv[1]):
> window.loadFile(sys.argv[1])
> application.mainloop()
> File "./midimix", line 465, in loadFile
> space0.grid(row=grid_row,
> pady=round(0.5*(ymid[track_num]-y
mattia wrote:
> How can I convert the following string:
>
> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>
> into this sequence:
>
> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
import string
string.split("a,b,c
2009/3/14 mattia :
> How can I convert the following string:
>
> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>
> into this sequence:
>
> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
>
> Thanks a lot,
> Mattia
> --
mattia wrote:
> How can I convert the following string:
>
> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>
> into this sequence:
>
> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
>>> s = "'AAR','ABZ','AGA','AHO'
Il Sat, 14 Mar 2009 10:24:38 +0100, Ulrich Eckhardt ha scritto:
> mattia wrote:
>> How can I convert the following string:
>>
>> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>>
>> into this sequence:
>>
>> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>>
Peter Billam wrote:
>> Peter Billam wrote:
>> window = MainWindow(application)
>> if (len(sys.argv) > 1) and os.path.exists(sys.argv[1]):
>> window.loadFile(sys.argv[1])
>> application.mainloop()
>> File "./midimix", line 465, in loadFile
>> space0.grid(row=grid_row,
>> pady
Karthik Gurusamy escribió:
> On Mar 13, 6:39 pm, Roman Medina-Heigl Hernandez
> wrote:
>> Hi,
>>
>> I'm experimenting with Python and I need a little help with this. What I'd
>> like is to launch an interactive shell, having the chance to send first
>> several commands from python. I've written th
On 14 Mar, 02:08, Aaron Brady wrote:
> On Mar 13, 5:42 pm, Matteo wrote:
>
>
>
> > On 13 Mar, 22:35, Aaron Brady wrote:
>
> > > On Mar 13, 1:34 pm, Matteo wrote:
>
> > > > hmmm... looks like SWIG has a problem with double pointers. I googled
> > > > around a bit and found:
>
> > > >http://osdir
Re-posting in more simple and precise terms from a previous thread
http://groups.google.it/group/comp.lang.python/browse_thread/thread/6dd7bd9a09b8a011/5119cf15ebfa38b8
Problem:
SWIG doesn't properly wrap c++ arrays of pointers, therefore when you
try to call a c++ function which requires them, a
Il Sat, 14 Mar 2009 10:30:43 +0100, Vlastimil Brom ha scritto:
> 2009/3/14 mattia :
>> How can I convert the following string:
>>
>> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>>
>> into this sequence:
>>
>> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>>
mattia wrote:
Il Sat, 14 Mar 2009 10:30:43 +0100, Vlastimil Brom ha scritto:
2009/3/14 mattia :
How can I convert the following string:
'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
into this sequence:
['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','S
mattia wrote:
> Il Sat, 14 Mar 2009 10:30:43 +0100, Vlastimil Brom ha scritto:
>
>> 2009/3/14 mattia :
>>> How can I convert the following string:
>>>
>>> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>>> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>>>
>>> into this sequence:
>>>
>>> ['AAR','ABZ','AGA'
Il Sat, 14 Mar 2009 10:35:59 +0100, Peter Otten ha scritto:
> mattia wrote:
>
>> How can I convert the following string:
>>
>> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>>
>> into this sequence:
>>
>> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>> E
On Mar 14, 7:00 am, Tim Golden wrote:
> Well, this may not solve the OP's problem, but the current
> (2.7a0) .chm file has a much better index for operators and
> keywords. And "in" is in there. If you're interested in
> comparing, there's a copy here:
>
> http://timgolden.me.uk/python/downloads/
On 13 mrt, 23:30, "Gabriel Genellina" wrote:
> En Fri, 13 Mar 2009 17:59:34 -0200, escribió:
>
>
>
> > On 12 mrt, 18:43, "Gabriel Genellina" wrote:
> >> En Thu, 12 Mar 2009 07:21:35 -0200, escribió:
>
> >> > I'm not so much involved in any Windows programming however I needed
> >> > to write a
Colin J. Williams wrote:
> Piet van Oostrum wrote:
> >> tinn...@isbd.co.uk (t) wrote:
> >
> >> t> I've had this trouble before, how do I find the details of how "in"
> >> t> works in the documentation. E.g. the details of:-
> >
> >> t> if string in bigstring:
> >
> >> t> It gets a ment
mattia wrote:
> Il Sat, 14 Mar 2009 10:35:59 +0100, Peter Otten ha scritto:
>
>> mattia wrote:
>>
>>> How can I convert the following string:
>>>
>>> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
>>> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>>>
>>> into this sequence:
>>>
>>> ['AAR','ABZ','AGA',
Il Sat, 14 Mar 2009 12:13:31 +0100, Peter Otten ha scritto:
> mattia wrote:
>
>> Il Sat, 14 Mar 2009 10:35:59 +0100, Peter Otten ha scritto:
>>
>>> mattia wrote:
>>>
How can I convert the following string:
'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','B
I'm trying this on Python 3.0.1
Consider the following code:
"""
import multiprocessing as mp
def jambu(b,i,gl):
for n in range(10):
with gl[i]:
b[i]+=2
with gl[3-i]:
b[3-i]-=1
def main():
b = mp.RawArray('i',4)
gl = []
proc = []
for i
jkn wrote:
On Mar 14, 7:00 am, Tim Golden wrote:
Well, this may not solve the OP's problem, but the current
(2.7a0) .chm file has a much better index for operators and
keywords. And "in" is in there. If you're interested in
comparing, there's a copy here:
http://timgolden.me.uk/python/downloa
Thanks much.
-=roger
> Yet more specifically: if the extension module or Python host opens
> a file with fopen(), and passes it to PyRun_{Any|Simple}File[Ex][Flags],
> Python will crash.
>
> HTH,
> Martin
>
> P.S. There may be more cases in which you get crashes - the list above
> includes just th
I found no solution on the net so I am posting my solution here.
It can be called with "python cwd 1-1-2009 14-3-2009"
from dateutil.rrule import *
from dateutil.parser import *
from datetime import *
from sys import *
start = parse( argv[1] )
#end = datetime.now()
end = parse( argv[2] )
workday
On Mar 14, 12:04 pm, Chris Rebert wrote:
> On Fri, Mar 13, 2009 at 10:29 PM, Paul Rubin wrote:
> > Saurabh writes:
> >> Hi all,
> >> I am an experienced C programmer, I have done some perl code as well.
> >> But while thinking about large programs,I find perl syntax a
> >> hinderance.
>
> > I wo
Gary Herron wrote:
> Robert Kern wrote:
>> On 2009-03-06 14:23, Gary Herron wrote:
>>> Robert Kern wrote:
On 2009-03-06 13:46, Gary Herron wrote:
> Emanuele D'Arrigo wrote:
>> Hi everybody,
>>
>> while testing a module today I stumbled on something that I can work
>> around
Paul Rubin wrote:
> Steven D'Aprano writes:
>> It is never
>> correct to avoid using "is" when you need to compare for identity.
>
> When is it ever necessary to compare for identity?
For example when providing a unique "sentinel" value as a function
argument. The parameter must be tested for i
Carl Banks wrote:
> On Mar 8, 5:32 am, Lie Ryan wrote:
>> Mel wrote:
>>> wrote:
Steven D'Aprano writes:
> It is never
> correct to avoid using "is" when you need to compare for identity.
When is it ever necessary to compare for identity?
>>> Ho-hum. MUDD game.
>>> def broadcas
Daniel Fetchinson wrote:
I've noticed that Pygame has some similar implementation.
It's a little harder to use, but efficient.
And i think it depends on PIL too.
And Pygame is Python 2.x too...
...
When I asked about it there I was told that some work already has
started on porting PIL to py
tinn...@isbd.co.uk wrote:
...
But I was wondering if there's a neater/easier way?
How is "if stringA.lower() in stringB.lower():" complex/messy?
Well I guess I was just looking for "incase" a bit like "strcasecmp"
in C.
Which locales case folding do you want to have applied?
Tino
smime.p
farsi...@gmail.com wrote:
> Thanks all, that's very helpful, sorry to waste your time with a
> common question. I have tried the decimal module and will definitely
> keep using it if I need to do this kind of calculation again.
>
> I have 1 more question that the floating point article that was li
On Mar 15, 12:13 am, Gonsolo wrote:
> I found no solution on the net so I am posting my solution here.
> It can be called with "python cwd 1-1-2009 14-3-2009"
>
> from dateutil.rrule import *
> from dateutil.parser import *
> from datetime import *
> from sys import *
H ... I wonder what the
Beni Cherniavsky wrote:
> This proposal outrageously suggests a special syntax for in-line
> functions passed as keyword arguments::
>
> >>> sorted(range(9), key(n)=n%3)
> [0, 3, 6, 1, 4, 7, 2, 5, 8]
>
> The claim is that such specialization hits a syntax sweet spot, and
> that thi
My new class I've been working on might help you. It does what you are
asking without eval (I'm still working on it) Anyone have any ideas aswell
along with the OP, thank you
#!/usr/bin env python
#
# -*- coding: UTF-8 -*-
#
# PyNutButter BETA Version 0.1.0.1
#
# Copyright 2009 - Infinity by Alex
Tim Golden wrote:
Colin J. Williams wrote:
Piet van Oostrum wrote:
tinn...@isbd.co.uk (t) wrote:
t> I've had this trouble before, how do I find the details of how "in"
t> works in the documentation. E.g. the details of:-
t> if string in bigstring:
t> It gets a mention in the "if"
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__(self):
self.some_value = 0
self.another_value = None
Similar effect can be achieved by defi
Hallöchen!
I parse an XML file with ElementTree and get the contets with
the .attrib, .text, .get etc methods of the tree's nodes.
Additionally, I use the "find" and "findtext" methods.
My problem is that if there is only ASCII, these methods return
ordinary strings instead of unicode. So someti
I'm new to python. Could someone please explain the following behaviour
of a recursive data structure?
def new_node(id='', daughters=[]):
return dict(id=id, daughters=daughters)
n0 = new_node(id='n0')
n1 = new_node(id='n1')
## Seems OK so far:
n0 # {'id': 'n0'
Maxim Khitrov wrote:
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__(self):
self.some_value = 0
self.another_value = None
Similar effect
On Sat, Mar 14, 2009 at 12:31 PM, Dan Davison wrote:
> I'm new to python. Could someone please explain the following behaviour
> of a recursive data structure?
>
> def new_node(id='', daughters=[]):
> return dict(id=id, daughters=daughters)
This is something of a FAQ:
http://effbot.org/zone/de
Dan Davison wrote:
I'm new to python. Could someone please explain the following behaviour
of a recursive data structure?
def new_node(id='', daughters=[]):
return dict(id=id, daughters=daughters)
n0 = new_node(id='n0')
n1 = new_node(id='n1')
[snip]
See
http://www.python.org/doc/faq/gene
How about:
from datetime import date, timedelta
# Define the weekday mnemonics to match the date.weekday function
(MON, TUE, WED, THU, FRI, SAT, SUN) = range(7)
def workdays(start_date, end_date, whichdays=(MON,TUE,WED,THU,FRI)):
'''
Calculate the number of working days between two dates
On 14 Mar, 17:31, Dan Davison wrote:
> I'm new to python. Could someone please explain the following behaviour
> of a recursive data structure?
>
> def new_node(id='', daughters=[]):
> return dict(id=id, daughters=daughters)
>
Most probably, here is the problem : try this instead:
def new_no
On Sat, Mar 14, 2009 at 12:50 PM, MRAB wrote:
> Maxim Khitrov wrote:
>>
>> Very simple question on the preferred coding style. I frequently write
>> classes that have some data members initialized to immutable values.
>> For example:
>>
>> class Test(object):
>> def __init__(self):
>> se
# THIS WORKS OK
from multiprocessing import Pool
N = 400
K = 800
processes = 2
def costlyFunction2(z):
r = 0
for k in xrange(1, K+2):
r += z ** (1 / k**1.5)
return r
class ABC:
def __init__(self): pass
def testParallel(self):
po = Pool(processes=processes)
Krishnakant writes:
> However when I apply the same elements and attributes to the one I am
> creating with odfpy, I get "attribute not allowed " errors.
> If some one is interested to look at the code, please let me know, I can
> send an attachment off the list so that others are not forced to
>
On Mar 14, 5:30 pm, Nick Craig-Wood wrote:
> BeniCherniavsky wrote:
> > This proposal outrageously suggests a special syntax for in-line
> > functions passed as keyword arguments::
>
> > >>> sorted(range(9), key(n)=n%3)
> > [0, 3, 6, 1, 4, 7, 2, 5, 8]
>
> > The claim is that such spec
Any idea when PyWin32 will be available for Python 3.x?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Maxim Khitrov:
> When the types are immutable, there is no difference.
But you may want different instances to have different immutable data.
Generally if the data (immutable or not) is the same for all the
instances, use class attributes, otherwise use instance attributes.
Bye,
bearophile
--
ht
Maxim Khitrov wrote:
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__(self):
self.some_value = 0
self.another_value = None
Similar effect
Colin J. Williams wrote:
Tim Golden wrote:
Colin J. Williams wrote:
Piet van Oostrum wrote:
tinn...@isbd.co.uk (t) wrote:
t> I've had this trouble before, how do I find the details of how "in"
t> works in the documentation. E.g. the details of:-
t> if string in bigstring:
t> It g
On 3/13/2009 10:29 PM, Paul Rubin wrote:
Saurabh writes:
> Hi all,
> I am an experienced C programmer, I have done some perl code as well.
> But while thinking about large programs,I find perl syntax a
> hinderance.
I would say read the online tutorial, then "Python in a Nutshell".
That
John Nagle wrote:
Any idea when PyWin32 will be available for Python 3.x?
John Nagle
Release 213 is out already:
http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063&release_id=661475
I think it's still considered a little bit beta. There have been
Jan Decaluwe wrote:
I am the author of MyHDL, a Python package that turns Python
into a hardware description language (HDL).
Integer arithmetic is very important in hardware design,
but with traditional HDLs such as Verilog and VHDL it is
complicated and confusing. MyHDL has a better solution,
i
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 12:50 PM, MRAB wrote:
Maxim Khitrov wrote:
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__(self):
se
dmitrey wrote:
# THIS WORKS OK
from multiprocessing import Pool
N = 400
K = 800
processes = 2
def costlyFunction2(z):
r = 0
for k in xrange(1, K+2):
r += z ** (1 / k**1.5)
return r
class ABC:
def __init__(self): pass
def testParallel(self):
po = Pool(processe
bieff...@gmail.com wrote:
On 14 Mar, 17:31, Dan Davison wrote:
I'm new to python. Could someone please explain the following behaviour
of a recursive data structure?
def new_node(id='', daughters=[]):
return dict(id=id, daughters=daughters)
Most probably, here is the problem : try this
dmitrey wrote:
> This doesn't work for
> costlyFunction2 = lambda x: 11
> as well; and it doesn't work for imap, apply_async as well (same
> error).
> So, isn't it a bug, or it can be somehow fixed?
> Thank you in advance, D.
It's not a bug but a limitation of the pickle protocol. Pickle can't
han
On Sat, Mar 14, 2009 at 2:07 PM, Gary Herron wrote:
> Maxim Khitrov wrote:
>>
>> Very simple question on the preferred coding style. I frequently write
>> classes that have some data members initialized to immutable values.
>> For example:
>>
>> class Test(object):
>> def __init__(self):
>>
This is a file that is going into the new version of python-stdout-colors
> project location:
> http://code.google.com/p/python-stdout-colors/
-Alex Goretoy
http://www.goretoy.com
On Sat, Mar 14, 2009 at 10:45 AM, alex goretoy
wrote:
> My new class I've been working on might help you. It doe
In article ,
Tim Chase wrote:
>> I am interested in writing an application that functions like a Unix
>> or Linux top in the way it displays data.
>> It should be command-line based but dynamically refreshing.
>
>You might look at the sourcecode for "iotop"[1] which would make
>a good example (i
On Mar 14, 3:01 am, "Gabriel Genellina"
wrote:
> En Fri, 13 Mar 2009 19:07:46 -0200, aiwarrior
> escribió:
>
> > I recently am meddling with threads and wanted to make a threaded
> > class that instead of processing anything just retrieves data from a
> > file and returns that data to a main th
On Sat, Mar 14, 2009 at 12:32 PM, Maxim Khitrov wrote:
> Very simple question on the preferred coding style. I frequently write
> classes that have some data members initialized to immutable values.
> For example:
>
> class Test(object):
> def __init__(self):
> self.some_value = 0
>
bieff...@gmail.com writes:
> On 14 Mar, 17:31, Dan Davison wrote:
>> I'm new to python. Could someone please explain the following behaviour
>> of a recursive data structure?
>>
>> def new_node(id='', daughters=[]):
>> return dict(id=id, daughters=daughters)
>>
>
> Most probably, here is the
How can I convert the following string:
'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
into this sequence:
['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
Though several other options have come through:
>>> s = "'
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 2:07 PM, Gary Herron wrote:
Maxim Khitrov wrote:
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__(se
Maxim Khitrov wrote:
Perhaps a different example would help explain what I'm trying to do:
class Case1(object):
def __init__(self):
self.count = 0
self.list = []
def inc(self):
self.count += 1
self.list.append(sel
I know that this can be evident for most of the people but i would like to know
the reply and the reasoning if possible:
Should my python application have a difference in speed of execution after
change the encoding header of the file from nothing (ascii) to latin-1 or utf-8?
If yes, only when th
Hi David,
based on your code snippid I added a couple of lines to actually center
align text in the merged cell in first row.
Please note in the following code that I have added ParagraphProperties
in the imports and created one style with textalign="center" as an
attribute.
*** code follows ***
On Mar 14, 7:11 am, Ahmad Syukri bin Abdollah
wrote:
> I'm trying this on Python 3.0.1
> Consider the following code:
> """
> import multiprocessing as mp
>
> def jambu(b,i,gl):
> for n in range(10):
> with gl[i]:
> b[i]+=2
> with gl[3-i]:
> b[3-i]-=1
Linos wrote:
I know that this can be evident for most of the people but i would like
to know the reply and the reasoning if possible:
Should my python application have a difference in speed of execution after
change the encoding header of the file from nothing (ascii) to latin-1
or utf-8?
If y
Hi,
is tkinter able to start a windows without the frame of the according
window manager? (only needed for Linux, KDE desktop)
The window should only be closed by click on a button within the window!
I should not be moved, it should not be close, ... and so on. The
solution would be: start with
Gary Herron writes:
> But now you are not listening to what people are telling you. It has
> *nothing* to do with the mutability/immutability of the integer and the list
> your two classes create.
No! Did you run the code he posted? The immutability makes all the
difference.
> The difference
On Sat, Mar 14, 2009 at 4:31 PM, Gary Herron wrote:
>> Perhaps a different example would help explain what I'm trying to do:
>>
>> class Case1(object):
>> def __init__(self):
>> self.count = 0
>> self.list = []
>>
>> def inc(self):
>> sel
On Sat, Mar 14, 2009 at 5:38 PM, Matthew Woodcraft
wrote:
> Gary Herron writes:
> I think this code is in poor taste: it's clear that it will confuse
> people (which is what Maxim was asking about in the first place).
Yes, I see that now, thanks :)
- Max
--
http://mail.python.org/mailman/listin
Hallöchen!
Maxim Khitrov writes:
> [...]
>
> The advantage of doing this is that the assignments are evaluated
> once and thus the creation of that class is a bit faster. Access
> is still performed through self.some_value and
> self.another_value. Is there a reason to prefer the first style
> ov
Hallöchen!
Stefan Behnel writes:
> Torsten Bronger wrote:
>
>> [...]
>>
>> My problem is that if there is only ASCII, these methods return
>> ordinary strings instead of unicode. So sometimes I get str,
>> sometimes I get unicode. Can one change this globally so that
>> they only return unicod
Torsten Bronger wrote:
> I parse an XML file with ElementTree and get the contets with
> the .attrib, .text, .get etc methods of the tree's nodes.
> Additionally, I use the "find" and "findtext" methods.
>
> My problem is that if there is only ASCII, these methods return
> ordinary strings instead
Krishnakant writes:
> based on your code snippid I added a couple of lines to actually center
> align text in the merged cell in first row.
Sorry, guess I should have verified handling all the requirements :-)
I think there's two issues:
* I neglected to add the style I created to the document
I'm doing this in my code, how to make it define all this functions for me
with lambda, I've been up for a while and cant seem to figure it out, whats
the most efficient way to do it? with lambda? how? thx
def red(self,value,color='red',level='INFO'):
self.write(value,color,level)
I was going to file a bug report for this, but then I wondered if it was
considered normal behaviour. Am I wrong in thinking there should be a
better error message?
>>> class NoHash:
... def __hash__(self):
... pass
...
>>> frozenset([NoHash()])
Traceback (most recent call last):
File ""
Ekkard Gerlach wrote:
Hi,
is tkinter able to start a windows without the frame of the according
window manager? (only needed for Linux, KDE desktop)
The window should only be closed by click on a button within the window!
I should not be moved, it should not be close, ... and so on. The
soluti
I'm doing this in my code, how to make it define all this functions for me
with lambda, I've been up for a while and cant seem to figure it out, whats
the most efficient way to do it? with lambda? how? thx
def red(self,value,color='red',level='INFO'):
self.write(value,color
Martin P. Hellwig schrieb:
Try a google search on:
tkinter overrideredirect
thx! That's it!
--
http://mail.python.org/mailman/listinfo/python-list
I would suggest using functools.partial like this
from functools import partial
class Foo(object):
#...
red = partial(color='red')
--
http://mail.python.org/mailman/listinfo/python-list
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 4:31 PM, Gary Herron wrote:
Perhaps a different example would help explain what I'm trying to do:
class Case1(object):
def __init__(self):
self.count = 0
self.list = []
def inc(self):
s
is this what you want (python 3.0)?
>>> class Colours:
... def __init__(self):
... for colour in ['red', 'blue']:
... setattr(self, colour, lambda value, c=colour: self.write(value, c))
... def write(self, value, colour):
... print(value, colour)
...
>>> c = Colours()
>>> c.red(
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 5:38 PM, Matthew Woodcraft
wrote:
Gary Herron writes:
I think this code is in poor taste: it's clear that it will confuse
people (which is what Maxim was asking about in the first place).
Careful now -- I didn't write that. (Although I ag
Hello guys i am trying to make a simple sql parser and i found pyparse , my
question here is does it return a data structure like an abstract syntax
tree of the sql query.Any help is appreciated
Aditya
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 113 matches
Mail list logo