On Fri, 17 Aug 2018 08:31:22 +1000
Cameron Simpson wrote:
> Just looking at your loop I would be inclined to just call flush once
> at the bottom, _before_ the sleep() call:
>
> sys.stdout.flush()
>
> Your call; the performance difference will be small, so it tends to
> come down to keeping y
Steven D'Aprano :
> On Sun, 19 Aug 2018 00:11:30 +0300, Marko Rauhamaa wrote:
>
>> In Python programming, I mostly run into closures through inner classes
>> (as in Java).
>
> Inner classes aren't closures.
At least some of the methods of inner classes are closures (or there
would be no point to
Chris Angelico :
> On Sun, Aug 19, 2018 at 9:03 AM, Marko Rauhamaa wrote:
>> Chris Angelico :
>>
>>> *headscratch*
>>>
>>> So this is okay:
>>>
>>> def f():
>>> for i in range(5):
>>> def g(): ...
>>>
>>> But this isn't:
>>>
>>> class C:
>>> for i in range(5):
>>> def m(sel
richard lucassen :
> As I'm new to Python, just this question: are there any unPythony
> things in this code?
Your code looks neat.
> except IOError:
> print ("[ALERT] I/O problem device 0x%x" % list_pcf[i])
Just double check that simply printing the alert is the correct recovery
f
On 19Aug2018 09:32, richard lucassen wrote:
This is a working script I made. It initializes the I/O expanders, then
it waits for an INT from these I/O expanders on GPIO23, reads the
contents and sends which bit on which chip went up or down to a fifo
(and stdout for logging)
As I'm new to Pytho
Thank you MRAB!
Now I can get the corresponding dictionary value A[i,j,k,l] for each key in the
varsdict dictionary.
However how would I go about multiplying the value of each FEq_(i,_j,_k,_l) key
with the A[i,j,k,l] one? Do you have any insight in that?
--
https://mail.python.org/mailman/list
On Sunday, August 19, 2018 at 3:53:39 AM UTC+2, Steven D'Aprano wrote:
>
> Unless you edit your code with Photoshop, why do you think a JPEG is a
> good idea?
>
> That discriminates against the blind and visually impaired, who can use
> screen-readers with text but can't easily read text insid
On Sun, 19 Aug 2018 11:43:44 +0300, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> On Sun, 19 Aug 2018 00:11:30 +0300, Marko Rauhamaa wrote:
>>
>>> In Python programming, I mostly run into closures through inner
>>> classes (as in Java).
>>
>> Inner classes aren't closures.
>
> At least some of
On Sun, 19 Aug 2018 03:15:32 -0700, giannis.dafnomilis wrote:
> Thank you MRAB!
>
> Now I can get the corresponding dictionary value A[i,j,k,l] for each key
> in the varsdict dictionary.
>
> However how would I go about multiplying the value of each
> FEq_(i,_j,_k,_l) key with the A[i,j,k,l] one
On Sun, 19 Aug 2018 03:35:24 -0700, giannis.dafnomilis wrote:
> On Sunday, August 19, 2018 at 3:53:39 AM UTC+2, Steven D'Aprano wrote:
[...]
>> If you know absolutely for sure that the key format is ALWAYS going to
>> be 'FEq_()' then you can extract the fields using slicing, like
>> this:
>>
>>
On 2018-08-18 09:40 PM, Larry Martell wrote:
> https://imgur.com/gallery/tW1lwEl
I think I have met the people who studied those books.
--
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:da...@vex.net VoIP: sip:da...@vybenetworks.com
--
https://mail.python.org/mailman/listin
> Do you want to modify the varsdict values in place?
>
> varsdict['Feq_(i,_j,_k,_l)'] *= A[i,j,k,l]
>
> which is a short-cut for this slightly longer version:
>
> temp = varsdict['Feq_(i,_j,_k,_l)'] * A[i,j,k,l]
> varsdict['Feq_(i,_j,_k,_l)'] = temp
>
>
>
> If you want to leave the origina
Steven D'Aprano :
> On Sun, 19 Aug 2018 11:43:44 +0300, Marko Rauhamaa wrote:
>> At least some of the methods of inner classes are closures (or there
>> would be no point to an inner class).
>
> [...]
>
> (2) Whether or not the methods of an inner class are closures depends on
> the methods, not
On Sunday, August 19, 2018 at 1:42:29 PM UTC+2, Steven D'Aprano wrote:
> On Sun, 19 Aug 2018 03:15:32 -0700, giannis.dafnomilis wrote:
>
> > Thank you MRAB!
> >
> > Now I can get the corresponding dictionary value A[i,j,k,l] for each key
> > in the varsdict dictionary.
> >
> > However how would
On Sun, Aug 19, 2018 at 10:28 PM, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> On Sun, 19 Aug 2018 11:43:44 +0300, Marko Rauhamaa wrote:
>>> At least some of the methods of inner classes are closures (or there
>>> would be no point to an inner class).
>>
>> [...]
>>
>> (2) Whether or not the met
On Sun, 19 Aug 2018 19:53:04 +1000
Cameron Simpson wrote:
[Oops, apparently you set the Reply-To to python-list@python.org,
normally that's no problem, but I did something wrong somewhere]
> There are always unPythonic bits. Even after you've cleaned them all
> up, since people will disagree abo
Chris Angelico :
> On Sun, Aug 19, 2018 at 10:28 PM, Marko Rauhamaa wrote:
>> The most useful use of inner classes is something like this:
>>
>> class Outer:
>> def method(self):
>> outer = self
>>
>> class Inner:
>> def spam(self, a, b):
>>
On Sun, 19 Aug 2018 12:02:51 +0300
Marko Rauhamaa wrote:
> richard lucassen :
> > As I'm new to Python, just this question: are there any unPythony
> > things in this code?
>
> Your code looks neat.
Well, apparently there were quite a lot of things that makes the code
more readable I'd say. And
On Sun, Aug 19, 2018 at 9:56 AM richard lucassen
wrote:
>
> On Sun, 19 Aug 2018 12:02:51 +0300
> Marko Rauhamaa wrote:
>
> > richard lucassen :
> > > As I'm new to Python, just this question: are there any unPythony
> > > things in this code?
> >
> > Your code looks neat.
>
> Well, apparently the
On Sun, Aug 19, 2018 at 11:54 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>> 2) You can't identify these objects as being of the same type (since
>> they're not).
>
> That's a feature, not a bug. Type membership checking goes against
> duck-typing.
Oh, so it would be better for Python if every i
On Saturday 18 August 2018 21:40:25 Larry Martell wrote:
> https://imgur.com/gallery/tW1lwEl
Larry;
Here, it loaded very slow and the central window is empty. Was there
supposed to be content? Or is my firefox busted?
--
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of l
On Sun, 19 Aug 2018 19:53:04 +1000
Cameron Simpson wrote:
> There are always unPythonic bits. Even after you've cleaned them all
> up, since people will disagree about the finer points of Pythonicism
> there will be bits both over and under cleaned.
Although I do not understand what zip is doing
Hi Team,
I am newbie to Python and glad to be part of the team. Sorry for starting
with a help.
Working on a creating a small information form ..and encountering issues
when trying to edit the details using Python Flask and MYSQL DB.
Placed the code below for your reference. Please help to fix t
On Sun, 19 Aug 2018 10:11:08 -0400
Joel Goldstick wrote:
> > Well, apparently there were quite a lot of things that makes the
> > code more readable I'd say. And even better. But it was indeed not
> > very unPythony. OTOH, I'm not a programmer, otherwise I would have
> > written this in C ;-)
>
On 2018-08-19 15:41, Suman Mupparapu wrote:
Hi Team,
I am newbie to Python and glad to be part of the team. Sorry for starting
with a help.
Working on a creating a small information form ..and encountering issues
when trying to edit the details using Python Flask and MYSQL DB.
Placed the code
On Sun, Aug 19, 2018 at 12:16 PM Richard Lucassen
wrote:
>
> On Sun, 19 Aug 2018 10:11:08 -0400
> Joel Goldstick wrote:
>
> > > Well, apparently there were quite a lot of things that makes the
> > > code more readable I'd say. And even better. But it was indeed not
> > > very unPythony. OTOH, I'm
On Sun, 19 Aug 2018 12:37:18 -0400
Joel Goldstick wrote:
> > I'll have another look at it, I was just searching for a clear
> > explanation, but the page I found was not clear enough for me. I'll
> > have to take some time for it...
>
> try python.org tutorial, and search for terms like names, o
Hello,
i just installed bottle and flask web frameworks in my CentOS environment but i
canno get it working even with the simpleste xample. The coonection is refused
always.
from bottle import route, run, template
@route('/hello/')
def index(name):
return template('Hello {{name}}!', name=n
On 19Aug2018 18:10, richard lucassen wrote:
On Sun, 19 Aug 2018 10:11:08 -0400
Joel Goldstick wrote:
Your allusion to pointers is misguided. Python is not like C or
assembler. You don't, and don't need to know where objects are
stored. Names are assigned to reference data objects
I'll hav
On Mon, Aug 20, 2018 at 7:55 AM, Cameron Simpson wrote:
> Draw little boxes with arrows. It helps. - Michael J. Eager
Draw good boxes. - DeviCat
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 19Aug2018 15:09, richard lucassen wrote:
On Sun, 19 Aug 2018 19:53:04 +1000
Cameron Simpson wrote:
Although I do not understand what zip is doing exactly here (I presume
I switch to use pointers instead of the values),
Someone else has descibed zip tersely: it pairs it the elements of 2 li
On Sun, Aug 19, 2018, 1:47 PM Νίκος wrote:
> Hello,
>
> i just installed bottle and flask web frameworks in my CentOS environment
> but i canno get it working even with the simpleste xample. The coonection
> is refused always.
>
> from bottle import route, run, template
>
> @route('/hello/')
> de
Chris Angelico :
> On Sun, Aug 19, 2018 at 11:54 PM, Marko Rauhamaa wrote:
>>> 3) Every invocation of method() has to execute the class body, which
>>> takes time.
>>
>> That's what happens with every method invocation in Python regardless.
>
> No. You have to execute the *class body*. Every meth
When I write bytes to stdout, why are they reversed?
[steve@ando ~]$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump
000 84fd 0804 000a
005
[steve@ando ~]$ python3.5 -c "import sys; sys.stdout.buffer.write(b'\xfd
\x84\x04\x08\n')" | hexdump
000 84fd 0804 000a
005
--
Steven
On Sun, 19 Aug 2018 05:29:46 -0700, giannis.dafnomilis wrote:
> With your help I have arrived at this point: I have the dictionary
> varsdict (size 5) as below
>
> KeyTypeSize Value
> FEq_(0,_0,_0,_0) float11.0
> FEq_(0,_0,_1,_1)
On 2018-08-20, Steven D'Aprano wrote:
> When I write bytes to stdout, why are they reversed?
>
> [steve@ando ~]$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump
> 000 84fd 0804 000a
> 005
They aren't. You're being fooled by the default output format of
hexdump. By default, it displa
On Mon, Aug 20, 2018 at 10:31 AM, Steven D'Aprano
wrote:
> When I write bytes to stdout, why are they reversed?
>
> [steve@ando ~]$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump
> 000 84fd 0804 000a
> 005
>
> [steve@ando ~]$ python3.5 -c "import sys; sys.stdout.buffer.write(b'\xfd
> \
On 20Aug2018 00:31, Steven D'Aprano
wrote:
When I write bytes to stdout, why are they reversed?
[steve@ando ~]$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump
000 84fd 0804 000a
005
[steve@ando ~]$ python3.5 -c "import sys; sys.stdout.buffer.write(b'\xfd
\x84\x04\x08\n')" | hexdum
On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
> When I write bytes to stdout, why are they reversed?
Answer: they aren't, use hexdump -C.
Thanks to all replies!
--
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson
--
h
On 2018-08-20, Steven D'Aprano wrote:
> On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
>
>> When I write bytes to stdout, why are they reversed?
>
> Answer: they aren't, use hexdump -C.
One might think that dumping out bytes in the correct order ought to
be the default format for hexd
On Mon, Aug 20, 2018 at 11:12 AM, Grant Edwards
wrote:
> On 2018-08-20, Steven D'Aprano wrote:
>> On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
>>
>>> When I write bytes to stdout, why are they reversed?
>>
>> Answer: they aren't, use hexdump -C.
>
> One might think that dumping out
On 2018-08-20, Chris Angelico wrote:
> On Mon, Aug 20, 2018 at 11:12 AM, Grant Edwards
> wrote:
>> On 2018-08-20, Steven D'Aprano wrote:
>>> On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
>>>
When I write bytes to stdout, why are they reversed?
>>>
>>> Answer: they aren't, use he
Grant Edwards writes:
> On 2018-08-20, Steven D'Aprano wrote:
>> On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
>>
>>> When I write bytes to stdout, why are they reversed?
>>
>> Answer: they aren't, use hexdump -C.
>
> One might think that dumping out bytes in the correct order ought
On Mon, Aug 20, 2018 at 11:31 AM, Grant Edwards
wrote:
> On 2018-08-20, Chris Angelico wrote:
>> On Mon, Aug 20, 2018 at 11:12 AM, Grant Edwards
>> wrote:
>>> On 2018-08-20, Steven D'Aprano wrote:
On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
> When I write bytes to st
On 2018-08-20, Ben Bacarisse wrote:
> Grant Edwards writes:
>
>> On 2018-08-20, Steven D'Aprano wrote:
>>> On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
>>>
When I write bytes to stdout, why are they reversed?
>>>
>>> Answer: they aren't, use hexdump -C.
>>
>> One might think t
On Mon, Aug 20, 2018 at 12:01 PM, Grant Edwards
wrote:
> On 2018-08-20, Ben Bacarisse wrote:
>> Grant Edwards writes:
>>
>>> On 2018-08-20, Steven D'Aprano wrote:
On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote:
> When I write bytes to stdout, why are they reversed?
Suman Mupparapu writes:
> Working on a creating a small information form ..and encountering issues
> when trying to edit the details using Python Flask and MYSQL DB.
>
> Placed the code below for your reference. Please help to fix this issue.
> Let me know if you need any other details from my end
Νίκος writes:
> i just installed bottle and flask web frameworks in my CentOS environment but
> i canno get it working even with the simpleste xample. The coonection is
> refused always.
"connection refused" is an indication that there is no (running)
server at the connection port.
Unlike simp
If you're trying to access the machine from another machine, you need to change
the host to '0.0.0.0'. 'localhost' is the internal interface.
On Sunday, August 19, 2018 at 10:36:25 PM UTC+3, Νίκος wrote:
> Hello,
>
> i just installed bottle and flask web frameworks in my CentOS environment but
49 matches
Mail list logo