Apr-26-2018, 03:20 PM
Using Python version 2.7.12 on Linux Mint 18.2. Will be upgrading os next week.
My background is that of various forms of basic and some perl. I have researched
and am unable to figureout how do the following in python.
Can someone help please.
Thanks in advance
oldcity
$datafile = "expenses18";
expenses18 file
041118,1,11.11,1
042618,2,22.22.2
My background is that of various forms of basic and some perl. I have researched
and am unable to figureout how do the following in python.
Can someone help please.
Thanks in advance
oldcity
$datafile = "expenses18";
expenses18 file
041118,1,11.11,1
042618,2,22.22.2
perl code open(FILE, '<', $datafile) or die("Could not open* file! datafile\n"); @lines = <FILE>; close(FILE); foreach (@lines) { ($pdate,$catg,$amt,$howp) = (split(/,/)); # $mm pulled from $pdate col1[$mm] = $pdate ; col2[$mm] = $catg ; col3]$mm] = $amt ; col4[$mm] = $howp ; python code expenses18 file 041118,1,11.11,1 042618,2,22.22.2 with open('expenses18', 'r') as file: lines = file.readlines: ## from here on I'm stuck