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

2021-08-20 Thread Hope Rouselle
Hope Rouselle writes: > Hope Rouselle writes: > >> Dennis Lee Bieber writes: >> >>> On Sun, 15 Aug 2021 00:05:29 -0300, Jack Brandom >>> declaimed the following: >>> Dennis Lee Bieber writes: >>> > subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] > sliceop: ':' [te

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

2021-08-20 Thread Hope Rouselle
Hope Rouselle writes: > Dennis Lee Bieber writes: > >> 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 re

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

2021-08-20 Thread Hope Rouselle
Dennis Lee Bieber writes: > 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 readable, so, no, I prefer that previous

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 readable, so, no, I prefer that previous, which was >much clearer about slices.

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

2021-08-16 Thread Jack Brandom
Dennis Lee Bieber writes: > 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-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
if you can call it that) >> The above rules describing an index do not apply to a slice's "start", >> "stop", or "step" values! The documentation expresses: >> >> proper_slice ::= [lower_bound] ":" [upper_bound] [ "

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
e one of the > web.refs (offered below) "If i or j is negative, the index is relative > to the end of sequence s: len(s) + i or len(s) + j is substituted. But > note that -0 is still 0." > > Clear as mud? Please continue... > > >> But this example gives me the idea

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

2021-08-10 Thread dn via Python-list
0." Clear as mud? Please continue... > But this example gives me the idea that perhaps each slice is equivalent > to a certain loop (which I could write in a procedure). So I'm looking > for these procedures. If I can have the procedures in mind, I think I > will be able

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" which I save somewhere), then I >> >> subtract 1 from 3, getting 2 (that's "c", wh

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 1 from 3, getting 2 (that's "c", which I save somewhere), then > >> I

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 subtract 1 from 2, getting 1 (that's "a", ...), then I subtract 1 f

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", ...), then I subtract 1 from 1, getting 0 (that's J, ...),

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
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 index is relative to the leftmost item > 0 And the middle index is al

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 is relative to the leftmost item 0 Below is some rules of slice usage which I collected so

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

2021-08-06 Thread Jack Brandom
"Michael F. Stemper" writes: > On 05/08/2021 12.35, Jack Brandom wrote: >> The FAQ at >>https://docs.python.org/3/faq/programming.html#what-s-a-negative-index >> makes me think that I can always replace negative indices with >> positive >> ones --- even in slices, although the FAQ seems not t

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

2021-08-06 Thread Michael F. Stemper
On 05/08/2021 12.35, Jack Brandom wrote: The FAQ at https://docs.python.org/3/faq/programming.html#what-s-a-negative-index makes me think that I can always replace negative indices with positive ones --- even in slices, although the FAQ seems not to say anything about slices. With slices, i

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

2021-08-06 Thread Jack Brandom
quivalent to a certain loop (which I could write in a procedure). So I'm looking for these procedures. If I can have the procedures in mind, I think I will be able to undersand slices without getting surprised. Do you have these procedures from the top of your mind? While I haven't

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Chris Angelico
On Sun, Jul 31, 2016 at 4:40 PM, Steven D'Aprano wrote: >> While neither is a syntax error, the latter is definitely a run-time >> error: >> > mylist.sort().reverse() >> Traceback (most recent call last): >> File "", line 1, in >> AttributeError: 'NoneType' object has no attribute 'reverse'

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Rustom Mody
> > >> mylist = mylist.sort() > >> > >> or try to write: > >> > >> mylist.sort().reverse() > >> > >> If we had procedures, that would be an obvious error (possibly even a > >> compile-time syntax error) instead of a perp

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Steven D'Aprano
On Sun, 31 Jul 2016 02:01 pm, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 13:32:16 +1000 > Steven D'Aprano wrote: >> Many beginners make the mistake of writing: >> >> mylist = mylist.sort() >> >> or try to write: >> >> mylist.sort

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Random832
On Sun, Jul 31, 2016, at 00:01, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 13:32:16 +1000 > Steven D'Aprano wrote: > > Many beginners make the mistake of writing: > > > > mylist = mylist.sort() > > > > or try to write: > > > > m

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Chris Angelico
east that's the theory. In practice its not > quite cut and dried. Procedures are for things which purely operate by > side-effect: they're verbs, doing words: That's all very well in theory, but as you say, it's far from cut and dried. Taking the example that started all this

Re: Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread D'Arcy J.M. Cain
On Sun, 31 Jul 2016 13:32:16 +1000 Steven D'Aprano wrote: > Many beginners make the mistake of writing: > > mylist = mylist.sort() > > or try to write: > > mylist.sort().reverse() > > If we had procedures, that would be an obvious error (possibly even a > co

Procedures and functions [was Re: Why not allow empty code blocks?]

2016-07-30 Thread Steven D'Aprano
On Sun, 31 Jul 2016 12:17 pm, Chris Angelico wrote: > Yeah. The distinction means you have a fundamental API difference > between the procedures (which don't return anything) and the functions > (whose return values you mightn't care about). Correct. > It means you can&

Re: Using jython to call python procedures/methods

2010-01-20 Thread bobicanprogram
uot;native" python routine > where I have the numpy/scipy procedures already written. > > Does anyone have any experience with this? Is it possible? > > I had toyed with the idea of having jython/java write the data to a > file/database and then manually kick off the p

Re: Using jython to call python procedures/methods

2010-01-20 Thread M.-A. Lemburg
thon routine > where I have the numpy/scipy procedures already written. > > Does anyone have any experience with this? Is it possible? > > I had toyed with the idea of having jython/java write the data to a > file/database and then manually kick off the python process, but >

Re: Using jython to call python procedures/methods

2010-01-20 Thread KB
Hmmm, XML is an interesting angle... I'll noodle it... -- http://mail.python.org/mailman/listinfo/python-list

Re: Using jython to call python procedures/methods

2010-01-20 Thread Kurt Smith
jython call a "native" python routine > where I have the numpy/scipy procedures already written. > > Does anyone have any experience with this? Is it possible? I have no experience with these technologies, and others can point you to more detailed info, but you could try using XML-RP

Using jython to call python procedures/methods

2010-01-20 Thread KB
Hi there, I have an application that only publishes a Java API. I can use jython to access java classes, but jython currently (to the best of my knowledge) does not support numpy/scipy. Ideally I would like to have jython call a "native" python routine where I have the numpy/scipy

Re: Procedures

2009-06-23 Thread J. Cliff Dyer
> >> "scene 1, pnl 1, 3+8, pnl 2, 1+12, pnl 3, 12, pnl 4, 2+4," > >> > >> I'm parsing the string by finding the commas, and pulling out the > >> data between them. > >> No problem so far (I think...) The trouble is, there is a place >

Re: Procedures

2009-06-22 Thread Dave Angel
Greg Reyna wrote: Learning Python (on a Mac), with the massive help of Mark Lutz's excellent book, "Learning Python". What I want to do is this: I've got a Class Object that begins with a def. It's designed to be fed a string that looks like this: "scene 1, pnl 1, 3+8, pnl 2, 1+12, pnl 3,

Re: Procedures

2009-06-22 Thread J. Cliff Dyer
; elements ['scene 1', ' pnl 1', ' 3+8', ' pnl 2', ' 1+12', ' pnl 3', ' 12', ' pnl 4', ' 2+4', ''] >>> elements[2] ' 3+8' > In my previous experience (with a non-OOP language), I co

Procedures

2009-06-22 Thread Greg Reyna
Learning Python (on a Mac), with the massive help of Mark Lutz's excellent book, "Learning Python". What I want to do is this: I've got a Class Object that begins with a def. It's designed to be fed a string that looks like this: "scene 1, pnl 1, 3+8, pnl 2, 1+12, pnl 3, 12, pnl 4, 2+4," I'

Re: adodbapi and output parameters in stored procedures

2008-11-08 Thread M.-A. Lemburg
On 2008-11-07 17:32, [EMAIL PROTECTED] wrote: > Thanks for that excellent pointer! > > I was able to do just what you said with > > But if my procedure has an insert statement in its midst, it doesn't > work. The cursor.fetchall() gets an exception. > Any ideas? Try this (I haven't checked that

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I need some help getting output values from my stored procedures when > using adodbapi. There's an example > testVariableReturningStoredProcedure in adodbapitest.py, and that > works for my sys

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread leesquare
Thanks for that excellent pointer! I was able to do just what you said with But if my procedure has an insert statement in its midst, it doesn't work. The cursor.fetchall() gets an exception. Any ideas? --Li -- http://mail.python.org/mailman/listinfo/python-list

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread M.-A. Lemburg
On 2008-11-07 15:04, [EMAIL PROTECTED] wrote: > Hello, > > I need some help getting output values from my stored procedures when > using adodbapi. There's an example > testVariableReturningStoredProcedure in adodbapitest.py, and that > works for my system. But my stored

adodbapi and output parameters in stored procedures

2008-11-07 Thread leesquare
Hello, I need some help getting output values from my stored procedures when using adodbapi. There's an example testVariableReturningStoredProcedure in adodbapitest.py, and that works for my system. But my stored procedure also inserts and accesses a table in the database. Here's w

pymssql stored procedures - NEW THREAD

2008-10-21 Thread Aspersieman
On Tue, 21 Oct 2008 20:44:24 +0200, Mike Hansen <[EMAIL PROTECTED]> wrote: Hi, I saw your posting on the python list about pymssql and you mentioned that you call stored procedures and get back output parameters. Are you doing this on Windows or Linux? I can't seem to get it

Re: Automatic email checking - best procedures/suggestions

2006-07-27 Thread Jorge Godoy
"Jon Clements" <[EMAIL PROTECTED]> writes: > problem. What I'm unsure of is the best way to design this. Bear in > mind that network/email server configuration changes can be made. For > instance, do I connect to the email server and keep polling it every > 'n' whatever for new messages, or should

Automatic email checking - best procedures/suggestions

2006-07-27 Thread Jon Clements
Hi All, I'm hoping someone has some experience in this field and could give me a pointer in the right direction - it's not purely python related though. Any modules/links someone has tried and found useful would be greatly appreciated... I want to have an automated process which basically has its

Re: calling python procedures from tcl using tclpython

2005-07-09 Thread Jonathan Ellis
Jeff Hobbs wrote: > chand wrote: > > can anyone help me how to provide the info about the python file > > procedure in the tcl script which uses tclpython i.e., is there a way > > to import that .py file procedure in the tcl script > > >>>currently I have wriiten this tcl code which is not working

Re: calling python procedures from tcl using tclpython

2005-07-08 Thread Jeff Hobbs
chand wrote: > can anyone help me how to provide the info about the python file > procedure in the tcl script which uses tclpython i.e., is there a way > to import that .py file procedure in the tcl script >>>currently I have wriiten this tcl code which is not working >>> >>>package require tclpyt

Re: calling python procedures from tcl using tclpython

2005-07-07 Thread chand
Hi., can anyone help me how to provide the info about the python file procedure in the tcl script which uses tclpython i.e., is there a way to import that .py file procedure in the tcl script --BestRegards --Chandra Michael Schlenker wrote: > chand wrote: > > Hi.. > > > > I am writing a Gui in

Re: calling python procedures from tcl using tclpython

2005-07-07 Thread chand
That is exactly i want to know. i.e...,how to provide the python code path in tcl script file, that loads required function. --BestRegards., --chandra > definitions etc. Michael Schlenker wrote: > chand wrote: > > Hi.. > > > > I am writing a Gui in TCL and my backend code is python. I want to ca

Re: calling python procedures from tcl using tclpython

2005-07-07 Thread Michael Schlenker
chand wrote: > Hi.. > > I am writing a Gui in TCL and my backend code is python. I want to call > python procedure in tcl using tclpyhton. I want to know clearly how > this should be implemented. > > let's say I have procedure test_function(arg1,arg2 ...) defined in > test.py. > I want to call th