html DOM

2008-03-29 Thread Sam the Cat
Is there a package that would allow me the same or similar functionality for 
modifying html code via the DOM model as I have in JavaScript ?  I'd like to 
parse an html file, then modify it and save the result.  I am not trying to 
do this online, rather I would like to do this on a batch of files stored on 
my hard drive.  I have found several packages that allow me to parse and 
dissect html but none that allow me to modify the object and save the 
results -- perhaps I am overlooking the obvious


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


Re: Python and Javascript equivalence

2007-04-23 Thread Sam the Cat

 I am writing some COM code in Python to control photoshop.  Several 
 functions of PS require an Array argument.  In the examples of VBscript 
 or javascript the Array type is used.  I have tried what would appear to 
 be the equivalent in Python -- Lists and Tuples -- but to no avail. 
 Anyone have any insight  on what via the COM interface is equivalent to 
 an Array in javascript ?


 The nest way to approach an answer to your question would be for you to 
 post a VB snippet from one of the examples together with your attempt to 
 do the same thing in Python plus the error traceback (or other such 
 messages as you may see) generated when your attempts fails.

 Otherwise the question is just a bit too broad to give an answer.

 regards
  Steve
 -- 


Here is the Javascript example code

.
selRegion  = Array(Array(1,1),Array(1,2),Array(2,2),Array(2,1))
Doc.Selection.Select(selRegion,1,0,0)
.

Here is my interpretation in Python

...
selregion = [(1,1),(1,2),(2,2),(2,1)]
print selregion
doc.Selection.Select(selregion,1,0,0)
..

Here is the error code generated

..
F:\automationtest2.py
[(1, 1), (1, 2), (2, 2), (2, 1)]
Traceback (most recent call last):
  File F:\automation\test2.py, line 19, in ?
doc.Selection.Select(selregion,1,0,0)
  File COMObject unknown, line 3, in Select
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe 
Photoshop', 'Illegal argument - argument 1\n- Only arrays with dimension 1 
are supported', None, 0, -2147220262), None)


 


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


Python and Javascript equivalence

2007-04-22 Thread Sam the Cat
Hey All,

I am writing some COM code in Python to control photoshop.  Several 
functions of PS require an Array argument.  In the examples of VBscript or 
javascript the Array type is used.  I have tried what would appear to be the 
equivalent in Python -- Lists and Tuples -- but to no avail.  Anyone have 
any insight  on what via the COM interface is equivalent to an Array in 
javascript ?

Cheers
Sam 


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


network ping

2005-05-29 Thread Sam the Cat
Besides calling the external ping utility -- is there a way native to python
to execute a similar utility ?


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


help with wxPython and wxGrid

2005-04-10 Thread Sam the Cat
using from wxPython.wx import * under python2.3 I cannot seem to find the
wxGrid class -- it says its undefined -- am I missing something obvious ?  I
know the globalspace import is not the best, but that how I got started
;) -- any help owuld be appreciated


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