Hi list,
recently I started to work on an application [1] which makes use of the Tkinter
module to handle interaction with the user. Simply put, the app is a text
widget displaying a file filtered by given criteria, with a handy feature that
the window is raised each time a new line is added to th
On May/28, Matteo Landi wrote:
> Hi list,
> recently I started to work on an application [1] which makes use of the
> Tkinter
> module to handle interaction with the user. Simply put, the app is a text
> widget displaying a file filtered by given criteria, with a handy feature th
On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote:
> On 5/30/2012 6:19 PM, Matteo Landi wrote:
>>
>> On May/28, Matteo Landi wrote:
>>>
>>> Hi list,
>>> recently I started to work on an application [1] which makes use of the
>>> Tkinter
>>
On Thu, May 31, 2012 at 3:02 PM, Matteo Landi wrote:
> On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote:
>> On 5/30/2012 6:19 PM, Matteo Landi wrote:
>>>
>>> On May/28, Matteo Landi wrote:
>>>>
>>>> Hi list,
>>>> recently
On Jun/01, Matteo Landi wrote:
> On Thu, May 31, 2012 at 3:02 PM, Matteo Landi wrote:
> > On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote:
> >> On 5/30/2012 6:19 PM, Matteo Landi wrote:
> >>>
> >>> On May/28, Matteo Landi wrote:
> >>>>
On Jun/02, Dennis Lee Bieber wrote:
> On Sat, 2 Jun 2012 14:57:17 +0200, Matteo Landi
> declaimed the following in gmane.comp.python.general:
>
>
> > Lesson learned: never invoke Tkinter functions / methods outside the
> > mainloop
> > thread.. NEVER!
> &g
Hi list,
yesterday I released a new version of "osaic", a Python library which enables
users to create photo mosaics in a very simple way. Once installed, a bare
``python -mosaic IMG1 IMG2 IMG3 ..`` is enough to create and show on screen a
mosaic where IMG2, IMG3 and others are combined togeth
I imagine he is looking for a cross-platform solution: n this case, I guess the
most suitable solution is pygame.
Regards,
Matteo
--
http://mail.python.org/mailman/listinfo/python-list
Probably because of the fact it is possible to set True equal to False and
consequently then invalidate loop logic as presented below:
True = False
while True:
...
On the other hand `1' will always be evaluated as a constant.
Don't know, just guessing.
Matteo
On Jan/21, Andrea
> (or figures) to return to the shell. Subsequent plots will be drawn
> automatically without issuing show(), and
> you’ll be able to plot graphs interactively.
>
> Best Regards
> Sandy
> ____
> Hotmail: Free, trusted and rich email se
o be embedded in a GUI as well.
>> > In Windows, if you’re working from interactive Python, you need only
>> > issue show() once; close the figures
>> > (or figures) to return to the shell. Subsequent plots will be drawn
>> > automatically without issuing show(), an
interactively in Python, be sure
>>> > to call the function show() after all
>>> > graphs have been generated, as it enters a user interface main loop
>>> > that will stop execution of the rest of
>>> > your code. The reason behind this behavior is that matplotlib i
dow.
>
> when the code finishes, the window closes, i do a time.sleep(10) to
> see what has happened.
>
> unfortunately when there is an error it just closes the window.
> anyway of seeing the error messages?
>
> thanks
>
> a
> --
> http://mail.python.org/ma
a single
> tuple. What I'd like is to somehow put the tuple into a NumPy array
> with each value as one element. Then I can continue to do some
> numerical processing.
>
> Any advice/help?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
t; have property x").
>
> If speed is important, the global lookups can be localized:
>
> def prttn(m, n, map=itertools.imap, int=int, str=str, range=range):
>return sum(m == sum(map(int, str(x))) for x in range(n))
>
> Raymond
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
[1,2,3,4]
>>>> b = a
>>>> c = [:]
>>>> b[0] = 5
>>>> b
> [5,2,3,4]
>>>> # here's the issue
>>>> a
> [5,2,3,4]
>>>> # and the resolution
>>>> c
> [1,2,3,4]
>
> Hope this helps.
>
> Geremy Condra
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
gt; >>> b
>> [5,2,3,4]
>> >>> # here's the issue
>> >>> a
>> [5,2,3,4]
>> >>> # and the resolution
>> >>> c
>>
>> [1,2,3,4]
>>
>> Hope this helps.
>>
>> Geremy Condra
>
> Thank you for such fast answer! I quite catch, but:
> As I see, the d[:] is equal to sentence "get the d array from the
> first to the last element"? :)
>
> P.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
7445996L)
>>>>
>
>
> So what is the right way to initialize to 0 a 2D array ? Is that way correct
> :
>
>
>>>> t=[[0 for _ in range(2)] for _ in range(3)]
>
> It seems there is no more trouble now :
>
>>>> t
> [[0, 0], [0, 0]
here, with nothing in my hands; how would you implement this?
Thanks in advance.
[1] http://www.picloud.com/
--
Matteo Landi
http://www.matteolandi.net
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote:
> Matteo Landi writes:
> > If you try and pickle a function, it is not pickled as a whole,
> > indeed, once you unpickle it, it will raise an exception telling you
> > that the target function was not found in the current m
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote:
> Matteo Landi writes:
> > If you try and pickle a function, it is not pickled as a whole,
> > indeed, once you unpickle it, it will raise an exception telling you
> > that the target function was not found in the current m
On Thu, 2010-06-17 at 08:31 -0700, Stephen Hansen wrote:
> On 6/17/10 6:23 AM, Matteo Landi wrote:
> > itself. If you try and pickle a function, it is not pickled as a whole,
> > indeed, once you unpickle it, it will raise an exception telling you
> > that the target function
doing wrong?
>
> I tried this, too:
>
>>>> class C(P):
> def __init__(self):
> super(__class__).__init__(self)
> print("I am a member of class C")
>
>
>>>> x=C()
> Traceback (most recent call last):
> File "", line 1, in
> x=C()
> File "", line 3, in __init__
> super(__class__).__init__(self)
> TypeError: must be type, not C
>>>>
>
>
>
> --
> The missionaries go forth to Christianize the savages -
> as if the savages weren't dangerous enough already.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
found there is still "\n" . Could someone help me why it is not
> correct?
>
> Thank you
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
t to do this (pseudocode):
> start_time = get_current_time;
> function();
> end_time = get_current_time;
> print (end_time - start_time)
>
> the output should be 7600 (s) for example. What is the best and easiest way
> to do that?
>
> Thanks,
>
> // Naderan *Mahmood;
>
will need
> to work on your code), but tabs allow everyone to see code indented the way
> -they- want to see it, not just the way the original author wanted to see
> it.
> This script (./this-pylint) will also save output from the test in a text
> file, for make (or other dependency handling program) to use to avoid
> re-pylint'ing unmodified code. It'll give an error typically, if pytlint
> detects any errors other than FIXME's (excluding ones, as I mentioned
> before, that have a comment disabling the warning, of course).
> I'm more than a little sad that pylint doesn't seem to be moving to python 3
> in any big hurry.
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
will normalize
> in more than one place. In fact, you may well want a vlen function.
>
> def vlen(seq): return math.sqrt(sum(x*x for x in seq))
>
> --
> Terry Jan Reedy
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
> Thank you in advance.
>
> Thanks.
> Navid
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
g/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
ally, so is definitely the way to go.
>
> http://docs.python.org/library/glob.html
>
> --
> Rory Campbell-Lange
> r...@campbell-lange.net
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
;>
>>> Any help would be awesome : )
>>>
>>> Regards,
>>> Nav
>>>
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>> This is a working code, streamlined, but it is where the problem is:
&
CTORY/DSTNTN_FILE_NAME")
>
> WTF; modules aren't callable. Typo?
I suppose he/she would have written:
shutil.copyfile("YOUR_SOURCE_FILE_NAME","DESTINATION_DIRECTORY/DSTNTN_FILE_NAME")
Cheers.
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
On Sun, Aug 1, 2010 at 12:27 PM, News123 wrote:
> 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
>> me
try), fantastic benefits and very generous relocation packages.
> Please contact me immediately with a resume!
>
> Send resumes to:
>
> Rich Moss
> r...@mossltd.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
> an integer of a negated expression. Given that Baba notes that this is
> a beginners level query, it wouldn't have hurt to be a little bit more
> verbose there.
>
> Richard
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
ry writing that
> case first, and then write the rest of it on that basis.
>
> --
> \ “Science is a way of trying not to fool yourself. The first |
> `\ principle is that you must not fool yourself, and you are the |
> _o__) easiest person to fool.” —Rich
", min(t.repeat())
>
> t = Timer("is_palindrome_reversed('madamimadam')", "from __main__
> import is_palindrome_reversed")
> print "is_palindrome_reversed", min(t.repeat())
>
> The results:
> is_palindrome_recursive 6.32680866827
> is_pali
:
while True:
if str[i] != str[j]:
return False
i, j = i + 1, j - 1
return True
except IndexError:
return True
On Sun, Aug 29, 2010 at 12:36 PM, Arnaud Delobelle
wrote:
> Matteo Landi writes:
>
>> W
pedia article about this
> subject? I imagine that it has a concise name.
>
> Thanks,
>
> Tobiah
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
;1', '2']"
>> >>>>> [int(n) for n in re.findall(r'-?\d+', s)]
>> >> [1, 2]
>> >>
>> >> An alternative is:
>> >>
>> >>>>> s = "['1', '2']"
>> >>&g
t possible to control any webbrowser from Python ? For example to
> issue http POST and GET command
> Thanks
> Johny
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
gt; Grant Edwards grant.b.edwards Yow! Oh my GOD -- the
> at SUN just fell into YANKEE
> gmail.com STADIUM!!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matte
the number
> of tries in the for loop. I need a way to handle the case where we
> run out of tries (and *haven't* done what we needed to do) separately
> from the case where it worked OK.
>
> I can see all sorts of messy ways to handle this with a flag of some
> sort but is
irst example puts the emphasis on the *technique*, not the
> variables. The second obscures it behind needlessly longer but still
> generic names.
>
> You are absolutely right to insist on meaningful variable names. Where
> you go wrong is to assume that single letter names can't be meaningful.
>
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
x27;: []}
> In [216]: rg['a'].append('x')
> In [217]: rg
> Out[217]: {'a': ['x'], 'b': ['x']}
>
> What I meant was appending 'x' to the list pointed by the key 'a' in the
> dictionary 'rg'. Why rg['b'] is written too?
>
> Thanks.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
git([1, 23, 456]) )
> # 9 9 10
>
> # Use generator expression with built-in sum function
>
> def getSumOfLastDigit(numList):
> return sum(int(str(i)[-1:]) for i in numList)
>
> print(getSumOfLastDigit([12, 23, 34]),
> getSumOfLastDigit([2, 3, 4]),
> getSumOfLastDigit([1, 23, 456]) )
> # 9 9 10
>
> --
> Terry Jan Reedy
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Matteo Landi
http://www.matteolandi.net/
--
http://mail.python.org/mailman/listinfo/python-list
46 matches
Mail list logo