473,474 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1856
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Talon | last post by:
Hi all, I am new to Tk, so please bear with me. I need someone better at math than me to help me figure this out. I am drawing multiple arcs on the same circle. All arcs start at 90 and have...
20
by: Jeff Thies | last post by:
Is it possible to set the Math functions to use degrees instead of radians? I'm working out some astronomical calculations and everything is in degrees. All those conversions are driving me a...
1
by: rdeaton | last post by:
I need to design and code a Java program that calculates and prints the (D) diameter, the (C) circumference, or the (A) area of a circle, given the radius. The program inputs two data items: the...
5
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using...
4
by: Soumyadip Rakshit | last post by:
Hi, Could you please tell me the most efficient way of finding the curvature of a circle passing through three (non-colinear) points. Thanks a ton, Soumyadip.
14
by: Pythor | last post by:
I wrote the following code for a personal project. I need a function that will plot a filled circle in a two dimensional array. I found Bresenham's algorithm, and produced this code. Please tell...
5
by: Lance | last post by:
Hi all, Below is a funtion that converts a Lat or Lon coordinate (as a Double) to a string of Degrees, Minutes and Seconds. It's based on an MS Exmaple for VBA found here...
0
by: CharChabil | last post by:
Hey Guys Kindly help me with the following function in vb.net 2005 I want to write a function that does the following 1. Go to pixels (x,y) 2. Draw a circle or a rectangle at the above pixels,...
9
by: saraaana | last post by:
Given the center and a point on the circle, you can use this formula to find the radius of the circle. Write a program that prompts the user to enter the center and a point on the circle. The program...
14
by: DeadSilent | last post by:
I have this code and for some reason I keep getting an error where it says "exporting non-public type through public api ".. I'm not sure why this keeps happening but it does so for getCircleInfo /...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.