Re: Help

2016-03-04 Thread Tom P
On 02/29/2016 01:53 PM, tomwilliamson...@gmail.com wrote: Thanks. If a word appears more than once how would I bring back both locations? for i, str in enumerate(l): . . . . -- https://mail.python.org/mailman/listinfo/python-list

Re: problem with dateutil

2016-02-14 Thread Tom P
On 02/13/2016 09:45 PM, Gary Herron wrote: On 02/13/2016 12:27 PM, Tom P wrote: On 02/13/2016 07:13 PM, Gary Herron wrote: On 02/13/2016 09:58 AM, Tom P wrote: I am writing a program that has to deal with various date/time formats and convert these into timestamps. It looks as if

Re: problem with dateutil

2016-02-14 Thread Tom P
On 02/13/2016 10:01 PM, Mark Lawrence wrote: On 13/02/2016 17:58, Tom P wrote: I am writing a program that has to deal with various date/time formats and convert these into timestamps. It looks as if dateutil.parser.parse should be able to handle about any format, but what I get is

Re: problem with dateutil

2016-02-13 Thread Tom P
On 02/13/2016 07:13 PM, Gary Herron wrote: On 02/13/2016 09:58 AM, Tom P wrote: I am writing a program that has to deal with various date/time formats and convert these into timestamps. It looks as if dateutil.parser.parse should be able to handle about any format, but what I get is

problem with dateutil

2016-02-13 Thread Tom P
I am writing a program that has to deal with various date/time formats and convert these into timestamps. It looks as if dateutil.parser.parse should be able to handle about any format, but what I get is: datetimestr = '2012-10-22 11:22:33' print(dateutil.parser.parse(datetimestr)) result: date

Re: Nearest neighbours of points

2015-10-31 Thread Tom P
On 10/24/2015 10:05 PM, Poul Riis wrote: I have N points in 3D, organized in a list. I want to to point out the numbers of the two that have the smallest distance. With scipy.spatial.distance.pdist I can make a list of all the distances, and I can point out the number of the minimum value of th

Re: problem with netCDF4 OpenDAP

2015-08-14 Thread Tom P
On 08/14/2015 03:15 PM, Jason Swails wrote: On Aug 14, 2015, at 3:18 AM, Tom P wrote: Thanks for the reply but that is not what the documentation says. http://unidata.github.io/netcdf4-python/#section8 "Remote OPeNDAP-hosted datasets can be accessed for reading over http if a UR

Re: problem with netCDF4 OpenDAP

2015-08-14 Thread Tom P
On 08/13/2015 05:55 PM, Jason Swails wrote: On Thu, Aug 13, 2015 at 6:32 AM, Tom P mailto:werot...@freent.dd>> wrote: I'm having a problem trying to access OpenDAP files using netCDF4. The netCDF4 is installed from the Anaconda package. According to their changelog,

problem with netCDF4 OpenDAP

2015-08-13 Thread Tom P
I'm having a problem trying to access OpenDAP files using netCDF4. The netCDF4 is installed from the Anaconda package. According to their changelog, openDAP is supposed to be supported. netCDF4.__version__ Out[7]: '1.1.8' Here's some code: url = 'http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/

Re: want to learn python

2015-04-24 Thread Tom P
On 04/21/2015 12:57 PM, pm05...@gmail.com wrote: Hello everyone, I am willing to learn Python from scratch.Please he me to learn.Although I hv knowledge of c and object oriented programming. Apart from the various tutorials you might want to look at the on-line courses offered by Coursera a

Re: Python code in presentations

2014-09-30 Thread Tom P
On 30.09.2014 13:50, Jean-Michel Pichavant wrote: Hello list, I'm currently writing a presentation to help my co-workers ramp up on new features of our tool (written in python (2.7)). I have some difficulties presenting code in an efficient way (with some basic syntax highlights). I need to b

Re: Convert numpy array to single number

2014-04-29 Thread Tom P
On 28.04.2014 15:04, mboyd02...@gmail.com wrote: I have a numpy array consisting of 1s and zeros for representing binary numbers: e.g. >>> binary array([ 1., 0., 1., 0.]) I wish the array to be in the form 1010, so it can be manipulated. I do not want to use built in binary con

numpy masked array puzzle

2013-11-17 Thread Tom P
I have two numpy arrays, xx and yy - (Pdb) xx array([0.7820524520874, masked, masked, 0.3700476837158, 0.7252384185791, 0.6002384185791, 0.6908474121094, 0.7878760223389, 0.6512288818359, 0.1110143051147, masked, 0.716205039978, 0.546038

[solved]Re: Python PDB conditional breakpoint

2013-11-06 Thread Tom P
On 06.11.2013 16:14, Tom P wrote: ok I figured it. ID is a tuple, not a simple variable. The correct test is ID[0]==11005 I can't get conditional breakpoints to work. I have a variable ID and I want to set a breakpoint which runs until ID==11005. Here's what happens -

Python PDB conditional breakpoint

2013-11-06 Thread Tom P
I can't get conditional breakpoints to work. I have a variable ID and I want to set a breakpoint which runs until ID==11005. Here's what happens - -> import sys ... (Pdb) b 53, ID==11005 Breakpoint 1 at /home/tom/Desktop/BEST Tmax/MYSTUFF/sqlanalyze3.py:53 (Pdb) b Num Type Disp Enb W

Re: Can I trust downloading Python?

2013-09-10 Thread Tom P
On 10.09.2013 11:45, Oscar Benjamin wrote: On 10 September 2013 01:06, Steven D'Aprano wrote: On Mon, 09 Sep 2013 12:19:11 +, Fattburger wrote: But really, we've learned *nothing* from the viruses of the 1990s. Remember when we used to talk about how crazy it was to download code from untr

Google App Engine dev_appserver and pdb?

2013-05-30 Thread Tom P
Is there a way to use pdb to debug Google apps written in Python? When I start the development system to run the app "test" like this - './google_appengine/dev_appserver.py' './test' - I'd like to send the program into debug. I couldn't see anything in the documentation how to do this. If I do

HTTPServer again

2013-04-22 Thread Tom P
Hi, a few weeks back I posed a question about passing static data to a request server, and thanks to some useful suggestions, got it working. I see yesterday there is a suggestion to use a framework like Tornado rather than base classes. However I can't figure achieve the same effect using To

Re: The SOLUTION HTTPserver: how to access variables of a higher class

2013-04-06 Thread Tom P
On 04/05/2013 01:02 PM, Tom P wrote: ok, after much experimenting it looks like the solution is as follows: class MyWebServer(object): def __init__(self): # self.foo = "foo" delete these from self # self.bar = "bar" myServer = HTTPServer

Re: HTTPserver: how to access variables of a higher class?

2013-04-06 Thread Tom P
On 04/05/2013 02:27 PM, Dylan Evans wrote: On 05/04/2013 9:09 PM, "Tom P" wrote: First, here's a sample test program: import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyRequestHandler(BaseHTTPRequestHandler, object): def do_GET(self):

Re: HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Tom P
On 04/05/2013 01:54 PM, Dave Angel wrote: On 04/05/2013 07:02 AM, Tom P wrote: First, here's a sample test program: import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyRequestHandler(BaseHTTPRequestHandler, object): def do_GET(self): top_self =

Re: HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Tom P
On 04/05/2013 01:54 PM, Dave Angel wrote: On 04/05/2013 07:02 AM, Tom P wrote: First, here's a sample test program: import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyRequestHandler(BaseHTTPRequestHandler, object): def do_GET(self): top_self =

Re: HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Tom P
On 04/05/2013 02:27 PM, Dylan Evans wrote: On 05/04/2013 9:09 PM, "Tom P" wrote: First, here's a sample test program: import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyRequestHandler(BaseHTTPRequestHandler, object): def do_GET(self):

HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Tom P
First, here's a sample test program: import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyRequestHandler(BaseHTTPRequestHandler, object): def do_GET(self): top_self = super(MyRequestHandler, self) # try to access MyWebServer instance self.send_re

Re: The usage of -m option of python

2013-03-27 Thread Tom P
On 03/18/2013 10:17 PM, Peng Yu wrote: Hi, I don't quite understand how -m option is used. And it is difficult to search for -m in google. Could anybody provide me with an example on how to use this option? Thanks! -m module-name Searches sys.path for the named module and

Re: Uniquely identifying each & every html template

2013-01-21 Thread Tom P
On 01/21/2013 01:39 PM, Oscar Benjamin wrote: On 21 January 2013 12:06, Ferrous Cranus wrote: Τη Δευτέρα, 21 Ιανουαρίου 2013 11:31:24 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: Seriously, you're asking for something that's beyond the power of humans or computers. You want to identify that

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 08:29 PM, Grant Edwards wrote: On 2012-08-06, Grant Edwards wrote: On 2012-08-06, Tom P wrote: On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 06:03 PM, John Gordon wrote: In Tom P writes: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N and j = M,

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other val

looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N and j = M, and I want to iterate through all 10,000 values in sequence - is there a neat py

Re: Newbie question on python programming

2012-07-21 Thread Tom P
On 07/21/2012 02:30 AM, Ian Kelly wrote: On Fri, Jul 20, 2012 at 5:38 PM, Chris Williams wrote: Hello I hope this is the right newsgroup for this post. I am just starting to learn python programming and it seems very straightforward so far. It seems, however, geared toward doing the sort of p