On 3/23/2016 12:28 AM, Wildman via Python-list wrote:
On Wed, 23 Mar 2016 03:02:51 +, MRAB wrote:
On 2016-03-23 02:46, Wildman via Python-list wrote:
My question is how do I coax bind into executing the
button procedures? Or is there a way to generate the
button click event from the bindi
On Wed, Mar 23, 2016 at 5:07 PM, Steven D'Aprano
wrote:
> Fortunately, not all such "bugs" are of equal severity. In this case, there
> are two failure modes. Consider a *false positive* bug: we think the file
> exists when it actually doesn't.
>
> if os.path.exists(filename):
> os.unlink(file
On Wednesday 23 March 2016 09:23, Chris Angelico wrote:
> On Wed, Mar 23, 2016 at 6:43 AM, Michael Torrie wrote:
>> And despite the impression you may have gotten, it is appropriate to
>> look before you leap. Using os.exists() and other pre-flight checks are
>> appropriate.
>
> Hmm, can you jus
On Wednesday, March 23, 2016 at 9:43:21 AM UTC+5:30, Karthik Reddy wrote:
> On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote:
> > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote:
> >
> > > The error I am getting is "Uncaught ReferenceError: gapi is not defined"
> >
> >
Steven D'Aprano writes:
> On Mon, 21 Mar 2016 06:47 pm, Ben Finney wrote:
>
> > Bart can show good faith by *learning* idiomatic Python, with the
> > humility of a beginner. And also by refraining from rhetoric about
> > how bad Python's performance is, until he gains experience to make
> > those
I didn't see anyone responding to this, so I'll pop in here...
On 03/22/2016 04:05 AM, BartC wrote:
[...]
(Suppose you need both the value and its index in the loop? Then the one-line
for above won't
work. For example, 'something' is [10,20,30] and you want to print:
0: 10
1: 20
2: 30 )
On Tue, 22 Mar 2016 23:52:57 -0400, Terry Reedy wrote:
> On 3/22/2016 10:46 PM, Wildman via Python-list wrote:
>> Platform: Linux
>> Python: v.2.7.9
>> Tkinter: v.8.6.2
>>
>> My program has some buttons for file operations, load_image,
>> save_image, and quit. I would like to bind a key that will
On Wed, 23 Mar 2016 03:02:51 +, MRAB wrote:
> On 2016-03-23 02:46, Wildman via Python-list wrote:
>> My question is how do I coax bind into executing the
>> button procedures? Or is there a way to generate the
>> button click event from the binding?
>>
> It won't let you bind to a function ca
On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote:
> On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote:
>
> > The error I am getting is "Uncaught ReferenceError: gapi is not defined"
>
>
> Have you tried googling for it? That's a Javascript error:
>
> https://duckduckgo.c
On 3/22/2016 10:46 PM, Wildman via Python-list wrote:
Platform: Linux
Python: v.2.7.9
Tkinter: v.8.6.2
My program has some buttons for file operations, load_image,
save_image, and quit. I would like to bind a key that will
execute the procedures for each of the buttons. The binding
for the qui
On 2016-03-23 02:46, Wildman via Python-list wrote:
Platform: Linux
Python: v.2.7.9
Tkinter: v.8.6.2
My program has some buttons for file operations, load_image,
save_image, and quit. I would like to bind a key that will
execute the procedures for each of the buttons. The binding
for the quit
Platform: Linux
Python: v.2.7.9
Tkinter: v.8.6.2
My program has some buttons for file operations, load_image,
save_image, and quit. I would like to bind a key that will
execute the procedures for each of the buttons. The binding
for the quit button was easy...
root.bind("", quit)
root.bind("",
On Wed, Mar 23, 2016 at 12:14 PM, Steven D'Aprano wrote:
>> I mean, is a function allowed to still return True or False, or just
>> False? (Or perhaps just nothing if the exception mechanism can signal
>> either.)
>
>
> You can answer this question yourself by looking at what functions are
> provi
On Wed, 23 Mar 2016 01:02 am, BartC wrote:
> And, forgetting file input for a minute, what about function return
> values in general; should they still be allowed to return some status or
> error codes, or does it all have to be exceptions now?
It doesn't *have to* be exceptions, but exceptions a
On Wed, Mar 23, 2016 at 6:43 AM, Michael Torrie wrote:
> And despite the impression you may have gotten, it is appropriate to
> look before you leap. Using os.exists() and other pre-flight checks are
> appropriate.
Hmm, can you justify this? Remember, as soon as any other process has
done anythin
"Jonathan N. Little" wrote in message
news:ncrg2v$jo$2...@dont-email.me...
> Adam wrote:
>> Thanks, but why fix if it ain't broke?:-)
>
> No reason to.
Yup, I agree.
>
> --
> Take care,
>
> Jonathan
> ---
> LITTLE WORKS STUDIO
> http://www.LittleWorksStudio.com
--
htt
"Big Bad Bob" wrote in message
news:mp6dnavahbnh6gzlnz2dnuu7-y_nn...@earthlink.com...
> On 03/21/16 17:23, Adam so wittily quipped:
>> "Adam" wrote in message
>> news:ncprqb$tl9$1...@news.albasani.net...
>>>
>>> "Jonathan N. Little" wrote in message
>>> news:ncpjj0$7ug$1...@dont-email.me...
>>
Hi everybody,
I got another module up and running: xcache
Background described here:
http://srkunze.blogspot.com/2016/03/safe-cache-invalidation.html
We needed a way to safely invalidate rlu_caches once a Web request has
been finished. So, we came up with a solution using garbage collection
Hi ,
Please go through the below job description and let me know your interest.
Please revert me: soura...@itscient.com.
Position: BizTalk/ Consultant
Location: Princeton, NJ
Duration: 6+ Months
Skills:
* Mandatory Skill (List out all Technical Skills required along with domain
skill requir
On 03/22/2016 06:59 AM, BartC wrote:
> I'm not sure I follow. Your solution to dealing with the scenarios
> raised by Steven D'Aprano is to:
>
> (1) Not bother with exceptions at all inside the function
Correct, if your function is not equipped to handle this exceptional
circumstance and do the
On 03/21/16 17:23, Adam so wittily quipped:
> "Adam" wrote in message
> news:ncprqb$tl9$1...@news.albasani.net...
>>
>> "Jonathan N. Little" wrote in message
>> news:ncpjj0$7ug$1...@dont-email.me...
>>> Adam wrote:
There ought to be a way to just reinstall the graphics subsystem rather
>>
Now as for *why* you needed to reinstall your graphics driver... did the
graphics driver get updated before the crash? Or do we think something in
the java runtime for PyCharm ate libglx or friends?
I did find this PyCharm crash in which Java ate itself -- though didn't eat
any library files (as
On 3/22/2016 8:49 AM, Bob Gailer wrote:
On Mar 21, 2016 5:40 PM, "Peter Pearson" wrote:
i have currently installed Python,
What version, on what system?
and im Reading this book which
tells me i have to have IDLE, but i cant find it on my computer. do i
need to install it? and if so where
On Wed, Mar 23, 2016 at 2:07 AM, Jon Ribbens
wrote:
>> Due to a mistake in editing, the parentheses around the "true in
>> EVERY language" sentence were lost, which would have made it clearer
>> that this is in two distinct parts:
>>
>> 1) This IS what happens, whatever language you use
>> 2) This
On 2016-03-22, Chris Angelico wrote:
> On Wed, Mar 23, 2016 at 12:46 AM, Jon Ribbens
> wrote:
>> On 2016-03-22, Chris Angelico wrote:
>>> The first step in any program is to write it in the very simplest way
>>> possible. That usually means ignoring all error handling. And yes,
>>> this is true i
On Wed, Mar 23, 2016 at 1:02 AM, BartC wrote:
>> Note, though, that "deal with" really means "deal with", and NOT
>> "print oops to the console and terminate". If all you're going to do
>> with an exception is print and terminate, *let it go*, unless it's a
>> user-triggered failure, in which case
On Tuesday, March 22, 2016 at 12:01:10 AM UTC+5:30, Maurice wrote:
> Just figured why:
>
> If I type this on the kernel:
>
> weirdList = [[0]*3]*5
>
> weirdList
> Out[257]: [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
>
> weirdList[0][0] = 1
>
> weirdList
> Out[259]: [[1, 0, 0], [1,
On Tuesday, March 22, 2016 at 10:02:41 AM UTC-4, BartC wrote:
> On 22/03/2016 13:13, Chris Angelico wrote:
> > On Tue, Mar 22, 2016 at 11:59 PM, BartC wrote:
>
> > The first step in any program is to write it in the very simplest way
> > possible. That usually means ignoring all error handling. A
On 22/03/2016 13:13, Chris Angelico wrote:
On Tue, Mar 22, 2016 at 11:59 PM, BartC wrote:
The first step in any program is to write it in the very simplest way
possible. That usually means ignoring all error handling. And yes,
this is true in EVERY language - C, PHP, Pike, DeScribe Macro
Lang
On Wed, Mar 23, 2016 at 12:46 AM, Jon Ribbens
wrote:
> On 2016-03-22, Chris Angelico wrote:
>> The first step in any program is to write it in the very simplest way
>> possible. That usually means ignoring all error handling. And yes,
>> this is true in EVERY language - C, PHP, Pike, DeScribe Mac
On 2016-03-22, Chris Angelico wrote:
> The first step in any program is to write it in the very simplest way
> possible. That usually means ignoring all error handling. And yes,
> this is true in EVERY language - C, PHP, Pike, DeScribe Macro
> Language, you name it.
I'm afraid I have to say I thi
Chris Angelico writes:
> And yeah, the import is an option, but if I'm trying to explain stuff
> to people, it's usually easier to grab a genexp (full flexibility, but
> the complexity) than to play around with importing. When the function
> you want exists and returns true for the things you want
On Wed, Mar 23, 2016 at 12:32 AM, Jussi Piitulainen
wrote:
>> Although I do sometimes yearn for a "filterout" function that does the
>> same thing as filter() but negates its predicate. Then you could use:
>>
>> next(filterout(str.isspace, stream))
>>
>> to say "give me the next from the stream, f
Chris Angelico writes:
> On Wed, Mar 23, 2016 at 12:15 AM, Jussi Piitulainen wrote:
>> Chris Angelico writes:
>>
>>> Or use filter(), which is sometimes clearer:
>>>
>>> # You probably want a more sophisticated function here
>>> def nonspace(ch): return not ch.isspace()
>>>
>>> next(filter(nonspac
On Tue, Mar 22, 2016 at 11:57 PM, Steven D'Aprano wrote:
> Anyone have any idea what is going on here?
>
>
> def test():
> spam = 1
> exec("spam = 2; print('inside exec: %d' % spam)")
> print('outside exec: %d' % spam)
>
>
> In Python 2.7:
>
> py> test()
> inside exec: 2
> outside exec
On Mon, Mar 21, 2016 at 6:05 PM, Steven D'Aprano wrote:
> On Tue, 22 Mar 2016 04:48 am, Ian Kelly wrote:
>
>> You don't actually need a metaclass for this:
>>
> class Desc:
>> ... def __get__(self, obj, type=None):
>> ... if not type._cached_value:
>> ... type._cached_v
On Wed, Mar 23, 2016 at 12:15 AM, Jussi Piitulainen
wrote:
> Chris Angelico writes:
>
>> On Tue, Mar 22, 2016 at 11:52 PM, Jussi Piitulainen wrote:
>>> Now you can ask for the next item that satisfies a condition using a
>>> generator expression:
>>>
>>> next(symbol for symbol in stream if not sym
Chris Angelico writes:
> On Tue, Mar 22, 2016 at 11:52 PM, Jussi Piitulainen wrote:
>> Now you can ask for the next item that satisfies a condition using a
>> generator expression:
>>
>> next(symbol for symbol in stream if not symbol.isspace())
>> ---> '/'
>>
>> next(symbol for symbol in stream if
Adam wrote:
Thanks, but why fix if it ain't broke?:-)
No reason to.
--
Take care,
Jonathan
---
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 22, 2016 at 11:59 PM, BartC wrote:
> (1) Not bother with exceptions at all inside the function
>
> (2) Not bother with them in the user code either
>
> (3) Let any errors just crash out (raise a Python system error) (just like I
> did in my original jpeg program which I was called out
On Tue, Mar 22, 2016 at 11:52 PM, Jussi Piitulainen
wrote:
> Now you can ask for the next item that satisfies a condition using a
> generator expression:
>
> next(symbol for symbol in stream if not symbol.isspace())
> ---> '/'
>
> next(symbol for symbol in stream if not symbol.isspace())
> ---> '*
On 22/03/2016 11:15, Chris Angelico wrote:
On Tue, Mar 22, 2016 at 10:05 PM, BartC wrote:
But out of interest, how would /you/ write a function that takes a file-spec
and turns it into an in-memory string? And what would its use look like?
def read_file(fn, *a, **kw):
with open(fn, *a, *
Anyone have any idea what is going on here?
def test():
spam = 1
exec("spam = 2; print('inside exec: %d' % spam)")
print('outside exec: %d' % spam)
In Python 2.7:
py> test()
inside exec: 2
outside exec: 2
In Python 3.4:
outside exec: 1
py> test()
inside exec: 2
outside exec: 1
BartC writes:
> Not everything fits into a for-loop you know! Why, take my own
> readtoken() function:
>
> symbol = anything_other_than_skip_sym
>
> while symbol != skip_sym:
> symbol = readnextsymbol()
>
> Of course, a repeat-until or repeat-while would suit this better (but
> I don't kn
On Mar 21, 2016 5:40 PM, "Peter Pearson" wrote:
>
> On Mon, 21 Mar 2016 11:18:57 +, mohamed mohamud wrote:
> > hey im new at Learning Python, and i have an issue which i would like
> > som help With.
> >
> > i have currently installed Python, and im Reading this book which
> > tells me i have
On Tue, 22 Mar 2016 10:55 pm, Chris Angelico wrote:
> While we're on the subject of Pythonic ways to read files, this is NOT.
>
> http://thedailywtf.com/articles/finding-the-file
>
> It's also not idiomatic C# code either, though...
Obviously not. They should have used a switch.
I like the com
> If a method call on any instance defines the return value for
> all instances, then this method likely should be a class method --
> and use a class attribute to store the result -- something like this:
>
> class C(object):
>
> _cache = {}
>
> @classmethod
> def f(cls, ...):
>
On Tue, 22 Mar 2016 10:05 pm, BartC wrote:
> On 22/03/2016 01:01, Steven D'Aprano wrote:
>> On Tue, 22 Mar 2016 06:43 am, BartC wrote:
>>
>>> This code was adapted from a program that used:
>>>
>>> readstrfile(filename)
>>>
>>> which either returned the contents of the file as a string, or 0.
On 21.03.2016 21:42, Matt Wheeler wrote:
On 20 March 2016 at 16:46, Sven R. Kunze wrote:
On 19.03.2016 00:58, Matt Wheeler wrote:
I know you have a working solution now with updating the code &
defaults of the function, but what about just injecting your function
into the modules that had alre
On Tue, Mar 22, 2016 at 10:45 PM, Dennis Lee Bieber
wrote:
> On Tue, 22 Mar 2016 11:05:01 +, BartC declaimed the
> following:
>
>>
>>But out of interest, how would /you/ write a function that takes a
>>file-spec and turns it into an in-memory string? And what would its use
>>look like?
>>
>
On Tuesday, March 22, 2016 at 4:55:40 PM UTC+5:30, Karthik Reddy wrote:
> On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote:
> > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote:
> >
> > > The error I am getting is "Uncaught ReferenceError: gapi is not defined"
> >
> >
>
On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote:
> On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote:
>
> > The error I am getting is "Uncaught ReferenceError: gapi is not defined"
>
>
> Have you tried googling for it? That's a Javascript error:
>
> https://duckduckgo.c
On 22/03/16 11:05, BartC wrote:
On 22/03/2016 01:01, Steven D'Aprano wrote:
Pythonic code probably uses a lot of iterables:
for value in something:
...
in preference to Pascal code written in Python:
for index in range(len(something)):
value = something[index]
(Suppose you ne
On Tuesday, March 22, 2016 at 7:05:20 AM UTC-4, BartC wrote:
> On 22/03/2016 01:01, Steven D'Aprano wrote:
> > Pythonic code probably uses a lot of iterables:
> >
> > for value in something:
> > ...
>
> > in preference to Pascal code written in Python:
> >
> > for index in range(len(something
On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote:
> The error I am getting is "Uncaught ReferenceError: gapi is not defined"
Have you tried googling for it? That's a Javascript error:
https://duckduckgo.com/html/?q=uncaught+reference+error+gapi+is+not+defined
--
Steven
--
https://mail.py
On Tuesday, March 22, 2016 at 7:32:13 AM UTC+5:30, Mark Lawrence wrote:
> On 22/03/2016 00:49, BartC wrote:
> >
> > I was surprised at one time that slices don't create 'views', but I've
> > since implemented view-slices and I can appreciate the problems.)
> >
>
> Why, the docs are quite clear on
On Tue, Mar 22, 2016 at 10:05 PM, BartC wrote:
> But out of interest, how would /you/ write a function that takes a file-spec
> and turns it into an in-memory string? And what would its use look like?
def read_file(fn, *a, **kw):
with open(fn, *a, **kw) as f:
return f.read()
Usage:
On 22/03/2016 01:01, Steven D'Aprano wrote:
On Tue, 22 Mar 2016 06:43 am, BartC wrote:
This code was adapted from a program that used:
readstrfile(filename)
which either returned the contents of the file as a string, or 0.
What an interesting function. And I don't mean that in a good w
On Tue, 22 Mar 2016 12:35 pm, Paul Rubin wrote:
> Maurice writes:
>> I have a list such [6,19,19,21,21,21]
>> Therefore the resulting list should be:
>> [0,0,0,0,0,0,1,0,0,0...,2,0,3,0...0]
>
> Rather than a sparse list you'd typically want a dictionary (untested):
>
> from collections import
On Tuesday, March 22, 2016 at 9:54:53 AM UTC+5:30, Mark Lawrence wrote:
> On 22/03/2016 04:14, Karthik Reddy wrote:
> > Hi Experts,
> >
> > I am trying to post on facebook and google plus page from my application.
> > I am using facebook-sdk an d I am able to post using local machine but I am
>
On Tuesday, March 22, 2016 at 9:54:53 AM UTC+5:30, Mark Lawrence wrote:
> On 22/03/2016 04:14, Karthik Reddy wrote:
> > Hi Experts,
> >
> > I am trying to post on facebook and google plus page from my application.
> > I am using facebook-sdk an d I am able to post using local machine but I am
>
On Tuesday, March 22, 2016 at 1:58:30 PM UTC+5:30, Gabriel Forcarelli dos
Santos wrote:
> meu python não esta reconhecendo os sinais de calculos em geral, peço a
> ajuda de vocês.
Hi Gabriel,
Can you give some details
Regards,
Anant
--
https://mail.python.org/mailman/listinfo/python-list
"Joseph L. Casale" writes:
> ...
> I need to cache the results of a method on a class across all instances.
If a method call on any instance defines the return value for
all instances, then this method likely should be a class method --
and use a class attribute to store the result -- something l
I tried two kinds of ciphers "kRSA, aRSA, RSA" and "kDHE, kEDH, DH". The
later failed with handshake failure alert (observed from packet dump). For
the successful one, the chosen cipher suite is DHE-RSA-AES256-SHA which is
also included in the Client Hello message of the failed case. That's what
co
meu python não esta reconhecendo os sinais de calculos em geral, peço a
ajuda de vocês.
--
https://mail.python.org/mailman/listinfo/python-list
Matt Ruffalo writes:
> ...
> I've been using SSL for the communication between the client and server,
> ...
> I've hit an issue that I'm not sure how to work through, though. I'm
> attempting to use a SSL socket (and/or the result of its 'makefile'
> method) directly as the `stdin` argument to sub
"Jonathan N. Little" wrote in message
news:ncqd2d$pab$1...@dont-email.me...
> Adam wrote:
>> Sure glad I did not reinstall Ubuntu. Whew!!
>
> Unless you really-really-really screw things up, you usually do not have
> to. Linux is not Windows ;-) Even if you had to, with /home on its own
> par
"Jonathan N. Little" wrote in message
news:ncqc7j$na1$1...@dont-email.me...
> Adam wrote:
>> "Adam" wrote in message
>> news:ncprqb$tl9$1...@news.albasani.net...
>>>
>>> "Jonathan N. Little" wrote in message
>>> news:ncpjj0$7ug$1...@dont-email.me...
Adam wrote:
> There ought to be a w
On 22/03/2016 07:24, Marko Rauhamaa wrote:
Steven D'Aprano :
I applaud you writing different versions of code to try different
tactics, but you should start from "write the most natural Python code
you can" *before* you trying guessing what's fast and what's slow.
I'm hard-pressed to imagine
Steven D'Aprano :
> I applaud you writing different versions of code to try different
> tactics, but you should start from "write the most natural Python code
> you can" *before* you trying guessing what's fast and what's slow.
I'm hard-pressed to imagine a situation where I would write *unnatura
70 matches
Mail list logo