RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
sibly non-pythonic topic and go read another book or a few hundred so when it comes up again ... -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Saturday, March 4, 2023 5:04 PM To: python-list@python.org Subject: Re: Which more Pythonic - self.__class__ or type(self)

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Weatherby,Gerard
Nope. No consensus. I’d use self.__class__ . Seems more explicit and direct to me. From: Python-list on behalf of Ian Pilcher Date: Thursday, March 2, 2023 at 4:17 PM To: python-list@python.org Subject: Which more Pythonic - self.__class__ or type(self)? *** Attention: This is an external

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Thomas Passin
t: Saturday, March 4, 2023 1:09 PM To: python-list@python.org Subject: Re: Which more Pythonic - self.__class__ or type(self)? On 3/4/2023 2:47 AM, Peter J. Holzer wrote: Even before Python existed there was the adage "a real programmer can write FORTRAN in any language", indicating that id

RE: RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
. But I note some idioms catch on and some are imposed and some become almost moot. I am not sure which aspects of C++ have changed drastically and may go re-study the modern version as I was a very early adoptee within AT&T and saw changes even back then. But I consider something like

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
native language(s). I am sure some books along these lines have already been written! Who wants to collaborate? -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Saturday, March 4, 2023 1:26 PM To: python-list@python.org Subject: Re: Which more Pythonic - self

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
on late and found an expanding language with way too many ways to do anything and can choose. But I claim that too is pythonic! -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Saturday, March 4, 2023 1:09 PM To: python-list@python.org Subject: Re: Which more Pythonic - se

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Peter J. Holzer
On 2023-03-04 12:38:22 -0500, avi.e.gr...@gmail.com wrote: > Of course each language has commonly used idioms as C with pointer > arithmetic and code like *p++=*q++ but my point is that although I live near > a seaway and from where C originated, I am not aware of words like "c-way" > or "scenic"

Re: RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Alan Gauld
On 04/03/2023 17:38, avi.e.gr...@gmail.com wrote: > > Of course each language has commonly used idioms > That's the point, the correct term is probably "idiomatic" rather than "pythonic" but it is a defacto standard that idiomatic Python has become known as Pythonic. I don't think that's a prob

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread dn via Python-list
syntax and library alone, but there is a cultural element: People writing code in a specific language also read code by other people in that language, so they start imitating each other, just like speakers of natural languages imitate each other. Someone coming from another language will often write cod

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Thomas Passin
code in a specific language also read code by other people in that language, so they start imitating each other, just like speakers of natural languages imitate each other. Someone coming from another language will often write code which is correct but un-idiomatic, and you can often guess which lan

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
of seasoned python programmers which they would prefer, then sometimes there is a more pythonic solution by that definition. Give the same test to newbies who each came from a different language background and are just getting started, and I am not sure I care how they vote! I suggest that given a d

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Peter J. Holzer
is not governed by syntax and library alone, but there is a cultural element: People writing code in a specific language also read code by other people in that language, so they start imitating each other, just like speakers of natural languages imitate each other. Someone coming from another

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Greg Ewing via Python-list
On 4/03/23 7:51 am, avi.e.gr...@gmail.com wrote: I leave you with the question of the day. Was Voldemort pythonic? Well, he was fluent in Parseltongue, which is not a good sign. I hope not, otherwise we'll have to rename Python to "The Language That Shall Not Be Named" an

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread avi.e.gross
means you should not care about efficiency! LOL! I leave you with the question of the day. Was Voldemort pythonic? Avi -Original Message- From: Python-list On Behalf Of Alan Gauld Sent: Friday, March 3, 2023 4:43 AM To: python-list@python.org Subject: Re: Which more Pythonic - self.__class

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Ethan Furman
haven't found >>> anything that talks about which form is considered to be more Pythonic >>> in those situations where there's no functional difference. >> >> I think avoiding dunder methods is generally considered more Pythonic. Outside of writing dunder

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Chris Angelico
On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote: > > On 02/03/2023 20:54, Ian Pilcher wrote: > > Seems like an FAQ, and I've found a few things on StackOverflow that > > discuss the technical differences in edge cases, but I haven't found > > anything that talks ab

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Alan Gauld
On 02/03/2023 20:54, Ian Pilcher wrote: > Seems like an FAQ, and I've found a few things on StackOverflow that > discuss the technical differences in edge cases, but I haven't found > anything that talks about which form is considered to be more Pythonic > in those situa

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-02 Thread avi.e.gross
Subject: Re: Which more Pythonic - self.__class__ or type(self)? On 3/2/2023 5:53 PM, Greg Ewing via Python-list wrote: > On 3/03/23 9:54 am, Ian Pilcher wrote: >> I haven't found >> anything that talks about which form is considered to be more Pythonic >> in those situations w

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-02 Thread Thomas Passin
On 3/2/2023 5:53 PM, Greg Ewing via Python-list wrote: On 3/03/23 9:54 am, Ian Pilcher wrote: I haven't found anything that talks about which form is considered to be more Pythonic in those situations where there's no functional difference. In such cases I'd probably go for t

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-02 Thread Greg Ewing via Python-list
On 3/03/23 9:54 am, Ian Pilcher wrote: I haven't found anything that talks about which form is considered to be more Pythonic in those situations where there's no functional difference. In such cases I'd probably go for type(x), because it looks less ugly. x.__class__ *might* b

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-02 Thread Thomas Passin
On 3/2/2023 3:54 PM, Ian Pilcher wrote: Seems like an FAQ, and I've found a few things on StackOverflow that discuss the technical differences in edge cases, but I haven't found anything that talks about which form is considered to be more Pythonic in those situations where there'

Which more Pythonic - self.__class__ or type(self)?

2023-03-02 Thread Ian Pilcher
Seems like an FAQ, and I've found a few things on StackOverflow that discuss the technical differences in edge cases, but I haven't found anything that talks about which form is considered to be more Pythonic in those situations where there's no functional difference. Is ther

Re: Which architectures to support in a CI like Travis?

2022-09-19 Thread c . buhtz
Dear Mats, thanks for the reply. Am 19.09.2022 16:10 schrieb Mats Wichmann: Kind of unrelated to the actual question, but if you start doing anything serious under Travis you'll run out of free minutes rather quickly. My project had to just give up on it after they changed their licensing mode

Re: Which architectures to support in a CI like Travis?

2022-09-19 Thread Mats Wichmann
working on all archs. On my side (upstream) I wonder which arch I should "support" in my TravisCI configuration. I wan't to speed up travis and I want to save energy and carbon. I suspect that my Python code should run on much every platform that offers a Python interpreter. Of course

Re: Which architectures to support in a CI like Travis?

2022-09-19 Thread Martin Di Paola
ello, I am using TravisCI for my project on GitHub. The project is packaged for Debian, Ubuntu, Arch and several other distros. All this distros support multiple architectures and they have their own test machines to take care that all packages working on all archs. On my side (upstream) I wonde

Which architectures to support in a CI like Travis?

2022-09-18 Thread c.buhtz
wonder which arch I should "support" in my TravisCI configuration. I wan't to speed up travis and I want to save energy and carbon. I suspect that my Python code should run on much every platform that offers a Python interpreter. Of course there are edge cases. But they would be

RE: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread avi.e.gross
RSTUDIO but they often come with many superfluous features and lots of complexity. -Original Message- From: Python-list On Behalf Of Grant Edwards Sent: Thursday, August 4, 2022 10:35 AM To: python-list@python.org Subject: Re: Which linux distro is more conducive for learning the Python

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Grant Edwards
On 2022-08-04, Christian Heimes wrote: > Fedora is an excellent choice for Python users. Fedora 36 already comes > with Python 3.11.0b5 in its main repository. In fact you have Python > 2.7, 3.5-3.11, PyPy 2.7, PyPy 3.7-3.9, and MicroPython at your fingertips. Except that real programmers use

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Christian Heimes
On 04/08/2022 20.12, Barry wrote: Noted with thanks Kushal. Since I can download FREE copies of RHEL 9.0, I will use it then. I consider rhel 9 is an old os. I would suggest using fedora over rhel. Fedora 36 has python 3.10 and the when fedora 37 is released it will have python 3.11. And fedor

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Barry
> On 4 Aug 2022, at 09:48, Turritopsis Dohrnii Teo En Ming > wrote: > > On Thu, 4 Aug 2022 at 13:02, Kushal Kumaran wrote: >> >>> On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming >>> wrote: >>> Subject: Which linux dis

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Tobiah
On 8/3/22 19:01, Turritopsis Dohrnii Teo En Ming wrote: Subject: Which linux distro is more conducive for learning the Python programming language? You might try Pythontu. Not really. Get the distro that looks appealing to you. One won't be better than the other with regard to lea

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Grant Edwards
On 2022-08-04, Turritopsis Dohrnii Teo En Ming wrote: > Subject: Which linux distro is more conducive for learning the Python > programming language? You can learn Python on any Linux distribution. First answer this question: * Whom are you going to ask for help when you run into

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Weatherby,Gerard
d 9.x :) Just that I dunno which RHEL version is better. Is RHEL 9.0 the best out of 7.x, 8.x and 9.x? RedHat is a stable OpSys. Accordingly, it doesn't much matter which version. The general assumption is that the more recent distribution has more advanced facilities, eg improved security f

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Turritopsis Dohrnii Teo En Ming
On Thu, 4 Aug 2022 at 16:50, dn wrote: > > >> PS most of us will qualify for RedHat's Developer program[me] and free > >> copies of software. > > > > I can download free copies of RHEL 7.x, 8.x, and 9.x :) Just that I > > dunno which RHEL version is be

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread dn
>> PS most of us will qualify for RedHat's Developer program[me] and free >> copies of software. > > I can download free copies of RHEL 7.x, 8.x, and 9.x :) Just that I > dunno which RHEL version is better. Is RHEL 9.0 the best out of 7.x, > 8.x and 9.x? RedHat is a

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Turritopsis Dohrnii Teo En Ming
On Thu, 4 Aug 2022 at 13:02, Kushal Kumaran wrote: > > On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming > wrote: > > Subject: Which linux distro is more conducive for learning the Python > > programming language? > > > > Good day from Singapor

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Turritopsis Dohrnii Teo En Ming
ports a recent Python release (e.g. 3.9 or > > 3.10). > > +1 > > As a Python-learner (there's no comment about current programming > expertise), it is unlikely to make any difference which Linux distro is > used. > > Answers to such open-ended questions are usually

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Turritopsis Dohrnii Teo En Ming
On Thu, 4 Aug 2022 at 10:47, orzodk wrote: > > Turritopsis Dohrnii Teo En Ming writes: > > > noted with thanks. I have been using Linux for more than 10 years already > > Ah, if you're familiar with Redhat (RPM) based distributions, consider > Fedora as you will have access to newer versions soon

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Kushal Kumaran
On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming wrote: > Subject: Which linux distro is more conducive for learning the Python > programming language? > > Good day from Singapore, > > May I know which linux distro is more conducive for learning the &g

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread dn
a Python-learner (there's no comment about current programming expertise), it is unlikely to make any difference which Linux distro is used. Answers to such open-ended questions are usually seated in bias - which in-turn is mostly likely to be the same answer as 'which is the Linux distro *

Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Turritopsis Dohrnii Teo En Ming
Subject: Which linux distro is more conducive for learning the Python programming language? Good day from Singapore, May I know which linux distro is more conducive for learning the Python programming language? Since I have absolutely and totally FREE RHEL developer subscription (I don&#

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Turritopsis Dohrnii Teo En Ming
I actually did a Google search for "which linux distro is best for python". Link: https://www.google.com/search?q=which+linux+distro+is+best+for+python&rlz=1C1GCEA_enSG1005SG1005&sxsrf=ALiCzsYaL58MJsevR2Uc0nnWtmc7kWFbIg%3A1659580387580&ei=4y_rY

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Paul Bryan
wrote: > Subject: Which linux distro is more conducive for learning the Python > programming language? > > Good day from Singapore, > > May I know which linux distro is more conducive for learning the > Python programming language? > > Since I have absolutely and totally

Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Turritopsis Dohrnii Teo En Ming
Subject: Which linux distro is more conducive for learning the Python programming language? Good day from Singapore, May I know which linux distro is more conducive for learning the Python programming language? Since I have absolutely and totally FREE RHEL developer subscription (I don't

Re: Abstraction level at which to create SQLAlchemy ORM object

2022-02-11 Thread Loris Bennett
Hi Cameron, Cameron Simpson writes: > On 10Feb2022 14:14, Loris Bennett wrote: >>I am writing a command line program which will modify entries in a >>database and am trying out SQLAlchemy. >> >>A typical command might look like >> >> um --operati

Re: Abstraction level at which to create SQLAlchemy ORM object

2022-02-10 Thread Cameron Simpson
On 10Feb2022 14:14, Loris Bennett wrote: >I am writing a command line program which will modify entries in a >database and am trying out SQLAlchemy. > >A typical command might look like > > um --operation add --uid ada --gid coders --lang en > >Parsing the arguments I get

Abstraction level at which to create SQLAlchemy ORM object

2022-02-10 Thread Loris Bennett
Hi, I am writing a command line program which will modify entries in a database and am trying out SQLAlchemy. A typical command might look like um --operation add --uid ada --gid coders --lang en Parsing the arguments I get, ignoring the operation, a dict {uid: "ada", gid: &quo

Re: Call julia from Python: which package?

2021-12-21 Thread Dan Stromberg
Last I heard, Pypy itself will remain written in a statically typed dialect of Python that is closest to Python 2.7. However, what's written in that language includes JIT-compiled interpreters for both Python 2.x and Python 3.x. On Tue, Dec 21, 2021 at 9:15 AM Albert-Jan Roskam wrote: >Hi a

Re: Call julia from Python: which package?

2021-12-21 Thread Albert-Jan Roskam
Hi all, Thank you very much for your valuable replies! I will definitely do some tracing to see where the bottlenecks really are. It's good to know that pypy is still alive and kicking, I thought it was stuck in py2.7. I will also write a mini program during the holiday to see how th

Re: 'array.array' object has no attribute 'tostring' which 3 got it fixed?

2021-12-21 Thread Chris Angelico
On Tue, Dec 21, 2021 at 9:56 PM '2+ wrote: > > hi ;) > > got popos installed on my raspberry pi4 and it is currently running python > 3.9.7 > > i get this error when running my script: > > 'array.array' object has no attribute 'tostring' > > this bug seems to be pretty old .. how long should i be

'array.array' object has no attribute 'tostring' which 3 got it fixed?

2021-12-21 Thread '2+
hi ;) got popos installed on my raspberry pi4 and it is currently running python 3.9.7 i get this error when running my script: 'array.array' object has no attribute 'tostring' this bug seems to be pretty old .. how long should i be waiting to get it fixed with apt upgrade? or should i use oth

Re: Call julia from Python: which package?

2021-12-18 Thread Martin Di Paola
careful and double check that what you are calling is really doing what you think. About the performance, Julia is not magic. It depends on how well it was coded each package. In my case I had a good experience except with Parquet.jl which it didn't understand how to handle categories in

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
,that%20basic%20operations%20are%20fast. > > > > I should make clear here that I used the gmpy2 library in Python for > > > > the basic integer operations which is a wrapper around the same gmp > > > > library that is used by Julia. That means that the basic inte

Re: Call julia from Python: which package?

2021-12-17 Thread Chris Angelico
are currently pretty slow in Julia": > > > https://stackoverflow.com/questions/37193586/bigints-seem-slow-in-julia#:~:text=BigInts%20are%20currently%20pretty%20slow,that%20basic%20operations%20are%20fast. > > > I should make clear here that I used the gmpy2 library in Python fo

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
eem-slow-in-julia#:~:text=BigInts%20are%20currently%20pretty%20slow,that%20basic%20operations%20are%20fast. > > I should make clear here that I used the gmpy2 library in Python for > > the basic integer operations which is a wrapper around the same gmp > > library that is used by

Re: Call julia from Python: which package?

2021-12-17 Thread Chris Angelico
0fast. > I should make clear here that I used the gmpy2 library in Python for > the basic integer operations which is a wrapper around the same gmp > library that is used by Julia. That means that the basic integer > operations were being done by the same gmp library (a C library) i

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
ad. I do have a very small amount of experience using Julia. As a maintainer of SymPy I was very interested by Symbolics.jl which was created in an attempt to be faster than SymPy. I spent some time going through tutorials for Julia and making toy programs and then I tried out Symbolics.jl. I als

Re: Call julia from Python: which package?

2021-12-17 Thread Lars Liedtke
Additionally I'd like to ask, if you e.g. used pandas and numpy before you make the effort of rewriting everything. Yes python is slower than compiled languages, but especially with numpy you can make use of compiled code underneath. Of course this could mean rewriting some existing code but stay

Re: Call julia from Python: which package?

2021-12-17 Thread Dan Stromberg
On Fri, Dec 17, 2021 at 7:02 AM Albert-Jan Roskam wrote: > Hi, > > I have a Python program that uses Tkinter for its GUI. It's rather slow so > I hope to replace many or all of the non-GUI parts by Julia code. Has > anybody experience with this? Any packages you can recommend? I found three > alt

Call julia from Python: which package?

2021-12-17 Thread Albert-Jan Roskam
Hi, I have a Python program that uses Tkinter for its GUI. It's rather slow so I hope to replace many or all of the non-GUI parts by Julia code. Has anybody experience with this? Any packages you can recommend? I found three alternatives: * https://pyjulia.readthedocs.io/en/latest/usage.html#

Re: combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread hongy...@gmail.com
On Thursday, September 9, 2021 at 9:15:23 AM UTC+8, Kushal Kumaran wrote: > On Tue, Sep 07 2021 at 10:05:58 PM, "hongy...@gmail.com" > wrote: > > I've some xlsx files which include dropdown columns in them. I want to > > know whether I can combine all the li

Re: combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread Kushal Kumaran
On Tue, Sep 07 2021 at 10:05:58 PM, "hongy...@gmail.com" wrote: > I've some xlsx files which include dropdown columns in them. I want to > know whether I can combine all the lines into one xlsx file. Any hints > for doing this job with python programmatically will be high

Re: combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread Dennis Lee Bieber
On Tue, 7 Sep 2021 22:05:58 -0700 (PDT), "hongy...@gmail.com" declaimed the following: >I've some xlsx files which include dropdown columns in them. I want to know >whether I can combine all the lines into one xlsx file. Any hints for doing >this job with python program

combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread hongy...@gmail.com
I've some xlsx files which include dropdown columns in them. I want to know whether I can combine all the lines into one xlsx file. Any hints for doing this job with python programmatically will be highly appreciated. Regards, HY -- https://mail.python.org/mailman/listinfo/python-list

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-20 Thread Hope Rouselle
gt;>>>> subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] >>>>> sliceop: ':' [test] >>> >>>> >>>>This is looking less readable, so, no, I prefer that previous, which was >>>

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-20 Thread Hope Rouselle
test | [test] ':' [test] [sliceop] >>>> sliceop: ':' [test] >> >>> >>>This is looking less readable, so, no, I prefer that previous, which was >>>much clearer about slices. I can't even quite make the slices

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-20 Thread Hope Rouselle
t; sliceop: ':' [test] > >> >>This is looking less readable, so, no, I prefer that previous, which was >>much clearer about slices. I can't even quite make the slices out in >>these rules. (But thanks for the opportunity to try.) > > The last part of &

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-16 Thread Dennis Lee Bieber
On Sun, 15 Aug 2021 00:05:29 -0300, Jack Brandom declaimed the following: >Dennis Lee Bieber writes: > >> subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] >> sliceop: ':' [test] > >This is looking less read

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-16 Thread Jack Brandom
ler: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME > subscriptlist: subscript (',' subscript)* [','] > subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] > sliceop

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-13 Thread Michael F. Stemper
On 11/08/2021 20.17, dn wrote: I've been trying to remember if we had negative-steps in FORTRAN do-loops My text for Fortran 77 (the last version that I ever used) says that negative increments are supported. Ref: _FORTRAN 77: Language and Style_; Michael J. Merchant; Wadsworth Publishing Co

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-12 Thread Dennis Lee Bieber
On Thu, 12 Aug 2021 13:17:32 +1200, dn via Python-list declaimed the following: >I've been trying to remember if we had negative-steps in FORTRAN >do-loops especially once the capability to define subscripting-ranges >came 'in' (but can't be bothered researching further). If it was >available, o

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 10.32, Dennis Lee Bieber wrote: > On Wed, 11 Aug 2021 11:59:11 -0300, Jack Brandom > declaimed the following: >> Where are these production rules coming from? They're not at >> https://docs.python.org/3/reference/grammar.html >> The word ``stride'' doesn't appear in this grammar.

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 02.59, Jack Brandom wrote: > dn writes: > ... >> Also, whereas I prefer to illustrate 'how it works', I perceive that you >> are used to learning 'rules' and only thereafter their application (the >> teaching-practice under which mos

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread Dennis Lee Bieber
On Wed, 11 Aug 2021 11:59:11 -0300, Jack Brandom declaimed the following: > >Where are these production rules coming from? They're not at > > https://docs.python.org/3/reference/grammar.html > >The word ``stride'' doesn't appear in this grammar. > Possibly from older versions of the g

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread Jack Brandom
lt is thus somewhat lacking in flow. > Also, whereas I prefer to illustrate 'how it works', I perceive that you > are used to learning 'rules' and only thereafter their application (the > teaching-practice under which most of us learned) - so, another reason > for mix

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-10 Thread dn via Python-list
ow it works', I perceive that you are used to learning 'rules' and only thereafter their application (the teaching-practice under which most of us learned) - so, another reason for mixing-things-up, to suit yourself (hopefully). TLDR; if you are a Python-Master there's unlikely to be

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-10 Thread Hope Rouselle
Chris Angelico writes: > On Tue, Aug 10, 2021 at 7:24 AM Jack Brandom wrote: >> >> Greg Ewing writes: >> >> > On 6/08/21 12:00 pm, Jack Brandom wrote: >> >> It seems >> >> that I'd begin at position 3 (that's "k" whi

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-09 Thread Chris Angelico
On Tue, Aug 10, 2021 at 7:24 AM Jack Brandom wrote: > > Greg Ewing writes: > > > On 6/08/21 12:00 pm, Jack Brandom wrote: > >> It seems > >> that I'd begin at position 3 (that's "k" which I save somewhere), then I > >> subtract

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-09 Thread Jack Brandom
Greg Ewing writes: > On 6/08/21 12:00 pm, Jack Brandom wrote: >> It seems >> that I'd begin at position 3 (that's "k" which I save somewhere), then I >> subtract 1 from 3, getting 2 (that's "c", which I save somewhere), then >> I sub

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-07 Thread Greg Ewing
On 6/08/21 12:00 pm, Jack Brandom wrote: It seems that I'd begin at position 3 (that's "k" which I save somewhere), then I subtract 1 from 3, getting 2 (that's "c", which I save somewhere), then I subtract 1 from 2, getting 1 (that's "a", .

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Chris Angelico
On Sat, Aug 7, 2021 at 5:22 AM Boris Dorestand wrote: > > Jach Feng writes: > > >> > s = "Jack Brandom" > >> > s[3 : -13 : -1] > >> >> 'kcaJ' > >> >> I have no idea how to replace that -13 with a positive index. Is it > >> >> possible at all? > > That's not possible because a positive ind

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Boris Dorestand
#x27;s not possible because a positive index is relative to the leftmost item > 0 And the middle index is always exclusive, so we can't go to the left of 0 and remain positive. Okay, I think that answers it. It's not possible at all. > Below is some rules of slice usage which I co

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Jach Feng
> >>>>> s = "Jack Brandom" > >>>>> s[3 : -13 : -1] > >> 'kcaJ' > >> I have no idea how to replace that -13 with a positive index. Is it > >> possible at all? That's not possible because a positive index

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Jack Brandom
13 : -1] >> 'kcaJ' >> I have no idea how to replace that -13 with a positive index. Is it >> possible at all? > > I don't think so, because the second number (in this case -13) is the > index before which you stop. So, can you write a procedure that impleme

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Michael F. Stemper
r (in this case -13) is the index before which you stop. For example: >>> s 'Jack Brandom' >>> s[3:0:-1] 'kca' >>> s[3:1:-1] 'kc' >>> However, since you want to go through item 0 in the original string, you don't need a nu

on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Jack Brandom
For instance, I can reverse a "Jack" this way: >>> s = "Jack Brandom" >>> s[3 : -13 : -1] 'kcaJ' I have no idea how to replace that -13 with a positive index. Is it possible at all? But this example gives me the idea that perhaps each slice is e

Async telnet, which package and how?

2021-04-16 Thread Zoran
Hi, I have to asynchronously connect to many home routers with telnet protocol in order to get some values. Upon getting input data (ip, username, password), I should connect to the router, execute commands, get their results, postprocess results and finally return certain values. Everything

Re: Control stript which is runing in background.

2021-01-02 Thread Greg Ewing
On 3/01/21 12:30 am, Alan Bawden wrote: So as long as the OP's commands are no longer than 512 bytes, and as long as they are careful to send commands in a single call to write(), Also note that's one write() system call, which may or may not correspond to one Python write() call

Re: Control stript which is runing in background.

2021-01-02 Thread Alan Bawden
of the file status flags is set. > > > ... Just to make sure I wasn't missing > something, I tested your exact command before I sent my previous reply. > They mixed. > This is really strange. On which system did you test? unix, linux or a surro

Re: Control stript which is runing in background.

2021-01-02 Thread jak
PS: difference starts after 64K block -- https://mail.python.org/mailman/listinfo/python-list

Re: Control stript which is runing in background.

2021-01-02 Thread jak
Il 02/01/2021 01:07, Alan Bawden ha scritto: jak writes: Il 01/01/2021 06:23, Alan Bawden ha scritto: > jak writes: > > Running the command: > > $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe > > the three texts do not

Re: Control stript which is runing in background.

2021-01-02 Thread jak
> cmdpipe the three texts do not mix Saying it again doesn't make it any more true. If bible.txt is large enough, they most definitely DO mix! Just to make sure I wasn't missing something, I tested your exact command before I sent my previous reply. They mixed. T

Re: Control stript which is runing in background.

2021-01-01 Thread Alan Bawden
jak writes: Il 01/01/2021 06:23, Alan Bawden ha scritto: > jak writes: > > Running the command: > > $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe > > the three texts do not mix > > The three texts do not mix as long a

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 21:41:24 +0100, jak wrote: > Sorry if I made you argumentative ... And I didn't mean to be argumentative. :-) We both offered alternatives, and we both argued for them (in the sense of claiming that our own ideas were good). Each solution is better, depending on certain detai

Re: Control stript which is runing in background.

2021-01-01 Thread Cameron Simpson
On 01Jan2021 03:43, jak wrote: >Maybe the fact that I'm not English and I don't know the language well >doesn't allow me to express myself clearly. Try it one more time: >The OP would like to give some command to a script that is running. How? >With a script that sends commands to it. One of the w

Re: Control stript which is runing in background.

2021-01-01 Thread jak
the main script to create a popup window with an image or a plot. What would be the proper way to approach it. How to make communication between two scripts? Thank you. Petro. I have suggested an alternative way for his necessity. It will be up to him to decide which one he should adopt. Th

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
> > scripts or from the python shell. > > From time to time I would ask the main script to create a popup window with > > an image or a plot. > > What would be the proper way to approach it. How to make communication > > between two scripts? > > Thank you. >

Re: Control stript which is runing in background.

2021-01-01 Thread jak
Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto: On 2021-01-01 at 03:43:43 +0100, Regarding "Re: Control stript which is runing in background.," jak wrote: Il 01/01/2021 01:43, Cameron Simpson ha scritto: On 01Jan2021 01:21, jak wrote: Il 01/01/2021 00:58, 2qd

Re: Control stript which is runing in background.

2021-01-01 Thread jak
Il 01/01/2021 06:23, Alan Bawden ha scritto: jak writes: Running the command: $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe the three texts do not mix The three texts do not mix as long at the contents of bible.txt is short enough (and provide

Re: Control stript which is runing in background.

2020-12-31 Thread Alan Bawden
jak writes: Running the command: $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe the three texts do not mix The three texts do not mix as long at the contents of bible.txt is short enough (and provided `cat' only calls `write' once). In the POSIX spe

  1   2   3   4   5   6   7   8   9   10   >