PyEphem on Win32 -- 2nd try
drobinow at gmail.com
drobinow at gmail.com
Thu Feb 24 08:13:41 EST 2005
Flory at fdu.edu wrote:
> Has anyone run the PyEphem ephemeris application under WinXP?
> http://rhodesmill.org/brandon/projects/pyephem.html
> I have compiled it with Visual Studio 6 and it crashes Python with a
> simple
>
> >>> import ephem
> >>> ephem.date('1994/7/16')
>
> Identical code works fine under Linux. I suspect that the problem has
> to do with a parser built into the c shell for the c code that the
> app wraps around. However, I am not good enough at c to spot the
> error.
I had the same problem with Python 2.4. Dates appear to need a
trailing space.
ephem.date('1994/7/16 ')
works for me.
I believe the following code in ephem.c is responsible:
if (conversions == -1 || !conversions ||
(conversions == 1 && s[dchars] != '\0') ||
(conversions == 2 && s[tchars] != '\0')) {
PyErr_SetString(PyExc_ValueError,
"your date string does not seem to have "
"year/month/day followed optionally by "
"hours:minutes:seconds");
This may be a VC versus gcc issue. It would be interesting to see if a
Mingw compile would help here.
More information about the Python-list
mailing list