[Tutor] Question Regarding startswith()

Jeremy Ogorzalek jeremyo at vt.edu
Mon Jun 4 11:57:54 EDT 2018


Not sure this is how this is done, but here goes.

When I try to run the code in the SGP4 module, I get the following error,
and it originates in the io.py script:


  File "C:\ProgramData\Anaconda3\lib\site-packages\sgp4\io.py", line 131,
in twoline2rv
    assert line.startswith('1 ')

TypeError: startswith first arg must be bytes or a tuple of bytes, not str

But as far as I can tell in the documentation online (multiple sources) the
first argument of startswith() is indeed supposed to be a string! It should
be the string of text you are searching for! So, what gives? I've also
tried to make the code happy by converting the string to bytes, tuple,
etc.... and still get the same error. Any help would be much appreciated.
Thanks!

Jeremy Ogorzalek
M.S., Aerospace Engineering
Virginia Tech
443-812-3121


More information about the Tutor mailing list