Re: [Tutor] array input from keyboard

2017-09-16 Thread Oliver Schmitz
Hi Derek, you are iterating over the input string, this will result in single chars in each iteration of your for loop. You could use `split` on your string to split the string into a list, splitted by comma. Instead of: >vols = [] >vols = input("Please enter your volume ids, comma

Re: [Tutor] array input from keyboard

2017-09-15 Thread Alan Gauld via Tutor
On 15/09/17 21:50, Derek Smith wrote: > if nput1 == "file" : > nput2 = input("Please provide your input file? ") > nput2 = nput2.lower() Are you sure the filenames will always be lower case? > print (nput2) > fh = open(nput2,"r") You should wrap that in a try/except in case

[Tutor] array input from keyboard

2017-09-15 Thread Derek Smith
I need to accept input from the user then store in an array/list. This is my 1st python script. #!/usr/bin/env python # Derek Smith # 09/2017 # accept volumes for TSM for tape mgmt. import os import sys nput1 = "" nput2 = "" nput1 = input("\nIs your input 'file' based or 'cli' based? ") if