how to retrive highlighted text in a browser?

2005-07-03 Thread wcc
Hello group,

When browsing websites, quite often I have to look up words in
dictionary.  I'm hoping that I can come up with a python program that
does the following:

When I highlight some text in browser and right-click, besides the
default options such as COPY, PASTE, etc, I want an option that says
"Send to file", something like that.  The file is a text file, with
fixed path. When I select this option, the highlighted text will be
appended to the text file.  This way, I can collect those words &
phrases that I don't know.

Is this going to be a difficult task?  I'm a newbie in python. TIA for
your help.

- wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


question about raw_input

2005-07-03 Thread wcc
Hello group,

After searching free IDE for a while, i picked
PyScripter(http://mmm-experts.com/Products.aspx). It is neat. I like
it. But I always get error when using raw_input function. Please see
below.

>>> raw_input("Press ENTER to continue...")
Press ENTER to continue...Traceback (most recent call last):
  File "", line 1, in ?
EOFError: EOF when reading a line

I don't see this error when using the IDE from python or activepython.

Thanks for your time,

- wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to retrive highlighted text in a browser?

2005-07-04 Thread wcc
Thanks for reply.  I did not expect it to be a browser specific
problem.  I've been using a freeware dictionary tool called wordweb (it
is a  great tool) and it can detect highlighted text in browsers or
text editors, etc..  I'll keep searching.  Thanks again.   - wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: question about raw_input

2005-07-04 Thread wcc
Thanks for your suggestion Michael. 

-wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


newbie - mode for directory

2005-07-21 Thread wcc
Hello,

When using os.mkdir, what are the numeric numbers for different modes?
I could only find mode=0777 means read-only.  Thanks, - wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


EasyDialogs - select multiple files?

2005-08-15 Thread wcc
Hello group,

Can I use EasyDialogs to select multiple files?  I saw the function
AskFileForOpen but which does not have a flag allowing selection of
multiple files.  Did I miss something?  Thanks very much,

- wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


tools to manipulate PDF document?

2006-01-18 Thread wcc
Hello group,

I wonder what tools/modules are avaible to manipulate PDF ducument,
i.e., merge, split, rotate page, crop, etc..  I checked the PyPI page
and seems the only one may fit the need is pyPdf.  But it is in its
early stage and currently only supports two functions: merge & split.
I suppose working with PDF document is a common task.  Just wanted to
know if there are other alternatives.  Thank you very much!

- wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tools to manipulate PDF document?

2006-01-19 Thread wcc
Thanks a lot tooper.  I will check it out.  - wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tools to manipulate PDF document?

2006-01-19 Thread wcc
Thanks Justin.  Yes, I had tried pdftk before (could be the current
version though, since it has not been upgraded for a while).  But
somehow it was quite slow when I tried merging, or spliting PDF
documents when compared with Adobe Acrobat, especially if the number of
PDF to be processed is large.  I wonder if anyone had similar
experience.

Justin Ezequiel wrote:
> have you seen http://www.pdfhacks.com/pdftk/

-- 
http://mail.python.org/mailman/listinfo/python-list


Need a function. Any built-in function or module for this?

2006-10-14 Thread wcc
Hello group,

I need to write a function to get input from user. The prompt will be
like this:
Specify direction[Left/Right/Up/Down] or :

And if user type "L" or , the function will return "Left", if
user type "R", the function will return "Right", etc..

My quick search in python reference did not yield valid result. Any
pointer?

Thanks for your help.

-wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need a function. Any built-in function or module for this?

2006-10-15 Thread wcc
Thanks you very much Paul.  I think I have a little more homework to
do.
1. The upper case letter may not be the first letter in each word.
2. There may be more than one (continous) upper case letters in one
word.
I just wanted to find out if there is something already there in python
built-in functions, modules.  Thanks again.

-- 
http://mail.python.org/mailman/listinfo/python-list


where to ask questions related to comtypes?

2007-01-03 Thread wcc
Hello group,

Is there a separate mailing list for comtypes? Or this is the
appropriate place to post questions related to this package(from Thomas
Heller)? 

Thanks,

--
wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


question on creating class

2007-01-03 Thread wcc
Hello,

How do I create a class using a variable as the class name?

For example, in the code below, I'd like replace the line

class TestClass(object):
with something like
class eval(className) (object):

Is it possible?  Thanks for your help.

className = "TestClass"

class TestClass(object):
def __init__(self):
print "Creating object of TestClass..."

def method1(self):
print "This is a method."

if __name__ == "__main__":
o = TestClass()
o.method1()

--
wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: question on creating class

2007-01-04 Thread wcc
Thanks for all replies. I'll just to have to figure our which suggested
method I should use.  To answer Jussi's question, this is why I asked
the question.  I have the book by Mark:  Python Programming on Win32.
In Charpter 12: Advanced Python and COM there is a sample code named:
DynamicPolicy.py.  It can be used to expose all methods from a python
module to a COM server which can be accessed later from other
languages, say VBA. It works great.  There are quite a few modules that
I want to implement a COM server for.  One of the step to create the
COM server is to define a class.  Instead of revising this code for
each module, I wondered if I can create mutilple COM servers in one
program.  I'll pass a module name and the corresponding class name to
some function (to be written), and the class will be created.  Btw, I'm
novice to all this, hopefully my explanation isn't way off.  Thank to
all again. 

--
wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: where to ask questions related to comtypes?

2007-01-04 Thread wcc
Thank you Thomas.

On Jan 3, 11:10 pm, Thomas Heller <[EMAIL PROTECTED]> wrote:
> wcc schrieb:
>
> > Hello group,
>
> > Is there a separate mailing list for comtypes? Or this is the
> > appropriate place to post questions related to this package(from Thomas
> > Heller)?It seems the python-win32 mailing list is the place where the most 
> > COM knowledge
> is, so that would be most appropriate.  Other places are *this* list or the
> ctypes-users lists (since comtypes is based on ctypes).
> 
> Thomas

-- 
http://mail.python.org/mailman/listinfo/python-list


is there such a built-in funciton, similar to filter

2006-03-05 Thread wcc
Hello,

Beginner learning Python here.  I know filter(lambda x: x > 3, [1, 2,
5, -3, 4, 8]) will give me a list [5, 4, 8].  What if I only need to
find the first item in the list that returns Ture when applying the
filter function.  In this case, I only want to get the 5, and its index
2.  Is there a built-in function, or function from a module for that?
I think it is not hard to write a function for this.  But knowing
Python is "battery included", I thought I'd like to ask.  Thanks for
your help. 

- wcc

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there such a built-in funciton, similar to filter

2006-03-05 Thread wcc
Thanks a lot Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list