Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread Terry Reedy
On 1/16/2021 9:17 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: A bare minimum skeleton might look something like this: with open(filename) as f: for line in f.readlines(): handle_one_line(f) f.readlines() reads the entire file into a list of lines (strings). If

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread 2QdxY4RzWzUUiLuE
On 2021-01-16 at 17:46:13 -0500, DonK wrote: > On Sat, 16 Jan 2021 14:56:37 -0600, 2qdxy4rzwzuui...@potatochowder.com > wrote: > > >On 2021-01-16 at 15:42:44 -0500, > >DonK wrote: > >> For example, I've found a need to parse text documents quite a number > >> of times over the years. Basic/VB

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread DonK
On Sat, 16 Jan 2021 14:56:37 -0600, 2qdxy4rzwzuui...@potatochowder.com wrote: >On 2021-01-16 at 15:42:44 -0500, >DonK wrote: > >> Yes, Windows. Iterating open windows with the Window's API is easy the >> hard (very hard) part is sending keystrokes to those windows to Save >> them. It's very

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread DonK
On Tue, 12 Jan 2021 10:16:47 +0400, Abdur-Rahmaan Janhangeer wrote: >Greetings, > >Web with Python is really easy to get started with, here >is a simple endpoint with a framework called Flask > >from flask import Flask >app = Flask(__name__) > >@app.route('/') >def hello_world(): > return

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread 2QdxY4RzWzUUiLuE
On 2021-01-16 at 15:42:44 -0500, DonK wrote: > Yes, Windows. Iterating open windows with the Window's API is easy the > hard (very hard) part is sending keystrokes to those windows to Save > them. It's very tricky because the timing is critical. > > You have to use one of those "spy" utilities

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread DonK
On Mon, 11 Jan 2021 21:56:48 -0800, Paul Rubin wrote: >DonK writes: >> My problem is that I don't understand how Python programs are >> used. (i.e user input and output) Is Python mainly used for backends? >> I've seen some Python gui frameworks like Tkinter, PyQt, etc > >I would say at

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread DonK
On Tue, 12 Jan 2021 09:26:18 +1100, Chris Angelico wrote: >On Tue, Jan 12, 2021 at 7:41 AM DonK wrote: >> Hi, I'm thinking about learning Python but I'm 74 years old and will >> very likely not ever have a programming job again. I used to program >> in Visual Basic, C\C++, Delphi, etc. and some

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Greg Ewing
On 14/01/21 11:49 am, Cameron Simpson wrote: The "pure" OOP approach, where method calls are used as messages to set or fetch aspects of the object, is usually does with getter and setter methods like: x = o.getX() o.setX(9) People use get and set methods, not because it's somehow

Re: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Peter Pearson
On Wed, 13 Jan 2021 21:46:08 - (UTC), Grant Edwards wrote: > On 2021-01-13, Peter Pearson wrote: [snip] >> Browsergui is not widely popular (I don't think anybody but me has >> mentioned it on this newsgroup), but it was written to be simple and >> Pythonic, and has served me well.

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Greg Ewing
On 14/01/21 11:09 am, Grant Edwards wrote: Perhaps I need to recalibrate my adjectives, but with 256KB+ of flash and 32KB+ of RAM, I wouldn't call them "small" It's small by today's standards, when you consider that multiple GB of RAM is commonplace now in most "real" computers. -- Greg --

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Greg Ewing
On 13/01/21 7:57 pm, Christian Gollwitzer wrote:  What do you mean, "until" ? https://medium.com/@yon.goldschmidt/running-python-in-the-linux-kernel-7cbcbd44503c He's using Micropython. That's cheating! :-) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: FridayFinking - Was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Rich Shepard
On Thu, 14 Jan 2021, dn via Python-list wrote: Concerning the definition of "old" - when I'm having a 'good day', it's anyone several years my senior (and above) - when I'm creaking and groaning, it's anyone remotely my age, and older. About 45 years ago a 25-year-older friend of mine offered

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grant Edwards
On 2021-01-13, Peter Pearson wrote: > On Mon, 11 Jan 2021 15:37:58 -0500, DonK > wrote: > [snip] >> >> I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they >> look kinda like adding a family room onto a 1986 double wide mobile >> home, > > Agreed. > > Browsergui is not widely

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grant Edwards
On 2021-01-13, Dennis Lee Bieber wrote: > On Tue, 12 Jan 2021 15:18:05 - (UTC), Grant Edwards > declaimed the following: >>On 2021-01-12, songbird wrote: >> >>> it can be used for pretty much anything except perhaps high >>> pressure real time things, but i bet someone else will know that

FridayFinking - Was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread dn via Python-list
On 14/01/2021 04.54, Grimble wrote: > On 11/01/2021 20:37, DonK wrote: >> >> Hi, I'm thinking about learning Python but I'm 74 years old and will >> very likely not ever have a programming job again. > At 83, I have no intention of having a programming job again! I last > coded something

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Cameron Simpson
On 13Jan2021 10:37, songbird wrote: > my momentary conceptual problem is that to me OOP means >being able to encapsulate data structures and code from >other parts of the program, but to me it doesn't look like >that is how python is designed. this is probably a complete >aside to this whole

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Peter Pearson
On Mon, 11 Jan 2021 15:37:58 -0500, DonK wrote: [snip] > > I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they > look kinda like adding a family room onto a 1986 double wide mobile > home, Agreed. Browsergui is not widely popular (I don't think anybody but me has mentioned

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread songbird
Christian Gollwitzer wrote: > Am 13.01.21 um 06:24 schrieb Greg Ewing: >> On 13/01/21 4:18 am, Grant Edwards wrote: >> >>> AFAIK, Python can't be used to write device drivers for any popular OS >> >> At least not until some crazy person embeds Python in the >> Linux kernel... > > > What do you

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grimble
On 11/01/2021 20:37, DonK wrote: Hi, I'm thinking about learning Python but I'm 74 years old and will very likely not ever have a programming job again. At 83, I have no intention of having a programming job again! I last coded something professionally 45 years ago, but it hasn't lost its

conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread songbird
Chris Angelico wrote: ...projects that fade... > That's not really something Python can ever control, but I can say > with some confidence that the big libraries like Qt and GTK are going > to adapt, one way or another. And perhaps more importantly: Neither > input()/print() nor web applications

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grimble
On 11/01/2021 20:37, DonK wrote: So, what do you folks use Python for? I've written a shopping list script with auto-completion and a couple of web-scraping applications that support a weather reporting application interfacing with various 1Wire sensors transcribed from an initial Ruby

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Christian Gollwitzer
Am 13.01.21 um 06:24 schrieb Greg Ewing: On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... What do you mean, "until" ?

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Greg Ewing
On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > * Command-line calculator - pressing Ctrl-Alt-P will open up a > terminal with Python, and that's the normal way that I do quick > calculations I do that a lot too. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Cameron Simpson
On 12Jan2021 10:40, Michael F. Stemper wrote: >On 11/01/2021 14.37, DonK wrote: >>I've installed Python 3.7, the PyCharm IDE and watched some Youtube >>tutorials > >I would suggest that instead of watching tutorials, you open up your IDE >and start writing stuff. I would second that. Maybe this

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Cameron Simpson
On 12Jan2021 15:18, Grant Edwards wrote: >On 2021-01-12, songbird wrote: >> it can be used for pretty much anything except perhaps >> high pressure real time things, but i bet someone else will >> know that is being done too, i've just not heard of it. :) > >AFAIK, Python can't be used to

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK wrote: > So, what do you folks use Python for? > Since everyone else is, I'll add my list. * API lookups of various sorts (usually via HTTP requests) * Audio analysis. Calculate the maximum and average volume of each of many songs. * Code generation. The

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > On Wed, Jan 13, 2021 at 3:18 AM Grant Edwards > wrote: >> >> On 2021-01-12, songbird wrote: >> >> > it can be used for pretty much anything except perhaps >> > high pressure real time things, but i bet someone else will >> > know that is being done too,

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Michael F. Stemper
On 12/01/2021 10.40, Michael F. Stemper wrote: Modeling of electric power systems: - load behavior in response to conservation load reduction Sorry, that should have been "conservation voltage reduction". -- Michael F. Stemper Psalm 82:1-4 --

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread MRAB
On 2021-01-11 20:37, DonK wrote: [snip] So, what do you folks use Python for? Since we're sharing: - Personal information manager in the form of a tree of pages. Each page can have code associated with it which defines functions to call when shortcut keys are pressed, giving

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Michael F. Stemper
On 11/01/2021 14.37, DonK wrote: I've installed Python 3.7, the PyCharm IDE and watched some Youtube tutorials I would suggest that instead of watching tutorials, you open up your IDE and start writing stuff. Get an introductory python book (I used the O'Reilly _Introducing Python_), start at

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Chris Angelico
On Wed, Jan 13, 2021 at 3:18 AM Grant Edwards wrote: > > On 2021-01-12, songbird wrote: > > > it can be used for pretty much anything except perhaps > > high pressure real time things, but i bet someone else will > > know that is being done too, i've just not heard of it. :) > > AFAIK, Python

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-12, songbird wrote: > it can be used for pretty much anything except perhaps > high pressure real time things, but i bet someone else will > know that is being done too, i've just not heard of it. :) AFAIK, Python can't be used to write device drivers for any popular OS (Linux,

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-11, DonK wrote: > So, what do you folks use Python for? I mainly use it for writing command-line utilities. Many of them work on either Windows or Linux, but are mostly used on Linux: * Two-pass symbolic assembler and dissassembler for a proprietary communications controller.

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 5:26 PM songbird wrote: > for python i just spend too much time fumbling around > and i don't really know what is current and if i'm using > something that will be kept up for the future or if the > project is going away or in a direction that i won't like > (both KDE

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread songbird
DonK wrote: > > Hi, I'm thinking about learning Python but I'm 74 years old and will > very likely not ever have a programming job again. I used to program > in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" > languages. It's been about 18-19 years since my last programming job. >

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Abdur-Rahmaan Janhangeer
Greetings, Web with Python is really easy to get started with, here is a simple endpoint with a framework called Flask from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World’ if __name__ == '__main__': app.run() As for Tkinter, it's really

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 3:16 PM Greg Ewing wrote: > > Currently I'd like to write something to iterate > > through open windows and save them to different folders depending on > > if the titlebar contains certain strings. > > That sounds like it should be doable if you can get access to the >

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Greg Ewing
On 12/01/21 9:37 am, DonK wrote: I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they look kinda like adding a family room onto a 1986 double wide mobile home, and they look even more complicated than creating a GUI from scratch in C++ with a message loop, raising events . . .

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:52, Dan Stromberg wrote: >On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson wrote: >> >I've seen some Python gui frameworks like Tkinter, PyQt, etc. but >> >they >> >look kinda like adding a family room onto a 1986 double wide mobile >> >home, and they look even more complicated

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Dan Stromberg
On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson wrote: > >I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they > >look kinda like adding a family room onto a 1986 double wide mobile > >home, and they look even more complicated than creating a GUI from > >scratch in C++ with a

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK wrote: > Hi, I'm thinking about learning Python but I'm 74 years old and will > very likely not ever have a programming job again. I used to program > in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" > languages. BTW, from my experience,

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:37, DonK wrote: >Hi, I'm thinking about learning Python but I'm 74 years old and will >very likely not ever have a programming job again. I used to program >in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" >languages. Therefore you're happy with classes, and are

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread dn via Python-list
On 12/01/2021 09.37, DonK wrote: > > Hi, I'm thinking about learning Python but I'm 74 years old and will > very likely not ever have a programming job again. I used to program > in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" > languages. It's been about 18-19 years since my

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK wrote: > > > Hi, I'm thinking about learning Python but I'm 74 years old and will > very likely not ever have a programming job again. I used to program > in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" > languages. It's been about 18-19

A beginning beginner's question about input, output and . . .

2021-01-11 Thread DonK
Hi, I'm thinking about learning Python but I'm 74 years old and will very likely not ever have a programming job again. I used to program in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe" languages. It's been about 18-19 years since my last programming job. I do understand

Re: question about input() and/or raw_input()

2014-01-19 Thread Rustom Mody
On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote: On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote: Because these two pieces of code def foo(x): print x+1 def bar(x): return x+1 look identical (to a beginner at least) foo(3) 4 bar(3) 4 As do these pieces

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Sun, Jan 19, 2014 at 7:26 PM, Rustom Mody rustompm...@gmail.com wrote: If you want to give an irrelevant example at least give a correct one :D the difference between str and hex is an arcane difference (Ive never used hex) the difference between functions and procedures is absolutely

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-18, Terry Reedy tjre...@udel.edu wrote: On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Homework problems (and 'toy' programs, such

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 12:26 AM, Rustom Mody wrote: On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote: On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote: As do these pieces of code: -- def quux1(x): return str(x+1) -- def quux2(x): return hex(x+1)[2:] They do? -- quux1(2.3)

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman et...@stoneleaf.us wrote: -- def quux1(x): return str(x+1) -- quux1(2.3) '3.3' (Will be) fixed in 3.5 [1] :) [1] Which is to say, both will raise an exception. Why would that raise? ChrisA --

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 19 Jan 2014 16:14:48 + (UTC), Grant Edwards invalid@invalid.invalid declaimed the following: On 2014-01-18, Terry Reedy tjre...@udel.edu wrote: On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 4:42 AM, Grant Edwards invalid@invalid.invalid wrote: 2) I didn't claim that sys.stdin.readline() was as simple as using input. I didn't claim it was preferable. I merely presented it as a refutation to the argument that if you don't use input/raw_input then

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 18/01/2014 18:41, Mark Lawrence wrote: On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Not me personally. I guess raw_input must have been

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Mark Lawrence breamore...@yahoo.co.uk wrote: On 18/01/2014 18:41, Mark Lawrence wrote: On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 08:38 AM, Chris Angelico wrote: On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman et...@stoneleaf.us wrote: -- def quux1(x): return str(x+1) -- quux1(2.3) '3.3' (Will be) fixed in 3.5 [1] :) [1] Which is to say, both will raise an exception. Why would that raise? Sorry, should

Re: question about input() and/or raw_input()

2014-01-19 Thread Roy Smith
In article lbh4oc$nqv$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: I can still remember the point in my first trip to the UK when I accidentally stumbled across darts on TV. Given the endless variety (and quantity) of pointless crap that people watch here in the US, I

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman et...@stoneleaf.us wrote: The difference I was thinking of is: %h % 3.14 # this works vs. hex(3.14) # this raises In 3.5 both will raise. Now you have me *thoroughly* intrigued. It's not %h (incomplete format - h is a modifier), nor %H

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 5:37 AM, Roy Smith r...@panix.com wrote: What's so complicated? points = 501 for dart in throws(): if points - dart == 0 and dart.is_double(): raise YouWin if points - dart 0: continue points -= dart beer.drink() assert victory raise beer

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Roy Smith r...@panix.com wrote: In article lbh4oc$nqv$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: I can still remember the point in my first trip to the UK when I accidentally stumbled across darts on TV. Given the endless variety (and quantity) of

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence breamore...@yahoo.co.uk wrote: On 18/01/2014 18:41, Mark Lawrence wrote: On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used

Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence breamore...@yahoo.co.uk wrote: Actually, to go off at a tangent, I'm just getting into GUIs via wxPython. I've discovered there are distinct

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 19/01/2014 19:24, Larry Martell wrote: On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence breamore...@yahoo.co.uk wrote: Actually, to go off at a tangent, I'm just getting into GUIs via

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 10:41 AM, Chris Angelico wrote: On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman et...@stoneleaf.us wrote: The difference I was thinking of is: %h % 3.14 # this works vs. hex(3.14) # this raises In 3.5 both will raise. Now you have me *thoroughly* intrigued. It's not %h

Re: question about input() and/or raw_input()

2014-01-19 Thread Gene Heskett
On Sunday 19 January 2014 15:11:52 Larry Martell did opine: On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence breamore...@yahoo.co.uk wrote: Actually, to go off at a tangent, I'm just

Re: question about input() and/or raw_input()

2014-01-19 Thread Gene Heskett
On Sunday 19 January 2014 15:08:31 Roy Smith did opine: In article lbh4oc$nqv$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: I can still remember the point in my first trip to the UK when I accidentally stumbled across darts on TV. Given the endless variety (and

Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 1:12 PM, Gene Heskett ghesk...@wdtv.com wrote: On Sunday 19 January 2014 15:11:52 Larry Martell did opine: On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence

question about input() and/or raw_input()

2014-01-18 Thread Roy Smith
Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? -- https://mail.python.org/mailman/listinfo/python-list

Re: question about input() and/or raw_input()

2014-01-18 Thread Mark Lawrence
On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Not me personally. I guess raw_input must have been used somewhere at some time for something,

Re: question about input() and/or raw_input()

2014-01-18 Thread Emile van Sebille
On 01/18/2014 10:30 AM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Yes - routinely. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: question about input() and/or raw_input()

2014-01-18 Thread Peter Otten
Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? I use it for pointless throwaway tools, sometimes via the cmd module, sometimes directly. I like that you can add

Re: question about input() and/or raw_input()

2014-01-18 Thread Terry Reedy
On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Homework problems (and 'toy' programs, such as hangman), whether in a programming class or

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 8:33 AM, Terry Reedy tjre...@udel.edu wrote: On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Homework problems (and

Re: question about input() and/or raw_input()

2014-01-18 Thread Rustom Mody
On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Similar 'cynicism' regarding print would be salutary for producing

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 3:15 PM, Rustom Mody rustompm...@gmail.com wrote: On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework

Re: question about input() and/or raw_input()

2014-01-18 Thread Rustom Mody
On Sunday, January 19, 2014 9:51:36 AM UTC+5:30, Chris Angelico wrote: On Sun, Jan 19, 2014 at 3:15 PM, Rustom Mody wrote: On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody rustompm...@gmail.com wrote: Because these two pieces of code def foo(x): print x+1 def bar(x): return x+1 look identical (to a beginner at least) foo(3) 4 bar(3) 4 As do these pieces of code: def quux(x): return str(x+1) def quux(x):

Re: question about input() and/or raw_input()

2014-01-18 Thread Steven D'Aprano
On Sat, 18 Jan 2014 13:30:20 -0500, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Yes. They are excellent for interactive command line tools. -- Steven --

Re: question on input function

2009-07-19 Thread Chris Rebert
On Sun, Jul 19, 2009 at 7:07 PM, Richel Satumbagarlsatumb...@yahoo.com wrote: I am just learning python then I encountered an certain point in terms of using the input function of python. the source code:    eq = input(enter an equation:);    print the

Re: question on input function

2009-07-19 Thread John O'Hagan
On Mon, 20 Jul 2009, Richel Satumbaga wrote: I am just learning python then I encountered an certain point in terms of using the input function of python. the source code: eq = input(enter an equation:); print the result is : ; the output seen

Re: Noob Question: Force input to be int?

2007-01-24 Thread consmash
On 23 Sty, 10:59, [EMAIL PROTECTED] wrote: Hello everyone! I have a piece of code that looks like this: if len(BuildList) 0: print The script found %d game directories: % len(BuildList) print num = 0 for i in BuildList: print str(num) ++ i num =

Noob Question: Force input to be int?

2007-01-23 Thread wd . jonsson
Hello everyone! I have a piece of code that looks like this: if len(BuildList) 0: print The script found %d game directories: % len(BuildList) print num = 0 for i in BuildList: print str(num) ++ i num = num + 1 print print Select a build number

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Nogradi
I have a piece of code that looks like this: if len(BuildList) 0: print The script found %d game directories: % len(BuildList) print num = 0 for i in BuildList: print str(num) ++ i num = num + 1 print print Select a build number from 0 to

Re: Noob Question: Force input to be int?

2007-01-23 Thread Paul Rubin
[EMAIL PROTECTED] writes: print Select a build number from 0 to + str(len(BuildList) - 1) buildNum = int(raw_input('Select build # ')) while buildNum (len(BuildList) -1) or buildNum = -1: print print Error: Invalid build number! print Select a build

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Jonsson
Ah, thank you for the respone! I have not gotten around to test it yet, but I hope it will work! :) -Daniel 2007-01-23 10:59:37 [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED] Hello everyone! I have a piece of code that looks like this: if len(BuildList) 0: print The script

Re: Who uses input()? [was Re: question on input]

2005-07-18 Thread Terry Reedy
Nathan Pinno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I use input() all the time. I know many people say it ain't safe, but whose going to use it to crash their own comp? Only an insane person would, This is usage Guido intended it for, not for production apps distributed

Re: Who uses input()? [was Re: question on input]

2005-07-17 Thread Stephen Thorne
On 15/07/05, Terry Hancock [EMAIL PROTECTED] wrote: On Thursday 14 July 2005 07:00 am, Michael Hoffman wrote: Devan L wrote: Use raw_input instead. It returns a string of whatever was typed. Input expects a valid python expression. Who actually uses this? It's equivalent to

Re: Who uses input()? [was Re: question on input]

2005-07-17 Thread Nathan Pinno
- Original Message - From: Stephen Thorne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: python-list@python.org Sent: Sunday, July 17, 2005 11:12 PM Subject: Re: Who uses input()? [was Re: question on input] On 15/07/05, Terry Hancock [EMAIL PROTECTED] wrote: On Thursday

Who uses input()? [was Re: question on input]

2005-07-14 Thread Michael Hoffman
Devan L wrote: Use raw_input instead. It returns a string of whatever was typed. Input expects a valid python expression. Who actually uses this? It's equivalent to eval(raw_input(prompt)) but causes a lot of newbie confusion. Python-dev archives revealed that someone tried to get this

Re: Who uses input()? [was Re: question on input]

2005-07-14 Thread Terry Hancock
On Thursday 14 July 2005 07:00 am, Michael Hoffman wrote: Devan L wrote: Use raw_input instead. It returns a string of whatever was typed. Input expects a valid python expression. Who actually uses this? It's equivalent to eval(raw_input(prompt)) but causes a lot of newbie confusion.

question on input

2005-07-12 Thread [EMAIL PROTECTED]
Hi, I want to accept the user's answer yes or no. If I do this: answer = input('y or n?') and type y on the keyboard, python complains Traceback (most recent call last): File stdin, line 1, in ? File string, line 0, in ? NameError: name 'y' is not defined It seems like input only accepts

Re: question on input

2005-07-12 Thread Bill Mill
On 12 Jul 2005 07:31:47 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I want to accept the user's answer yes or no. If I do this: answer = input('y or n?') Use raw_input instead: answer = raw_input(y or n?) y or n?y answer 'y' Check out the documentation of both functions at

Re: question on input

2005-07-12 Thread Devan L
Use raw_input instead. It returns a string of whatever was typed. Input expects a valid python expression. -- http://mail.python.org/mailman/listinfo/python-list