Oct-06-2018, 02:51 PM
Linux Mint 18.2 Python 3.5. Am old time BASIC person.
Help. Have no understanding how to deal with this.
An example please.
Help. Have no understanding how to deal with this.
An example please.
#!/usr/bin/python3 # with open( 'expenses-18', 'r') as yrs_file: for line in enumerate(yrs_file): (pdate,catg,amt,howp) = line.split(',') pdate = str(pdate) length = len(pdate) catg = int(catg) amt = float(amt) howp = int(howp) # Will do stuff here. print pdate, catg, amt, howp Traceback (most recent call last): File "try-me.py", line 5, in <module> (pdate,catg,amt,howp) = line.split(',') AttributeError: 'tuple' object has no attribute 'split'