Comments (7)
Wow... that was it. Thanks!
from igc2csv.
Change line 110 to:
flight['flightdate'] = datetime.date(int(line[9:11])+2000, int(line[7:9]), int(line[5:7]))
from igc2csv.
I fixed it in my fork of the code. Feel free to commit my changes.
https://github.com/ScottStanton/IGC2CSV
from igc2csv.
Hi! I had the same problem... this is what happened the first time I run it:
$ python2 IGC2CSV.py /tmp/230325175253.igc
Number of arguments: 2
Argument List: ['IGC2CSV.py', '/tmp/230325175253.igc']
Single IGC file supplied: /tmp/230325175253.igc
1 flights ready to process...
Traceback (most recent call last):
File "IGC2CSV.py", line 254, in <module>
flight = parse_igc(flight)
File "IGC2CSV.py", line 16, in parse_igc
recordtypes[linetype](line, flight)
File "IGC2CSV.py", line 101, in logline_H
headertypes[line[1:5]](line[5:], flight)
File "IGC2CSV.py", line 110, in logline_H_FDTE
flight['flightdate'] = datetime.date(int(line[4:6])+2000, int(line[2:4]), int(line[0:2]))
ValueError: invalid literal for int() with base 10: ':2'
Then I change line 110 as @ScottStanton suggested and this is the error I got now:
$ python2 IGC2CSV.py /tmp/230325175253.igc
File "IGC2CSV.py", line 111
flight['flightdate'] = datetime.date(int(line[9:11])+2000, int(line[7:9]), int(line[5:7]))
^
IndentationError: expected an indented block
Please help!
from igc2csv.
Can you post lines 107 to 114 from your code?
from igc2csv.
Sure:
# Date format: DDMMYY
# (did we learn nothing from Y2K?)
def logline_H_FDTE(line, flight):
# flight['flightdate'] = datetime.date(int(line[4:6])+2000, int(line[2:4]), int(line[0:2]))
flight['flightdate'] = datetime.date(int(line[9:11])+2000, int(line[7:9]), int(line[5:7]))
print "Flight date: {}".format(flight['flightdate'])
from igc2csv.
Indent the line that start with 'flight' to match the indentation of the 'print' below it.
Python is very particular about indentation.
from igc2csv.
Related Issues (3)
- TAS is hard coded HOT 1
- SyntaxError? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igc2csv.