Re: Interpolating/crossfading a stack of matrices

2013-01-09 Thread Oscar Benjamin
On 9 January 2013 16:02, wrote: > Hi, > > I want to interpolate (with quadratic splines) a stack of 2D-arrays/matrices > y1, y2, y3, ... in a third dimension (which I call x) e.g. for crossfading > images. I already have a working code which unfortunately still contains two > explicit loops ov

Re: average time calculation??

2013-01-10 Thread Oscar Benjamin
On 10 January 2013 17:50, pmec wrote: > Hi there guys i've got a script that's suppose to find the average of two > times as strings. The times are in minutes:seconds:milliseconds > i'm doing ok in printing the right minutes and seconds my problem is with the > milliseconds. You might find it e

Re: average time calculation??

2013-01-10 Thread Oscar Benjamin
Two quick corrections to what I wrote... On 10 January 2013 18:13, Oscar Benjamin wrote: > On 10 January 2013 17:50, pmec wrote: >> Hi there guys i've got a script that's suppose to find the average of two >> times as strings. The times are in minutes:seconds:millis

Re: problem with exam task for college

2013-01-13 Thread Oscar Benjamin
On 13 January 2013 13:57, wrote: > this is again a newer version, right now the velocity does in fact turn, but > the view doesn't follow, it keeps the ship vertical. > > i'm also having trouble letting the flame appear when pressing the "up" button > > and when the ship rotates the horizontal v

Re: Subgraph Drawing

2013-01-13 Thread Oscar Benjamin
On 13 January 2013 20:05, wrote: > Dear Group, > > I have two questions, if I take a subseries of the matrix as in eigenvalue > here, > provided I have one graph of the full form in G, how may I show it, as if I > do the nx.draw(G) it takes only the original graph. I'm sorry, but I really don'

Re: Beowulf clusters

2013-01-13 Thread Oscar Benjamin
On 14 January 2013 02:22, Mark Janssen wrote: > On Sun, Jan 13, 2013 at 8:19 PM, Oscar Benjamin > wrote: >> On 14 January 2013 02:10, Mark Janssen wrote: >>> Has anyone used python for high-performance computing on Beowulf clusters? >> >> Yes. > > How di

Re: Beowulf clusters

2013-01-13 Thread Oscar Benjamin
On 14 January 2013 02:46, Mark Janssen wrote: > On Sun, Jan 13, 2013 at 8:37 PM, Oscar Benjamin > wrote: >> On 14 January 2013 02:33, Mark Janssen wrote: >>> Lol, well that's why I'm asking. I don't see how they can do it >>> without considerable

Re: i can't understand decorator

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 14:20, contro opinion wrote: def deco(func): > ... def kdeco(): > ... print("before myfunc() called.") > ... func() > ... print(" after myfunc() called.") > ... return kdeco > ... @deco > ... def myfunc(): > ... print(" myfunc

Re: Is there a more elegant way to handle determing fail status?

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:24, J wrote: > Ok, so I have a diagnostic tool, written by someone else. That tool > runs a series of small tests defined by the user and can simplified > summary output that can be one of the following: > > FAILED_CRITICAL > FAILED_HIGH > FAILED_MEDIUM > FAILED_LOW > PASSED

Re: cymbalic reference?

2013-01-15 Thread Benjamin Kaplan
On Tue, Jan 15, 2013 at 8:56 PM, rh wrote: > I have this working and I am curious to know how others do same. > > class Abc(object): > def __init__(self): > pass > def good(self): > print "Abc good" > def better(self): > print "Abc better" > > urls = {'Abc':'htt

Re: Uniquely identifying each & every html template

2013-01-21 Thread Oscar Benjamin
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 something's the same >> file, without

Re: Uniquely identifying each & every html template

2013-01-21 Thread Oscar Benjamin
On 21 January 2013 23:01, Tom P wrote: > 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 έγραψε: >>>

Re: Understanding while...else...

2013-01-22 Thread Oscar Benjamin
On 22 January 2013 23:41, Terry Reedy wrote: > On 1/22/2013 3:09 PM, Ethan Furman wrote: >> >> On 01/22/2013 09:44 AM, Terry Reedy wrote: >>> [SNIP] >>> The else clause is executed if and when the condition is false. >>> Now use a real Python while statement to do the *same >>> thing*. >>> >>> whi

Re: Retrieving the full command line

2013-01-22 Thread Oscar Benjamin
On 22 January 2013 23:46, Steven D'Aprano wrote: [SNIP] > > I am a bit disturbed that you cannot distinguish between: > > python C:\something\on\pythonpath\app\__main__.py > > python -m app > > > by inspecting the command line. I consider it a bug, or at least a > misfeature, if Python transforms

Re: Retrieving the full command line

2013-01-22 Thread Oscar Benjamin
On 22 January 2013 09:24, Tim Golden wrote: > [Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific, > though]. > > I use the python -mpackage incantation to run a package which has a > __main__.py module and which uses relative imports internally. > > I'm developing under cherrypy

Re: Retrieving the full command line

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 03:58, Steven D'Aprano wrote: > On Wed, 23 Jan 2013 00:53:21 +, Oscar Benjamin wrote: > >> On 22 January 2013 23:46, Steven D'Aprano >> wrote: [SNIP] >>> >> The purpose of the -m option is that you can run a script that is >&

Re: Memory error with quadratic interpolation

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 08:55, Ulrich Eckhardt wrote: > Am 23.01.2013 05:06, schrieb Isaac Won: > >> I have tried to use different interpolation methods with Scipy. My >> code seems just fine with linear interpolation, but shows memory >> error with quadratic. I am a novice for python. I will appreciat

Re: Increase value in hash table

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 07:26, moonhkt wrote: > Hi Al > > I have Data file have below > > Data file > V1 > V2 > V3 > V4 > V4 > V3 > > How to using count number of data ? > > Output > V1 = 1 > V2 = 1 > V3 =2 > V4 = 2 > > > > # Global Veriable > printque = {} > in def have below > > printque[val] = prin

Re: Understanding while...else...

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 11:03, René Klačan wrote: > On Wed, Jan 23, 2013 at 1:39 AM, Oscar Benjamin > wrote: You missed off an important piece of context in your post: >> I think he meant that he would use the else clause more often if it >> had the semantics so that the two

Re: Memory error with quadratic interpolation

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 14:28, Isaac Won wrote: > On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > > To Oscar > My actual error message is: > File > "/lustre/work/apps/python-2.7.1/lib/python2.7/site-packages/scipy/interpolate/interpolate.py&quo

Re: Memory error with quadratic interpolation

2013-01-23 Thread Oscar Benjamin
On 23 January 2013 14:57, Isaac Won wrote: > On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: >> On 23 January 2013 14:28, Isaac Won wrote: >> [SNIP] > > Following is full error message after I adjusted following Ulich's advice: > > inter

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 04:49, Steven D'Aprano wrote: [SNIP] > > Contrariwise, I don't believe that there is currently *any* way to > distinguish between running a script with or without -m. That should be > fixed. As I said earlier in the thread, the __package__ module global distinguishes the two ca

Re: Memory error with quadratic interpolation

2013-01-24 Thread Oscar Benjamin
On 23 January 2013 17:33, Isaac Won wrote: > On Wednesday, January 23, 2013 10:51:43 AM UTC-6, Oscar Benjamin wrote: >> On 23 January 2013 14:57, Isaac Won wrote: >> >> > On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: >> >> Unless I&#

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 10:56, Tim Golden wrote: > On 24/01/2013 10:06, Oscar Benjamin wrote: >> On 24 January 2013 04:49, Steven D'Aprano >> wrote: >> [SNIP] >>> >>> Contrariwise, I don't believe that there is currently *any* way to >>> dis

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 13:45, Tim Golden wrote: > On 24/01/2013 11:30, Oscar Benjamin wrote: >> I don't really understand what your spec is. Why do you need to >> inspect this information from sys.argv? Can you not just always use >> 'python -m pkg' as your entry

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 15:51, Tim Golden wrote: > On 24/01/2013 15:28, Oscar Benjamin wrote: >> On 24 January 2013 13:45, Tim Golden wrote: >>> On 24/01/2013 11:30, Oscar Benjamin wrote: >>>> I don't really understand what your spec is. Why do you need to >>

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 16:08, Oscar Benjamin wrote: > On 24 January 2013 15:51, Tim Golden wrote: >> On 24/01/2013 15:28, Oscar Benjamin wrote: >>> On 24 January 2013 13:45, Tim Golden wrote: >>>> On 24/01/2013 11:30, Oscar Benjamin wrote: >>>>> I don&

Re: Retrieving the full command line

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 17:13, Tim Golden wrote: > On 24/01/2013 16:53, Oscar Benjamin wrote: >>> Does it work if you use the -m option to run a module rather than a script? >> >> Sorry that was written incorrectly. I meant to say: does it work when >> a module is directl

Re: Dict comp help

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 20:58, Joseph L. Casale wrote: > Hi, > Slightly different take on an old problem, I have a list of dicts, I need to > build one dict > from this based on two values from each dict in the list. Each of the dicts > in the list have > similar key names, but values of course diffe

Re: using split for a string : error

2013-01-24 Thread Oscar Benjamin
On 24 January 2013 11:35, Chris Angelico wrote: > > It's usually fine to have int() complain about any non-numerics in the > string, but I must confess, I do sometimes yearn for atoi() semantics: > atoi("123asd") == 123, and atoi("qqq") == 0. I've not seen a > convenient Python function for doing

Re: using split for a string : error

2013-01-24 Thread Oscar Benjamin
On 25 January 2013 01:11, Chris Angelico wrote: > On Fri, Jan 25, 2013 at 12:03 PM, Oscar Benjamin > wrote: >> On 24 January 2013 11:35, Chris Angelico wrote: >>> >>> It's usually fine to have int() complain about any non-numerics in the >>> string,

Re: Reading file issue

2013-01-28 Thread Oscar Benjamin
On 28 January 2013 11:47, loial wrote: > I am parseing a file to extract data, but am seeing the file being updated > even though I never explicitly write to the file. It is possible that another > process is doing this at some later time, but I just want to check that > opening the file as fol

Re: derived class name in python 2.6/2.7

2013-01-30 Thread Oscar Benjamin
On 30 January 2013 20:05, Sells, Fred wrote: > This is simple, but I just cannot find it after quite a bit of searching > > I have this basic design > > class A: > def __init__(self): > print 'I am an instance of ', self.__class__.name Did you mean to use __name__ instead

Re: Using an object inside a class

2012-01-23 Thread Benjamin Kaplan
On Mon, Jan 23, 2012 at 4:22 PM, Jonno wrote: > > > On Mon, Jan 23, 2012 at 2:25 PM, Terry Reedy wrote: >> >> On 1/23/2012 2:44 PM, Jonno wrote: >>> >>> I have a pretty complicated bit of code that I'm trying to convert to >>> more clean OOP. >>> >>> Without getting too heavy into the details I h

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Benjamin Kaplan
On Feb 16, 2012 10:25 AM, "Michael Torrie" wrote: > > On 02/16/2012 07:53 AM, 8 Dihedral wrote: > > The law suites of JAVA Vitrtual Machine from Oracle > > are famous now. But in 201X the JVM patents will be > > expired, thus it is not very urgent to chunk out a new jython now. Anyway just wri

Re: Python math is off by .000000000000045

2012-02-22 Thread Benjamin Kaplan
On Feb 22, 2012 1:16 PM, "Alec Taylor" wrote: > > Simple mathematical problem, + and - only: > > >>> 1800.00-1041.00-555.74+530.74-794.95 > -60.9500045 > > That's wrong. > > Proof > http://www.wolframalpha.com/input/?i=1800.00-1041.00-555.74%2B530.74-794.95 > -60.95 aka (-(1219/20)) > > Is

[RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-25 Thread Benjamin Peterson
/ With regards, The Python release team Barry Warsaw (2.6), Georg Brandl (3.2), Benjamin Peterson (2.7 and 3.1) [1] http://www.ocert.org/advisories/ocert-2011-003.html [2] http://bugs.python.org/issue13703 -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-27 Thread Benjamin Peterson
Ben Finney benfinney.id.au> writes: > > Putting “RELEASED” in the subject, when they're not released and are > instead *candidates for* release, is confusing and muddies the issue of > what you even mean by “release”. > {alpha, beta, release candidate, final} \subsetof releases -- http://mai

Re: How can I make an instance of a class act like a dictionary?

2012-02-27 Thread Benjamin Kaplan
On Mon, Feb 27, 2012 at 3:09 PM, John Salerno wrote: > On Feb 27, 1:39 am, Chris Rebert wrote: >> On Sun, Feb 26, 2012 at 11:24 PM, John Salerno wrote: >> > Hi everyone. I created a custom class and had it inherit from the >> > "dict" class, and then I have an __init__ method like this: >> >> >

Re: What's the best way to write this regular expression?

2012-03-07 Thread Benjamin Kaplan
On Wed, Mar 7, 2012 at 4:11 PM, John Salerno wrote: > > On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly wrote: > > > There is a fork of setuptools called "distribute" that supports Python > > 3. > > Thanks, I guess I'll give this a try tonight! > > > setup.py is a file that should be included at the to

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Benjamin Peterson
Peter Kleiweg xs4all.nl> writes: > Not yet using fp in any way, this script gives the following error: > > Exception ValueError: 'underlying buffer has been detached' in You're probably using print() or some such which tries to write to sys.stdout. It's safest to just write to sys.stdout.buf

Re: Installing Python Apps on Mac Lion

2012-03-13 Thread Benjamin Kaplan
On Tue, Mar 13, 2012 at 12:42 PM, wrote: > > Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu: > > The Lion version of the OS on the Mac comes with Python 2.7 installed, > > but it is in /System/Library/Frameworks/..., and this area is not writable > > by third party apps. > > > > So

[RELEASED] Second release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-03-18 Thread Benjamin Peterson
ses/3.1.5/ http://python.org/download/releases/3.2.3/ Please test these candidates and report bugs to http://bugs.python.org/ With regards, The Python release team Barry Warsaw (2.6), Georg Brandl (3.2), Benjamin Peterson (2.7 and 3.1) [1] http://www.ocert.org/advisories/ocert-2011-003.h

Re: Run once while loop

2012-04-04 Thread Benjamin Kaplan
On Wed, Apr 4, 2012 at 9:21 AM, Anatoli Hristov wrote: > I thing the best will be if I use hundreds of the seconds to print the > message. > > for example at 12:00:00:10, but unfortunately I cant see that I can use > hundreds of the seconds. > > Does anyone knows if I can use it ? > > Thanks > > A

Re: Question on Python 3 shell restarting

2012-04-10 Thread Benjamin Kaplan
On Tue, Apr 10, 2012 at 2:36 PM, Franck Ditter wrote: > In article > <19745339.1683.1333981625966.JavaMail.geo-discussion-forums@yncc41>, >  Miki Tebeka wrote: > >> > How may I get a fresh Python shell with Idle 3.2 ? >> Open the configuration panel (Options -> Configure IDLE). >> Look in the "Ke

[RELEASED] Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-04-11 Thread Benjamin Peterson
3.2.3/ As always, please report bugs to http://bugs.python.org/ Happy-to-put-hash-attack-issues-behind-them-ly yours, The Python release team Barry Warsaw (2.6), Georg Brandl (3.2), and Benjamin Peterson (2.7 and 3.1) [1] http://www.ocert.org/advisories/ocert-2011-003.html [2] ht

Re: trac.util

2012-04-11 Thread Benjamin Kaplan
On Wed, Apr 11, 2012 at 4:52 PM, cerr wrote: > > Hi, > > I want to install some python driver on my system that requires trac.util > (from Image.py) but I can't find that anywhere, any suggestions, anyone? > > Thank you very much, any help is appreciated! > > Error: > File "/root/weewx/bin/Image.p

Re: system call that is killed after n seconds if not finished

2012-04-16 Thread Benjamin Kaplan
On Mon, Apr 16, 2012 at 10:51 AM, Jaroslav Dobrek wrote: > > Hello, > > I would like to execute shell commands, but only if their execution > time is not longer than n seconds. Like so: > > monitor(os.system("do_something"), 5) > > I.e. the command do_somthing should be executed by the operating >

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Benjamin Kaplan
On Mon, Apr 23, 2012 at 1:01 PM, Paul Rubin wrote: > > Kiuhnm writes: > > I can't think of a single case where 'is' is ill-defined. > > If I can't predict the output of > >    print (20+30 is 30+20)  # check whether addition is commutative >    print (20*30 is 30*20)  # check whether multiplicati

Re: Some posts do not show up in Google Groups

2012-04-29 Thread Benjamin Kaplan
On Mon, Apr 30, 2012 at 2:20 AM, Frank Millman wrote: > > Hi all > > For a while now I have been using Google Groups to read this group, but on > the odd occasion when I want to post a message, I use Outlook Express, as I > know that some people reject all messages from Google Groups due to the hi

Re: sorting 1172026 entries

2012-05-06 Thread Benjamin Schollnick
ist? You can't organize it by, for example, zip code, area code, year, or something, and make multiple lists? Reducing the size would speed the sort up. 2) Maybe consider a different storage method, for example, adding the data into a database? And then connecting to the database via

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Benjamin Kaplan
On May 14, 2012 7:06 PM, "vacu" wrote: > > I am frustrated to see %d not working in my Python 2.7 re.search, like > this example: > > >>> (re.search('%d', "asdfdsf78asdfdf")).group(0) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'NoneType' object has no attribute

Re: install python 2.6 on Ubuntu 12.04

2012-05-22 Thread Benjamin Kaplan
On Tue, May 22, 2012 at 8:09 PM, Dan Stromberg wrote: > > If the pythons you require are in synaptic (sudo to root and run synaptic), > you probably can just use them. > > If not, then you, for each release, need to: > 1) download a tarball using a browser or whatever > 2) extract the tarball: tar

Re: How to import Webkit and object in Official Python (not MacPorts python) without X11.

2012-05-26 Thread Benjamin Kaplan
On Sat, May 26, 2012 at 9:31 AM, Mr.T Beppu wrote: > I think that I will make a browser in Official Python (not MacPorts > Python). > What should I do in order to install Webkit for Official Python (not > MacPorts Python) ? > from tokyo Japan. > You don't just "install WebKit". You need a GUI fra

Re: Maintaining Multiple Copies of Python (Linux)

2012-05-31 Thread Oscar Benjamin
On 31 May 2012 02:41, Nicholas Fitzkee wrote: > On Wednesday, May 30, 2012 7:55:33 PM UTC-5, Ben Finney wrote: > > > The consensus solution for this is ‘virtualenv’ > > http://pypi.python.org/pypi/virtualenv>. > > > > It is so popular as a solution for the kinds of problems you describe > > that

Re: Object cleanup

2012-05-31 Thread Oscar Benjamin
On 31 May 2012 11:57, psaff...@googlemail.com wrote: > Thanks for all the responses. > > It looks like none of the BeautifulSoup objects have __del__ methods, so I > don't think that can be the problem. > > To answer your other question, guppy was the best match I came up with > when looking for a

Re: ./configure

2012-06-03 Thread Benjamin Kaplan
> > Thanks Alain.  I should have a compiler on my Mac OS X Lion.  I am thinking > that it isn't set in my $PATH variable.  I don't know where the $PATH is set > at.  I will check to see if their is a binary. > -- > http://mail.python.org/mailman/listinfo/python-list You need to install the comma

Re: Installing Mailman

2012-06-03 Thread Benjamin Kaplan
On Mon, Jun 4, 2012 at 12:49 AM, Chris Rebert wrote: > On Sun, Jun 3, 2012 at 9:04 PM, Janet Heath > wrote: >> checking for --with-python... no >> checking for python... /usr/bin/python >> checking Python interpreter... /usr/bin/python >> checking Python version... 2.7.1 >> checking Python's emai

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Benjamin Kaplan
On Mon, Jun 4, 2012 at 11:47 AM, David Shi wrote: > Hello, Mohan, > > Did you test it?  I am using Windows.  Where are the exact steps for > compiling in DOS? > > Once .class or jar files created, how to use these files? > > Could you enlighten me with tested/proven step by step instructions? > >

Re: Interprocess comunication

2012-06-07 Thread Oscar Benjamin
On 7 June 2012 17:04, Julio Sergio wrote: > I'm trying to call an external process to filter some of my data, i.e., I'm > trying to pass some information to the called process, and have this > information > back transformed. I started testing with the linux 'cat' command, in this > way: > > > ->>

Re: Passing ints to a function

2012-06-08 Thread Benjamin Kaplan
On Fri, Jun 8, 2012 at 7:41 PM, stayvoid wrote: > Hello, > > I want to pass several values to a function which is located on a > server (so I can't change its behavior). > That function only accepts five values which must be ints. > > There are several lists: > a = [1, 2, 3, 4, 5] > b = [5, 4, 3,

Decorator Pattern with Iterator

2012-06-11 Thread Oscar Benjamin
On 11 June 2012 08:51, Tom Harris wrote: > Greetings, > > I have a class that implements the iterator protocol, and tokenises a > string into a series of tokens. As well as the token, it keeps track of > some information such as line number, source file, etc. > > for tokens in Tokeniser(): > do

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 1:19 AM, jmfauth wrote: > What is input() supposed to return? > u'a' == 'a' > True r1 = input(':') > :a r2 = input(':') > :u'a' r1 == r2 > False type(r1), len(r1) > (, 1) type(r2), len(r2) > (, 4) > > --- > > sys.argv? > > jmf Python

Small Problem with Weather Underground XML API...

2011-06-05 Thread Benjamin Schollnick
I am working scraping the Weather Underground using the XML interface... I am hoping to to add this into the pywapi, but that looks like it's been abandoned? I haven't seen any updates in ages to it... And I'm using the Weather Underground XML API (http://wiki.wunderground.com/index.php/API_

Has anyone seen any updated versions of pywapi? (Python Weather API)

2011-06-05 Thread Benjamin Schollnick
The Google Code site is at http://code.google.com/p/python-weather-api/ And it's powerful, but I don't see any updates since late 2010... Does anyone know of a different pre-built API for accessing weather information? - Benjamin -- http://mail.python.org/mailman/listinfo/python-list

Re: Has anyone seen any updated versions of pywapi? (Python Weather API)

2011-06-05 Thread Benjamin Schollnick
, assuming I use that toolkit. - Ben -- Sent from my Mobile Communication Device. On Jun 5, 2011, at 10:31 PM, Brian Curtin wrote: > On Sun, Jun 5, 2011 at 19:27, Benjamin Schollnick > wrote: > The Google Code sit

Re: How to import data from MySQL db into excel sheet

2011-06-06 Thread Benjamin Kaplan
On Mon, Jun 6, 2011 at 9:35 AM, Prasad, Ramit wrote: >> Currently i am importing the Database into CSV file using csv module, >>in csv file i need to change the column width according the size of >>the data. i need to set different column width for different columns >>pleas let me know how to achi

Re: In Python 2.x, is it possible to make unicode as default like in Python 3.x?

2011-06-08 Thread Benjamin Kaplan
On Wed, Jun 8, 2011 at 11:22 AM, G00gle and Python Lover wrote: > Hello. > I almost like everything in Python. Code shrinking, logic of processes, > libraries, code design etc. > But, we... - everybody knows that Python 2.x has lack of unicode support. > In Python 3.x, this has been fixed :) And I

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Benjamin Kaplan
On Wed, Jun 8, 2011 at 1:09 PM, Cathy James wrote: > I am almost there, but I need a little help: > > I would like to > > a) print my dogs in the format  index. name: breed as follows: > > 0. Mimi:Poodle > 1.Sunny: Beagle > 2. Bunny: German Shepard > I am getting > > (0, ('Mimi', 'Poodle')) . Mimi

Re: the stupid encoding problem to stdout

2011-06-08 Thread Benjamin Kaplan
2011/6/8 Sérgio Monteiro Basto : > hi, > cat test.py > #!/usr/bin/env python > #-*- coding: utf-8 -*- > u = u'moçambique' > print u.encode("utf-8") > print u > > chmod +x test.py > ./test.py > moçambique > moçambique > > ./test.py > output.txt > Traceback (most recent call last): >  File "./test.py

Re: Python 2.6 OR 3.2

2011-06-10 Thread Benjamin Kaplan
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 wrote: > Andrew Berg wrote: >> >> AFAICT, there are three reasons to learn Python 2: > >   ... there is a fourth reason. > > The linux distro you are using currently was customized with python 2.x > > I ran into this problem this week in fact... on my H

Re: Question About Command line arguments

2011-06-10 Thread Benjamin Kaplan
On Jun 10, 2011 10:26 AM, "Mark Phillips" wrote: > > I have a script that processes command line arguments > > def main(argv=None): > syslog.syslog("Sparkler stared processing") > if argv is None: > argv = sys.argv > if len(argv) != 2: > syslog.syslog(usage()) > els

Re: Question About Command line arguments

2011-06-10 Thread Benjamin Kaplan
On Fri, Jun 10, 2011 at 11:31 AM, Tim Chase wrote: > On 06/10/2011 12:58 PM, Mark Phillips wrote: >> >> How do I write my script so it picks up argument from the >> output of commands that pipe input into my script? > > You can check > >  if os.isatty(sys.stdin):  # <-- this check Any reason for

Re: PyQt

2011-06-10 Thread Benjamin Kaplan
On Fri, Jun 10, 2011 at 12:15 PM, KK wrote: > Thanks for the reply!! > i ve installed the binary > but when i import anything of PyQt in my prog it says error?? > i think there is some problem with folders What is the exact text of the error message? We can't help you unless we know

Re: debian defaults not up-to-date

2011-06-12 Thread Benjamin Kaplan
On Jun 12, 2011 10:32 AM, "blues2use" wrote: > > Just finished installing Mint 10 and all has gone well. However, when I > removed some applications, I received this error during the removal: > > INFO: using unknown version '/usr/bin/python2.7' (debian_defaults not up- > to-date?) > > The removal

[RELEASE] Python 2.7.2

2011-06-12 Thread Benjamin Peterson
those in the northern hemisphere, have a nice summer! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7.2's contributors) -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.1.4

2011-06-12 Thread Benjamin Peterson
s can always be reported to: http://bugs.python.org Enjoy and be merry! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 3.1.4's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.1.4

2011-06-12 Thread Benjamin Peterson
2011/6/12 Paul Moore : > On 12 June 2011 18:58, Benjamin Peterson wrote: >> On behalf of the Python development team, I'm sanguine to announce a release >> candidate for the fourth bugfix release for the Python 3.1 series, Python >> 3.1.4. > > Is this actually a R

Re: Subsetting a dataset

2011-06-12 Thread Benjamin Kaplan
On Sun, Jun 12, 2011 at 9:53 PM, Kumar Mainali wrote: > I have a huge dataset containing millions of rows and several dozen columns > in a tab delimited text file.  I need to extract a small subset of rows and > only three columns. One of the three columns has two word string with header > “Scient

Re: Python 2.7.2 for Windows reports version as 2.7.0?

2011-06-17 Thread Benjamin Kaplan
On Fri, Jun 17, 2011 at 5:55 PM, wrote: > Just installed the 32-bit version Python 2.7.2 for Windows via the > python-2.7.2.msi download. > > When I start Python via python.exe or Idle, the version info is reported as > 2.7.0 vs. 2.7.2. > > Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.150

Re: installing NLTK

2011-06-17 Thread Benjamin Kaplan
On Fri, Jun 17, 2011 at 1:57 PM, Nige Danton wrote: > Hans Mulder wrote: >> On 17/06/11 21:58:53, Nige Danton wrote: >>> Mac OSX python 2.6.1: I'm trying to install the natural language toolkit >>> and following the instructions here www.NLTK.org/download I've downloaded >>> the PyYAML package an

Re: What is this syntax ?

2011-06-19 Thread Benjamin Kaplan
On Sun, Jun 19, 2011 at 2:06 PM, Vito 'ZeD' De Tullio wrote: > Roy Smith wrote: > >> There's something nice about building up strings in-line, as >> opposed to having to look somewhere to see what's being interpolated. >> To give a more complex example, consider: >> >> print "$scheme://$host:$port

Re: What's the best way to write this base class?

2011-06-20 Thread Benjamin Kaplan
On Sun, Jun 19, 2011 at 9:04 PM, John Salerno wrote: > On Jun 19, 8:52 pm, Chris Kaynor wrote: > >> Having a character class (along with possibly player character, non-player >> character, etc), make sense; however you probably want to make stuff like >> health, resources, damage, and any other

Re: Do we still need to inherit from "object" to create new-style classes?

2011-06-20 Thread Benjamin Kaplan
On Mon, Jun 20, 2011 at 6:26 PM, John Salerno wrote: > I can't quite seem to find the answer to this anywhere. The book I'm > reading right now was written for Python 3.1 and doesn't use (object), > so I'm thinking that was just a way to force new-style classes in 2.x > and is no longer necessary

Re: Better way to iterate over indices?

2011-06-21 Thread Benjamin Kaplan
On Tue, Jun 21, 2011 at 11:05 AM, Billy Mays wrote: > I have always found that iterating over the indices of a list/tuple is not > very clean: > > for i in range(len(myList)): >    doStuff(i, myList[i]) > > > > > I know I could use enumerate: > > for i, v in enumerate(myList): >    doStuff(i, myLi

Re: running an existing script

2011-06-21 Thread Benjamin Kaplan
On Tue, Jun 21, 2011 at 10:45 AM, Adam Chapman wrote: > Hi, > > I'm trying to put together a lot of pieces of source code in matlab, > java, perl and python. > > Im an expert when it comes to matlab, but novice in all the others > listed above. However, I have integrated the java and perl code so

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-21 Thread Benjamin Kaplan
On Tue, Jun 21, 2011 at 4:30 PM, Terry Reedy wrote: > On 6/21/2011 3:48 PM, John Salerno wrote: > >> Absolutely not! Each problem has been designed according to a "one- >> minute rule", which means that although it may take several hours to >> design a successful algorithm with more difficult prob

Re: Security test of embedded Python

2011-06-21 Thread Benjamin Kaplan
On Tue, Jun 21, 2011 at 7:40 PM, Paul Rubin wrote: > Chris Angelico writes: >> I'll also be looking into Pike. Unfortunately its community is far >> smaller than Python's, so security holes may be less obvious. > > Actually the most obvious and widespread sandboxed language these days > is Javasc

Re: writable iterators?

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 12:31 PM, "Neal Becker" wrote: > > AFAICT, the python iterator concept only supports readable iterators, not write. > Is this true? > > for example: > > for e in sequence: > do something that reads e > e = blah # will do nothing > > I believe this is not a limitation on the for l

Re: connect windows share

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 11:44 AM, "Travis Altman" wrote: > > I want to be able to connect to a windows share via python. My end goal is to be able to recursively search through windows shares. I want to do this in Linux as well. So given a share such as \\computer\test I would like to search through th

Re: python 3 constant

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 12:03 PM, "sidRo" wrote: > > How to declare a constant in python 3? > -- You don't. Python doesn't have declarations (other than global and nonlocal). Convention is that anything in all caps should be considered a constant but there's no language-level enforcement of it. -- http

Re: Mac OS X 10.6.6 and MacPyhton 2.6 idle doesn't work

2011-06-23 Thread Benjamin Kaplan
On Jun 23, 2011 10:42 AM, "mando" wrote: > > I've installed MacPython 2.6 under mac os x 2.6 and the IDLE doesn't > work. > I post error log. Suggestions? > > Thanks a lot. > > Luca > You'll have to install Tcl yourself. The 2.6 binaries were compiled against a newer version than Apple ships. >

Re: Default value for optional parameters unexpected behaviour?

2011-06-26 Thread Benjamin Kaplan
On Sun, Jun 26, 2011 at 11:28 AM, Marc Aymerich wrote: > Hi, > I'm trying to define a function that has an optional parameter which > should be an empty list whenever it isn't given. However, it takes as > value the same value as the last time the function was executed. What > is the reason of thi

Re: write file

2011-07-05 Thread Benjamin Kaplan
On Jul 5, 2011 2:28 PM, "miguel olivares varela" wrote: > > > Hi, > > i got a csv file that i need to modify and create a new one, i have no problem to read mi 'test.cvs' which is the source file but when i try to create a new one with the modifications i only got the first row in my 'out.csv' fi

Re: String concatenation vs. string formatting

2011-07-08 Thread Benjamin Kaplan
On Fri, Jul 8, 2011 at 1:18 PM, Andrew Berg wrote: > Is it bad practice to use this > > logger.error(self.preset_file + ' could not be stored - ' + > > sys.exc_info()[1]) > Instead of this? > > logger.error('{file} could not be stored - > > {error}'.format(file=self.preset_file, error=sys.exc_info

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Benjamin Kaplan
On Sat, Jul 9, 2011 at 6:58 PM, Cameron Simpson wrote: > On 10Jul2011 03:00, Alexander Kapps wrote: > | On 10.07.2011 02:26, John Salerno wrote: > | >I have a script that does some stuff that I want to run every day for > | >maybe a week, or a month. So far I've been good about running it every

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-10 Thread Benjamin Kaplan
On Sun, Jul 10, 2011 at 3:50 PM, Ivan Kljaic wrote: > Ok Guys. I know that most of us have been expiriencing the need for a > nice Gui builder tool for RAD and most of us have been googling for it > a lot of times. But seriously. Why is the not even one single RAD tool > for Python. I mean what h

Re: a little parsing challenge ☺

2011-07-18 Thread Benjamin Kaplan
On Mon, Jul 18, 2011 at 7:07 PM, Billy Mays wrote: > > On 7/18/2011 7:56 PM, Steven D'Aprano wrote: >> >> Billy Mays wrote: >> >>> On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 >>> >>> I gave it a shot.  It doesn't do any of the Unicode delims, because >>> let's face it, Unicode is f

Re: WindowsError: exception: access violation

2011-07-21 Thread Benjamin Kaplan
On Thu, Jul 21, 2011 at 6:42 PM, Sathish S wrote: > Hi Ppl, > >  I have been trying to call a C DLL built in GCC with cygwin and Eclipse IDE > from python. Since this DLL was built using cygwin it had the following two > DLL's as dependency. cygwin1.dll and cyggcc_s-1.dll > > I'm calling the cygwi

learning another programing language

2011-07-24 Thread Benjamin Gregg
Hi python was my first language but I need to learn C++ and java for a project (No there isn't an alternative) and I want to know is there any good tutorials or tips for learning C++/java after using python? thanks Ben -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >