Re: How to Use ANSI for Remote Screen Scraping?

2008-11-02 Thread Henry Chang
ot;, "line 5 ABCDEFGHIJKL", "line 6 ABCDEFGHIJKL"] for i in head_output: crt.write(i + "\n") print crt.get_region(2, 6, 5, 10) Output from ANSI terminal region: ['2 ABC', '3 ABC', '4 ABC', '5 ABC'] On Sun, Nov

Re: How to Use ANSI for Remote Screen Scraping?

2008-11-02 Thread Henry Chang
ng the screen. What am I doing wrong? http://coding.derkeiler.com/Archive/Python/comp.lang.python/2005-03/1441.html Thanks for any help. On Sat, Nov 1, 2008 at 5:03 PM, Henry Chang <[EMAIL PROTECTED]> wrote: > Using the below script, I can use pexpect to correctly output the entire > re

How to Use ANSI for Remote Screen Scraping?

2008-11-01 Thread Henry Chang
Using the below script, I can use pexpect to correctly output the entire remote terminal content to screen. At this point, I am running into difficulty to scrap the screen, for the screen elements that I want. (Say: the screen region from the complete 3rd line to the 8th line.) I believe I need t

Re: Function to Add List Elements?

2008-10-22 Thread Henry Chang
Very nice, that works! Thanks so much, Chris! On Wed, Oct 22, 2008 at 1:06 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Wed, Oct 22, 2008 at 12:59 PM, Henry Chang <[EMAIL PROTECTED]> wrote: > > This seems like a simple problem, but I can't find a simple solution.

Function to Add List Elements?

2008-10-22 Thread Henry Chang
This seems like a simple problem, but I can't find a simple solution. Suppose I have two lists of integers. List A = [A1, A2, A3] List B = [B1, B2, B3] I just simply want a new list, such as: List C = [C1, C2, C3] where: C1 = A1 + B1 C2 = A2 + B2 C3 = A3 + B3 Is there a simple function to do

Re: How to Determine Name of the Day in the Week

2008-09-11 Thread Henry Chang
Awesome, that worked. Thanks so much! On Thu, Sep 11, 2008 at 10:16 AM, Fredrik Lundh <[EMAIL PROTECTED]>wrote: > Henry Chang wrote: > > Instead of getting integers with weekday(), Monday == 0 ... Sunday == 6; >> is there a way to get the actual names, such as "Monda

How to Determine Name of the Day in the Week

2008-09-11 Thread Henry Chang
Instead of getting integers with weekday(), Monday == 0 ... Sunday == 6; is there a way to get the actual names, such as "Monday ... Sunday"? I would like to do this without creating a data mapping. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line arguements

2008-07-27 Thread Henry Chang
try optparse :) http://docs.python.org/lib/module-optparse.html On Sun, Jul 27, 2008 at 9:13 PM, aditya shukla <[EMAIL PROTECTED]>wrote: > Hello folks ,I have a program in which a text file is generated as an > output > eg > > C:\prog\ prog -x test.txt > Right now whenever i have to read the tes

Re: What's the api tat I should use to connect python to a MS Access Db?

2008-05-18 Thread Henry Chang
A simple google search: http://bytes.com/forum/thread637384.html On Sun, May 18, 2008 at 10:57 AM, David Anderson <[EMAIL PROTECTED]> wrote: > Please answer me the question of the subject =) > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/

Re: Graphs in Python

2008-04-11 Thread Henry Chang
Try Google Chart with python wrapper: http://pygooglechart.slowchop.com/ http://code.google.com/apis/chart/ On Thu, Apr 10, 2008 at 10:05 AM, Sanhita Mallick <[EMAIL PROTECTED]> wrote: > Hi. > > I am a newbie to Python. I am trying to implement a > Python code for graph manipulation. My graphs

Re: Google App Engine

2008-04-08 Thread Henry Chang
This is very interesting. Thanks for sharing! On Tue, Apr 8, 2008 at 1:55 AM, Duncan Booth <[EMAIL PROTECTED]> wrote: > Google have announced a new service called 'Google App Engine' which may > be of interest to some of the people here (although if you want to sign > up you'll have to join the

Re: Basic class implementation question

2008-04-01 Thread Henry Chang
You might want to consult this. http://www.ibiblio.org/g2swap/byteofpython/read/object-methods.html On Tue, Apr 1, 2008 at 9:43 PM, <[EMAIL PROTECTED]> wrote: > I can't get call a class for some reason. This must be one of those > newbie questions I hear so much about: > > class wontwork: >

Re: Basic class implementation question

2008-04-01 Thread Henry Chang
Try this. class wontwork: def really(self): print "Hello World" wontwork().really() On Tue, Apr 1, 2008 at 9:43 PM, <[EMAIL PROTECTED]> wrote: > I can't get call a class for some reason. This must be one of those > newbie questions I hear so much about: > > class wontwo

Re: How to Encode String of Raw UTF-8 into Unicode?

2008-03-06 Thread Henry Chang
Awesome, that works. Thank you so much! My confusion of the different format made this harder than it should. On Thu, Mar 6, 2008 at 4:53 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 06 Mar 2008 22:43:58 -0200, Henry Chang <[EMAIL PROTECTED]> > escribi�: > &

How to Encode String of Raw UTF-8 into Unicode?

2008-03-06 Thread Henry Chang
Hi everyone, Suppose I start out with a raw string of utf-8 code points. raw_string = "68656E727963" I can coerce it into proper unicode format by slicing out two characters at a time. unicode_string = u"\x68\x65\x6E\x72\x79\x63" >>> print unicode_proper >>> henry My question: is the

Re: Importing java within python

2008-01-17 Thread Henry Chang
www.jython.org On Jan 17, 2008 8:06 AM, Osthaus, Christopher (Mission Systems) <[EMAIL PROTECTED]> wrote: > > > Hi All, > > This is an easy one - I'm new to Python and working on a script where I need > to use some java swing classes. I'm running Python on Windows. > > I've got an import statemen

Re: Python's great, in a word

2008-01-07 Thread Henry Chang
What exactly does it mean "a bycycle for the mind"?? (assuming s/bycycle/bicycle) On Jan 7, 2008 5:41 AM, alain <[EMAIL PROTECTED]> wrote: > On Jan 7, 2:09pm, [EMAIL PROTECTED] wrote: > > I'm a Java guy who's been doing Python for a month now and I'm > > convinced that > > > > 1) a multi-paradigm