473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 1852
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.