Re: Python Portability--Not very portable?

2010-08-06 Thread W. eWatson
On 8/6/2010 10:31 AM, geremy condra wrote: On Fri, Aug 6, 2010 at 8:00 AM, W. eWatsonwolftra...@invalid.com wrote: I would think there are some small time and big time Python players who sell executable versions of their programs for profit? Yes. What's your point? That someone must know

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-06 Thread W. eWatson
I must be missing something. I tried this. (Windows, IDLE, Python 2.5) # Try each module import sys import numpy import scipy import string dependencies = numyp, scipy for dependency in dependencies: try: __import__(dependency.name) except ImportError: # Uh oh!

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread W. eWatson
It's been awhile since I've used python, and I recall there is a way to find the version number from the IDLE command line prompt. dir, help, __version.__? I made the most minimal change to a program, and it works for me, but not my partner. He gets Traceback (most recent call last):

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread W. eWatson
On 8/5/2010 6:13 PM, Steven D'Aprano wrote: On Thu, 05 Aug 2010 17:55:30 -0700, W. eWatson wrote: I'm pretty sure he has the same version of Python, 2.5, but perhaps not the numpy or scipy modules. I need to find out his version numbers. It's only a convention, but the usual way is to check

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread W. eWatson
On 8/5/2010 6:23 PM, MRAB wrote: W. eWatson wrote: It's been awhile since I've used python, and I recall there is a way to find the version number from the IDLE command line prompt. dir, help, __version.__? I made the most minimal change to a program, and it works for me, but not my partner

Python Portability--Not very portable?

2010-08-05 Thread W. eWatson
In my on-again-off-again experience with Python for 18 months, portability seems an issue. As an example, my inexperienced Python partner 30 miles away has gotten out of step somehow. I think by installing a different version of numpy than I use. I gave him a program we both use months ago,

Re: Python Portability--Not very portable?

2010-08-05 Thread W. eWatson
On 8/5/2010 7:45 PM, geremy condra wrote: On Thu, Aug 5, 2010 at 6:50 PM, W. eWatsonwolftra...@invalid.com wrote: In my on-again-off-again experience with Python for 18 months, portability seems an issue. As an example, my inexperienced Python partner 30 miles away has gotten out of step

Re: Why this Difference in Importing NumPy 1.2 vs 1.4?

2010-03-29 Thread W. eWatson
Add/Remove under Control Panel. It's a numpy problem. On 3/28/2010 9:20 AM, W. eWatson wrote: I wrote a program in Python 2.5 under Win7 and it runs fine using Numpy 1.2 , but not on a colleague's machine who has a slightly newer 2.5 and uses NumPy 1.4. We both use IDLE to execute the program

Why this Difference in Importing NumPy 1.2 vs 1.4?

2010-03-28 Thread W. eWatson
I wrote a program in Python 2.5 under Win7 and it runs fine using Numpy 1.2 , but not on a colleague's machine who has a slightly newer 2.5 and uses NumPy 1.4. We both use IDLE to execute the program. During import he gets this: Traceback (most recent call last): File C:\Documents and

Re: Verifying My Troublesome Linkage Claim between Python and Win7

2010-03-01 Thread W. eWatson
On 2/23/2010 6:04 PM, Aahz wrote: In articlehm0jn4$tn...@news.eternal-september.org, W. eWatsonwolftra...@invalid.com wrote: My claim is that if one creates a program in a folder that reads a file in the folder it and then copies it to another folder, it will read the data file in the first

Verifying My Troublesome Linkage Claim between Python and Win7

2010-02-23 Thread W. eWatson
In the last day, I posted a message titled What's Going on between Python and win7? I'd appreciate it if someone could verify my claim. A sample program to do this is below. I'm using IDLE in Win7 with Py 2.5. My claim is that if one creates a program in a folder that reads a file in the

Bay Area PUG Meeting Thursday in Mountain View, CA

2010-02-23 Thread W. eWatson
Anyone here going to the meeting,Subject? As far as I can tell, it meets from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to be an informal group dinner at 6 pm at some place yet unknown. Comments? -- http://mail.python.org/mailman/listinfo/python-list

Re: Verifying My Troublesome Linkage Claim between Python and Win7

2010-02-23 Thread W. eWatson
On 2/23/2010 8:26 AM, Rick Dooling wrote: No telling what Windows will do. :) I am a mere hobbyist programmer, but I think real programmers will tell you that it is a bad habit to use relative paths. Use absolute paths instead and remove all doubt. http://docs.python.org/library/os.path.html

Re: Verifying My Troublesome Linkage Claim between Python and Win7

2010-02-23 Thread W. eWatson
On 2/23/2010 11:14 AM, Gib Bogle wrote: W. eWatson wrote: On 2/23/2010 8:26 AM, Rick Dooling wrote: No telling what Windows will do. :) I am a mere hobbyist programmer, but I think real programmers will tell you that it is a bad habit to use relative paths. Use absolute paths instead

Re: Bay Area PUG Meeting [Speaker] Thursday in Mountain View, CA?

2010-02-23 Thread W. eWatson
On 2/23/2010 7:49 AM, W. eWatson wrote: Anyone here going to the meeting,Subject? As far as I can tell, it meets from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to be an informal group dinner at 6 pm at some place yet unknown. Comments? -- http://mail.python.org/mailman

Re: Bay Area PUG Meeting Thursday in Mountain View, CA

2010-02-23 Thread W. eWatson
On 2/23/2010 2:50 PM, Aahz wrote: In articlehm0tdp$la...@news.eternal-september.org, W. eWatsonwolftra...@invalid.com wrote: Anyone here going to the meeting,Subject? As far as I can tell, it meets from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to be an informal group

Re: Bay Area PUG Meeting Thursday in Mountain View, CA

2010-02-23 Thread W. eWatson
On 2/23/2010 2:50 PM, Aahz wrote: In articlehm0tdp$la...@news.eternal-september.org, W. eWatsonwolftra...@invalid.com wrote: Anyone here going to the meeting,Subject? As far as I can tell, it meets from 7:30 to 9 pm. Their site shows no speaker yet, and there seems to be an informal group

Re: The Disappearing Program? (py2exe, graphics)

2010-02-22 Thread W. eWatson
This apparently is not quite as easy as the py2exe tutorial suggests when MPL is involved. See http://www.py2exe.org/index.cgi/MatPlotLib. It looks like I have some reading and work to do. -- http://mail.python.org/mailman/listinfo/python-list

What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B. Win7 went into search mode for the file. I looked at properties for

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:29 AM, Grant Edwards wrote: On 2010-02-22, W. eWatsonwolftra...@invalid.com wrote: Last night I copied a program from folder A to folder B. [tail of various windows breakages elided] Comments? Switch to Linux? Or at least install Cygwin? Yes, definitely not related, but

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
So what's the bottom line? This link notion is completely at odds with XP, and produces what I would call something of a mess to the unwary Python/W7 user. Is there a simple solution? How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 6:39 PM, David Robinow wrote: On Mon, Feb 22, 2010 at 8:25 PM, W. eWatsonwolftra...@invalid.com wrote: How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an ancestor. Ask in an appropriate forum. I'm not sure where that is

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. g I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. g I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python

Re: What's Going on between (Verify) Python and win7?

2010-02-22 Thread W. eWatson
Maybe someone could verify my result? open file read file line print line close file data 1234 Execute it in a folder Create another folder and copy the program to it. put in a new data file as data 4567 Execute the copied program Does it give data1234? --

The Disappearing Program?

2010-02-19 Thread W. eWatson
I've successfully compiled several small python programs on Win XP into executables using py2exe. A program goes from a name like snowball.py to snowball. A dir in the command prompt window finds snowball.py but not snowball. If I type in snowball, it executes. What's up with that? --

Re: The Disappearing Program?

2010-02-19 Thread W. eWatson
On 2/19/2010 7:16 AM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson wolftra...@invalid.com ... tories, or even the whole hard drive, for snowball

Re: The Disappearing Program?

2010-02-19 Thread W. eWatson
On 2/19/2010 10:56 AM, CM wrote: On Feb 19, 12:21 pm, W. eWatsonwolftra...@invalid.com wrote: On 2/19/2010 7:16 AM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM,

Re: Updating Packages in 2.5 (win/numpy) and Related Matters (the latest)

2010-02-17 Thread W. eWatson
On 17 February 2010 07:25, josef.p...@gmail.com wrote: On Wed, Feb 17, 2010 at 12:10 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Hi, I'm working on a 1800+ line program that uses tkinter. Here are the messages I started getting recently. (I finally figured out how to copy

Re: Updating Packages in 2.5 (win/numpy) and Related Matters (the latest)

2010-02-17 Thread W. eWatson
On 17 February 2010 07:25, josef.p...@gmail.com wrote: On Wed, Feb 17, 2010 at 12:10 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Hi, I'm working on a 1800+ line program that uses tkinter. Here are the messages I started getting recently. (I finally figured out how to copy

Re: Updating Packages in 2.5 (win/numpy) and Related Matters (the latest)

2010-02-17 Thread W. eWatson
Had trouble posting this to the same thread above. Request above to provide response from numpy mail list. On 17 February 2010 07:25, josef.p...@gmail.com wrote: On Wed, Feb 17, 2010 at 12:10 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Hi, I'm working on a 1800+ line program

Re: Wrestling with the Py2exe Install, Win7, Py2.5

2010-02-17 Thread W. eWatson
On 2/17/2010 3:44 AM, mk wrote: W. eWatson wrote: P.S. I didn't really use PyInstaller on Windows, though -- just on Linux, where it works beautifully. Regards, mk Well,Ive made some progress with a py2exe tutorial. It starts with the short hello world! program. But something stumbled right

Updating Packages in 2.5 (win/numpy) and Related Matters

2010-02-16 Thread W. eWatson
I normally use IDLE on Win, but recently needed to go to command prompt to see all error messages. When I did, I was greeted by a host of deprecation and Numpy messages before things got running. The program otherwise functioned OK, after I found the problem I was after. Are these messages a

Re: Is there a simple way to find the list index to the max value?

2010-02-16 Thread W. eWatson
On 2/16/2010 4:41 AM, Arnaud Delobelle wrote: Arnaud Delobellearno...@googlemail.com writes: W. eWatsonwolftra...@invalid.com writes: See Subject. a = [1,4,9,3]. Find max, 9, then index to it, 2. Here are a few ways. [...] My copy past went wrond and I forgot the first one: a =

Re: Updating Packages in 2.5 (win/numpy) and Related Matters

2010-02-16 Thread W. eWatson
On 2/16/2010 7:30 AM, Robert Kern wrote: On 2010-02-16 06:16 AM, W. eWatson wrote: I normally use IDLE on Win, but recently needed to go to command prompt to see all error messages. When I did, I was greeted by a host of deprecation and Numpy messages before things got running. The program

Wrestling with the Py2exe Install, Win7, Py2.5

2010-02-16 Thread W. eWatson
I've finally decided to see if I could make an executable out of a py file. Win7. Py2.5. I brought down the install file and proceeded with the install. I got two warning messages. Forgot the first. The second said,Could not set the key value. I again used OK. I think that was the only choice.

Is there a simple way to find the list index to the max value?

2010-02-16 Thread W. eWatson
See Subject. a = [1,4,9,3]. Find max, 9, then index to it, 2. -- http://mail.python.org/mailman/listinfo/python-list

Looking for a Compiled Demo of MPL (matplotlib) Graphics

2010-02-15 Thread W. eWatson
Does anyone know where I can find a compiled demo that uses MPL graphics? I'd like, if possible, a Win version whose size is less than 10M, so that I can send it via e-mail, if necessary. It should use plot, so that someone can manipulate the plot with the navigation controls. At this point, I

Re: Tangling with mathplotlib(MPL) on XP and Win7 -- show() stopper

2010-02-10 Thread W. eWatson
Solved. I need to get into the interactive mode. Never heard of it until this morning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Error: Permission Denied (Firewall)

2010-02-09 Thread W. eWatson
(corrected typos) I decided to go with outbound in McAfee. Now when I run the program, I get a long list of messages about deprecations and NumpyTest will be removed in the next release. please update code to nose or unittest. -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Error: Permission Denied

2010-02-09 Thread W. eWatson
I decided to go with outbound. Now when I run the program, I get a long of messabge about deprecations and NumpyTest will be removed in the next release. please update code to nose or unittest. -- http://mail.python.org/mailman/listinfo/python-list

Socket Error: Permission Denied

2010-02-08 Thread W. eWatson
I'm using IDLE with winxp. It seems every day I get into the Subject above. Usually, after 5-8 minutes I get past it. A msg appearing at the same time say, IDLE's subprocess didn't make connect. ... possible firewall problem. A resource for this is http://bugs.python.org/issue6941. There a

Re: Socket Error: Permission Denied

2010-02-08 Thread W. eWatson
On 2/8/2010 7:24 PM, W. eWatson wrote: I'm using IDLE with winxp. It seems every day I get into the Subject above. Usually, after 5-8 minutes I get past it. A msg appearing at the same time say, IDLE's subprocess didn't make connect. ... possible firewall problem. A resource for this is http

Tangling with mathplotlib(MPL) on XP and Win7 -- show() stopper

2010-02-08 Thread W. eWatson
I'm doing most of this on a win7 machine. When I installed MPL, I had two small dialogs appear that said something was missing, but I pressed on. MPL seemed to generally work except for the show() problem. When it was to be executed to show the output of plot(x,y), it did just that; however,

How Uninstall MatPlotLib?

2010-02-06 Thread W. eWatson
See Subject. -- http://mail.python.org/mailman/listinfo/python-list

Drawing a zig-zag Trail in Python?

2010-02-05 Thread W. eWatson
I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? -- http://mail.python.org/mailman/listinfo/python-list

Re: How Uninstall MatPlotLib?

2010-02-05 Thread W. eWatson
On 2/5/2010 8:17 AM, W. eWatson wrote: See Subject. I'm working in IDLE in Win7. It seems to me it gets stuck in site-packages under C:\Python25. Maybe this is as simple as deleting the entry? Well, yes there's a MPL folder under site-packages and an info MPL file of 540 bytes

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread W. eWatson
On 2/5/2010 9:30 AM, Grant Edwards wrote: On 2010-02-05, W. eWatsonwolftra...@invalid.com wrote: I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL?

Exiting a Program Running in Idle, Various Choices

2010-02-04 Thread W. eWatson
I I have a very simple program running in Python, with say the last line print bye. it finishes leaving the script showing in the shell window. The program proceeds linearly to the bottom line. Suppose now I have instead a few lines of MatPlotLib code (MPL) like this at the end: ...

What's the Scoop on \\ for Paths? (Win)

2010-01-31 Thread W. eWatson
I'm sure that \\ is used in some way for paths in Win Python, but I have not found anything after quite a search. I even have a six page pdf on a file tutorial. Nothing. Two books. Nothing. When I try to open a file along do I need, for example, Events\\record\\year\\today? Are paths like,

Re: What's the Scoop on \\ for Paths? (Win)

2010-01-31 Thread W. eWatson
Alf P. Steinbach wrote: * W. eWatson: I'm sure that \\ is used in some way for paths in Win Python, but I have not found anything after quite a search. I even have a six page pdf on a file tutorial. Nothing. Two books. Nothing. When I try to open a file along do I need, for example, Events

Re: What's the Scoop on \\ for Paths? (Win)

2010-01-31 Thread W. eWatson
Steve Holden wrote: You need to read up on string literals is all. \\ is simply the literal representation of a string containing a single backslash. This comes about because string literals are allowed to contain special escape sequences which are introduced by a backslash; since this gives

py2exe and pydocs. Downloads?

2010-01-17 Thread W. eWatson
I'm using Python 2.5 under windows, and IDLE. Do py2exe and pydocs come with the package, or do I have to download them? -- http://mail.python.org/mailman/listinfo/python-list

Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread W. eWatson
See Subject. The code is below with a few changes I made at the bottom by inserting import string import numpy module = raw_input(Enter module name: ) listing(module) I thought I'd see if I could convert this to a program instead, which asks the user for the module. As

Re: Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread W. eWatson
Chris Rebert wrote: On Sun, Jan 17, 2010 at 12:11 PM, W. eWatson wolftra...@invalid.com wrote: See Subject. The code is below with a few changes I made at the bottom by inserting import string import numpy module = raw_input(Enter module name: ) listing(module) As the error says

IDLE Namespace Toolbox? Windows.

2010-01-17 Thread W. eWatson
This is a follow up to my post Changing Lutz's mydir. It would seem there should be some sort of toolbox that allows one to do things like mydir, and perhaps a lot more. Maybe something like it exists in Linux. I'm a Windows user. I've found it a bit aggravating that using dir and help, for

Re: py2exe and pydocs. Downloads?

2010-01-17 Thread W. eWatson
Gabriel Genellina wrote: En Sun, 17 Jan 2010 15:16:17 -0300, W. eWatson wolftra...@invalid.com escribió: I'm using Python 2.5 under windows, and IDLE. Do py2exe and pydocs come with the package, or do I have to download them? py2exe has to be downloaded from www.py2exe.org I don't know

Re: IDLE Namespace Toolbox? Windows.

2010-01-17 Thread W. eWatson
John Bokma wrote: W. eWatson wolftra...@invalid.com writes: This is a follow up to my post Changing Lutz's mydir. It would seem there should be some sort of toolbox that allows one to do things like mydir, and perhaps a lot more. Maybe something like it exists in Linux. I'm a Windows user

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-16 Thread W. eWatson
D'Arcy J.M. Cain wrote: On Fri, 15 Jan 2010 20:17:35 -0800 W. eWatson wolftra...@invalid.com wrote: Could be, but I have no way of easily knowing. In any case, I was trying to write a simple report that could be printed with titles at the top of each page. If there's another common format

chr(12) Form Feed in Notepad

2010-01-15 Thread W. eWatson
I thought I'd put a page break, chr(12), character in a txt file I wrote to skip to the top of the page. It doesn't work. Comments? -- http://mail.python.org/mailman/listinfo/python-list

Re: chr(12) Form Feed in Notepad

2010-01-15 Thread W. eWatson
Grant Edwards wrote: On 2010-01-15, W. eWatson wolftra...@invalid.com wrote: I thought I'd put a page break, chr(12), character in a txt file I wrote to skip to the top of the page. It doesn't work. Comments? Yes, it does work. Apparently not with with my Brother 1440 laser printer

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread W. eWatson
Tim Chase wrote: W. eWatson wrote: Grant Edwards wrote: On 2010-01-15, W. eWatson wolftra...@invalid.com wrote: I thought I'd put a page break, chr(12), character in a txt file I wrote to skip to the top of the page. It doesn't work. Comments? Yes, it does work. Apparently not with with my

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread W. eWatson
Tim Chase wrote: W. eWatson wrote: Tim Chase wrote: The pseudo-pipeline comparison would be type file.txt lpt1: which would send the raw text file to the printer (assuming it's set up on LPT1, otherwise, use whatever port it's attached to in your printer control panel); or are you using

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread W. eWatson
Mensanator wrote: On Jan 15, 6:40 pm, W. eWatson wolftra...@invalid.com wrote: Tim Chase wrote: W. eWatson wrote: Tim Chase wrote: ... program. From Google, The Graphics Device Interface (GDI). Have you considered the possibility that your printer can't print raw text files? I had one

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread W. eWatson
Neil Hodgson wrote: W. eWatson wrote: I am writing a txt file. It's up to the user to print it using Notepad or some other tool. WordPad will interpret chr(12) as you want. Neil That may be the solution. Just tell the end user to copy the file into it, and print it there. I

Re: Fractional Hours from datetime?

2010-01-12 Thread W. eWatson
Ben Finney wrote: Alf P. Steinbach al...@start.no writes: And considering this, and the fact that Google's archive is now the main Usenet archive, message id's are not that useful, really. You've demonstrated only that Google is an unreliable Usenet archive. One doesn't even need to use

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
+ arizona_utc_offset) % 24 dt.timetuple()[6] is the day of the week; struct tm_time doesn't include a sub-second field. On Jan 10, 10:28 am, W. eWatson wolftra...@invalid.com wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Martin P. Hellwig wrote: Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Martin P. Hellwig wrote: Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Ben Finney wrote: W. eWatson wolftra...@invalid.com writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Message-ID for that message? Sort

Fractional Hours from datetime?

2010-01-10 Thread W. eWatson
Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour --

Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. -- http://mail.python.org/mailman/listinfo/python-list

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
W. eWatson wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. It looks like I've entered a new era in my knowledge of Python. I found a module

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
Roy Smith wrote: In article hi2o39$hm...@news.eternal-september.org, W. eWatson wolftra...@invalid.com wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
John Machin wrote: On Jan 7, 11:40 am, W. eWatson wolftra...@invalid.com wrote: W. eWatson wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations

Potential Conflicts by Installing Two Versions of Python (Windows)?

2010-01-01 Thread W. eWatson
I suspect that if one installs v2.4 and 2.5, or any two versions, that one will dominate, or there will be a conflict. I suppose it would not be possible to choose which one should be used. Comments? -- http://mail.python.org/mailman/listinfo/python-list

mod, modulo and % under 2.4 and 2.5

2009-12-31 Thread W. eWatson
About a year ago, I wrote a program that used mod() for modulo under 2.5. Apparently, % is also acceptable, but the program works quite well. I turned the program over to someone who is using 2.4, and apparently 2.4 knows nothing about mod(). Out of curiosity, what library is mod(a,b)(two

Re: mod, modulo and % under 2.4 and 2.5

2009-12-31 Thread W. eWatson
Steven D'Aprano wrote: On Thu, 31 Dec 2009 17:30:20 -0800, W. eWatson wrote: About a year ago, I wrote a program that used mod() for modulo under 2.5. Apparently, % is also acceptable, but the program works quite well. I turned the program over to someone who is using 2.4, and apparently 2.4

Re: mod, modulo and % under 2.4 and 2.5

2009-12-31 Thread W. eWatson
Ben Finney wrote: W. eWatson wolftra...@invalid.com writes: Steven D'Aprano wrote: NameError: name 'mod' is not defined So where is it? Here are the choices. import sys, os, glob import string from numpy import * If you use ‘from foo import *’ you forfeit any way of saying where a name

DST and datetime

2009-12-30 Thread W. eWatson
Try this. It works for me and my application. =Program from datetime import datetime, timedelta import time DST_dict = { # West coast, 8 hours from Greenwich for PST 2007:(2007/03/11 02:00:00, 2007/11/04 02:00:00), 2008:(2008/03/09 02:00:00,

Re: Difference Between Two datetimes

2009-12-29 Thread W. eWatson
This is quirky. t1=datetime.datetime.strptime(20091205_221100,%Y%m%d_%H%M%S) t1 datetime.datetime(2009, 12, 5, 22, 11) type(t1) type 'datetime.datetime' t1: 2009-12-05 22:11:00 type 'datetime.datetime' but in the program: import datetime

Re: Difference Between Two datetimes

2009-12-29 Thread W. eWatson
Peter Otten wrote: W. eWatson wrote: This is quirky. t1=datetime.datetime.strptime(20091205_221100,%Y%m%d_%H%M%S) t1 datetime.datetime(2009, 12, 5, 22, 11) type(t1) type 'datetime.datetime' t1: 2009-12-05 22:11:00 type 'datetime.datetime' but in the program: import datetime

Re: Windows, IDLE, __doc_, other

2009-12-29 Thread W. eWatson
Lie Ryan wrote: On 12/29/2009 5:10 AM, W. eWatson wrote: Lie Ryan wrote: If you're on Windows, don't use the Edit with IDLE right-click hotkey since that starts IDLE without subprocess. Use the shortcut installed in your Start menu. When I go to Start and select IDLE, Saves or Opens want

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
BTW, all times are local to my city. Same time zone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Lie Ryan wrote: On 12/28/2009 5:42 PM, W. eWatson wrote: You're right. Y. Works fine. The produces datetime.datetime(2009, 1, 2, 13, 1, 15). If I now use t2=datetime.datetime.strptime(2009/01/04 13:01:15,%Y/%m/%d %H:%M:%S) I get tw as datetime.datetime(2009, 1, 4, 13, 1, 15) Then t2-t1 gives

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Roy Smith wrote: In article hh9k6g$pk...@news.eternal-september.org, W. eWatson wolftra...@invalid.com wrote: BTW, all times are local to my city. Same time zone. Yes, but how much time has elapsed between 2009/0/04 13:01:15 and 2009/06/04 13:01:15? Even if I tell you that both timestamps

Re: Windows, IDLE, __doc_, other

2009-12-28 Thread W. eWatson
It the IDLE shell, it's not possible to retrieve lines entered earlier without copying them. Is there an edit facility? I suggest you download a programmers' editor (like Notepad++ or PsPad) for programming work and use the basic Python interpreter for interactive work. The basic

Re: Windows, IDLE, __doc_, other

2009-12-28 Thread W. eWatson
Lie Ryan wrote: On 12/22/2009 12:06 PM, W. eWatson wrote: ... You must be starting IDLE without subprocess. Did you see this message IDLE 2.6.1 No Subprocess when starting IDLE. Yes, I usually start in a folder where I have my py program files, and do a right-click for IDLE

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
D'Arcy J.M. Cain wrote: On Mon, 28 Dec 2009 08:20:28 -0800 W. eWatson wolftra...@invalid.com wrote: Sort of the opposite of a stopped clock. It's right twice a day. How does one solve the DST problem? Depends on which DST problem you have. There is more than one solution depending on what

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Ben Finney wrote: W. eWatson wolftra...@invalid.com writes: Lie Ryan wrote: what's strange about it? the difference between 2009/01/02 13:01:15 and 2009/01/04 13:01:15 is indeed 2 days... Can you elaborate what do you mean by 'strange'? Easily. In one case, it produces a one argument

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Steven D'Aprano wrote: On Mon, 28 Dec 2009 23:50:30 +1100, Ben Finney wrote: How does one unload this structure to get the seconds and days? It's customary to consult the documentation for questions like that URL:http://docs.python.org/library/datetime.html#datetime.timedelta. No no no,

Difference Between Two datetimes

2009-12-27 Thread W. eWatson
According to one web source, this program: import datetime bree = datetime.datetime(1981, 6, 16, 4, 35, 25) nat = datetime.datetime(1973, 1, 18, 3, 45, 50) difference = bree - nat print There were, difference, minutes between Nat and Bree yields: There were 3071 days, 0:49:35 minutes between

Re: Difference Between Two datetimes

2009-12-27 Thread W. eWatson
: In article hh9dmv$f9...@news.eternal-september.org, W. eWatson wolftra...@invalid.com wrote: t1=datetime.datetime.strptime(2009/01/02 13:01:15,%y/%m/%d %H:%M:%S) doesn't do it. ValueError: time data did not match format: data=2009/01/02 13:01:15 fmt=%y/%m/%d %H:%M:%S The first thing

Re: Difference Between Two datetimes

2009-12-27 Thread W. eWatson
Ben Finney wrote: W. eWatson wolftra...@invalid.com writes: How do I get the strings into a shape that will accommodate a difference? For example, t1=datetime.datetime.strptime(2009/01/02 13:01:15,%y/%m/%d %H:%M:%S) doesn't do it. ValueError: time data did not match format: data=2009/01/02

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Lie Ryan wrote: On 12/21/2009 1:19 PM, W. eWatson wrote: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. \nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3

Re: Live Video Capture using Python

2009-12-21 Thread W. eWatson
David Lyon wrote: Also try.. http://www.unixuser.org/~euske/python/vnc2flv/index.html On Mon, 21 Dec 2009 11:15:32 +0530, Banibrata Dutta banibrata.du...@gmail.com wrote: Have you searched the archives of this list ? I remember seeing a related discussion 5-6 months back. On Mon, Dec 21,

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Lie Ryan wrote: On 12/22/2009 6:39 AM, W. eWatson wrote: Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and a little window came up showing it was about to print hundreds of pages. I can canceled it, but too late. I turned off my printer quickly and eventually stopped

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 1:51 PM, W. eWatson wolftra...@invalid.com wrote: Lie Ryan wrote: On 12/22/2009 6:39 AM, W. eWatson wrote: Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and No, its not true. A built-in module does not mean its available

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 2:57 PM, W. eWatson wolftra...@invalid.com wrote: This has got to be some sort of IDLE issue then. Huh? How do you figure? When I run a simple program. If I open this program in the IDLE editor: #import math print hello, math world. print cos

Windows, IDLE, __doc_, other

2009-12-20 Thread W. eWatson
When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. \nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, Fourier Transforms, Random Number ... Is

<    1   2   3   4   5   >