470,614 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Re: Filling in Degrees in a Circle (Astronomy)

W. eWatson wrote:
...
I'm working on this now, but my knowledge of python needs refreshing.
Right now I have a file of all the az,el data I've collected, and I'd
like to open it with Python for XP. However, Python doesn't like this:

junkfile = open('c:\tmp\junkpythonfile','w')

I get
junkfile = open('c:\tmp\junkpythonfile','w')
IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile'

This problematic segment is just a hack of a similar statement which has
the same problem and a much longer path. I suspect the problem is with
the back slash.
A standard windows error. note that '\t' is a tab, and I doubt you have
a directory named <tab<m<p>. Get in the habit of _always_ using:
junkfile = open(r'c:\tmp\junkpythonfile','w')
or
junkfile = open('c:\\tmp\\junkpythonfile','w')
for file names.

--Scott David Daniels
Sc***********@Acm.Org

Aug 23 '08 #1
4 1722
Scott David Daniels wrote:
W. eWatson wrote:
>...
I'm working on this now, but my knowledge of python needs refreshing.
Right now I have a file of all the az,el data I've collected, and I'd
like to open it with Python for XP. However, Python doesn't like this:

junkfile = open('c:\tmp\junkpythonfile','w')

I get
junkfile = open('c:\tmp\junkpythonfile','w')
IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile'

This problematic segment is just a hack of a similar statement which
has the same problem and a much longer path. I suspect the problem is
with the back slash.

A standard windows error. note that '\t' is a tab, and I doubt you have
a directory named <tab<m<p>. Get in the habit of _always_ using:
junkfile = open(r'c:\tmp\junkpythonfile','w')
or
junkfile = open('c:\\tmp\\junkpythonfile','w')
for file names.

--Scott David Daniels
Sc***********@Acm.Org
Thanks. r did the job nicely.

--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
Aug 23 '08 #2
I completed a Win Python program and it has generated the necessary data,
which I have in turn used successfully with the telescope software. Is there
some way to turn this into an executable program for people who do not have
Python?

--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
Aug 23 '08 #3
W. eWatson schreef:
I completed a Win Python program and it has generated the necessary data,
which I have in turn used successfully with the telescope software. Is there
some way to turn this into an executable program for people who do not have
Python?
Yes, you can use py2exe (http://www.py2exe.org/) for that.

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven
Aug 24 '08 #4
On Aug 23, 10:11*am, Scott David Daniels <Scott.Dani...@Acm.Org>
wrote:
W. eWatson wrote:
...
I'm working on this now, but my knowledge of python needs refreshing.
Right now I have a file of all the az,el data I've collected, and I'd
like to open it with Python for XP. However, Python doesn't like this:
junkfile = open('c:\tmp\junkpythonfile','w')
I get
* * junkfile = open('c:\tmp\junkpythonfile','w')
IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile'
This problematic segment is just a hack of a similar statement which has
the same problem and a much longer path. I suspect the problem is with
the back slash.

A standard windows error. note that '\t' is a tab, and I doubt you have
a directory named <tab<m<p>. *Get in the habit of _always_ using:
* * junkfile = open(r'c:\tmp\junkpythonfile','w')
or
* * junkfile = open('c:\\tmp\\junkpythonfile','w')
for file names.

--Scott David Daniels
Scott.Dani...@Acm.Org
Avoid backslashes whenever possible.
junkfile = open('c:/tmp/junkpythonfile','w')
Aug 25 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Talon | last post: by
20 posts views Thread by Jeff Thies | last post: by
1 post views Thread by rdeaton | last post: by
5 posts views Thread by Patrick De Ridder | last post: by
4 posts views Thread by Soumyadip Rakshit | last post: by
14 posts views Thread by Pythor | last post: by
5 posts views Thread by Lance | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.