Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-30 Thread Emile van Sebille
On 11/29/2011 4:44 PM Dave Angel said... Any chance you were a customer or vendor of Wang? That 80mb drive, dumbed down, for prices around $20k, rings a bell. That was around 1980 as an ISV -- a Basic Four 610 -- we paid I think $50k? retailed at $70k. 8 user, 256k memory, two 35Mb drives tha

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread bob gailer
On 11/29/2011 6:40 PM, emile wrote: Dave Angel wrote: ... single use punch cards... You didn't have an IBM 719 CARD punch? (ChAd Restoration Device). Made reuse of punch cards very easy. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillis

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Alan Gauld
On 29/11/11 21:40, Mayo Adams wrote: tuple that is in the file, it would be helpful to know what it is. Presumably, a string representing a tuple. Exactly so, everything in the file is a string. If it's a binary file it is a string of bytes, if it is a text file a string of characters. The i

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Dave Angel
On 11/29/2011 06:40 PM, emile wrote: Dave Angel wrote: > The whole Y2K problem was caused because too many programmers made unwarranted assumptions about their data (in that case about the range of valid dates). Well, yes. But we knew then that the stuff we were writing wouldn't still be i

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread emile
Dave Angel wrote: > The whole Y2K problem was caused because too many programmers made unwarranted assumptions about their data (in that case about the range of valid dates). Well, yes. But we knew then that the stuff we were writing wouldn't still be in play 25 years out. :) And they

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Dave Angel
On 11/29/2011 04:40 PM, Mayo Adams wrote: Apologies for my numerous offenses to protocol, and gratitude for the suggestions all around.And yet... as to the notion of a tuple existing in some non-Platonic sense, I suspect I will have carry my confusion away in order to dispel it by further readi

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Wayne Werner
On Tue, Nov 29, 2011 at 3:40 PM, Mayo Adams wrote: > I cant immediately see how anything in a script is > anything other than a representation of some kind, hence the > distinction between representamen and object does no work for me. > That's exactly it - when you have something like this in a

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Mayo Adams
Apologies for my numerous offenses to protocol, and gratitude for the suggestions all around.And yet... as to the notion of a tuple existing in some non-Platonic sense, I suspect I will have carry my confusion away in order to dispel it by further reading. "Wrong on both counts?" Hey, you win! I

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Steven D'Aprano
Peter Otten wrote: And here's the lazy-bastard version: [...] ... print ast.literal_eval(line.strip()) Nice! -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/l

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Peter Otten
Steven D'Aprano wrote: > bob gailer wrote: >> On 11/28/2011 12:47 PM, James Reynolds wrote: >>> >>> >>> On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams >> > wrote: >>> >>> I am trying to pass a set of tuple strings from a file to a >>> function I >>> have defined.

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Steven D'Aprano
bob gailer wrote: On 11/28/2011 12:47 PM, James Reynolds wrote: On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams > wrote: I am trying to pass a set of tuple strings from a file to a function I have defined. Each tuple is on a separate line, and looks someth

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread Dave Angel
On 11/28/2011 11:25 PM, bob gailer wrote: On 11/28/2011 12:47 PM, James Reynolds wrote: On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams > wrote: I am trying to pass a set of tuple strings from a file to a function I have defined. Each tuple is on a separat

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread bob gailer
On 11/28/2011 12:47 PM, James Reynolds wrote: On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams > wrote: I am trying to pass a set of tuple strings from a file to a function I have defined. Each tuple is on a separate line, and looks something like this:

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread Dave Angel
1. Please post messages to the list, a private response is not appropriate unless it's just a thanks, or other private msg. Easiest way is probably to use Reply-All. 2. Don't top-post. Put your responses AFTER whatever you're quoting. It's a forum policy, for most usenet groups. On 11/28

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread Steven D'Aprano
James Reynolds wrote: Alternatively, since you aren't actually passing a "tuple" but something that looks like a python tuple as a string, you could eval it: Please don't give beginners terrible advice like this. There are already too many programs vulnerable to code injection attacks withou

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread Dave Angel
On 11/28/2011 12:47 PM, James Reynolds wrote: On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams wrote: I am trying to pass a set of tuple strings from a file to a function I That's an undefined term. Python doesn't have a type called 'tuple strings'. have defined. Each tuple is on a separate li

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread James Reynolds
On Mon, Nov 28, 2011 at 12:32 PM, Mayo Adams wrote: > I am trying to pass a set of tuple strings from a file to a function I > have defined. Each tuple is on a separate line, and looks something > like this: > ('note',2048) > The function has two parameters , and is defined thus: def > findinde

[Tutor] pass tuples to user defined function(beginner)

2011-11-28 Thread Mayo Adams
I am trying to pass a set of tuple strings from a file to a function I have defined.  Each tuple is on a separate line, and looks something like this: ('note',2048) The function has two parameters , and is defined thus: def findindex(dval,ticks): Apparently, I need to cast the second value as an i