[Johnston Jiaa]
| I recently bought a Macbook Pro from Apple. As it comes with
| a remote, I thought it would be great to use it as a mouse
| when not in Front Row. The fast forward button would move
| the cursor to the left, the volume increase would move it up
| the screen, etc and the pla
Keo Sophon wrote:
> Hi all,
>
> How can I get a name of an XML node and and its property name and its
> property
> value?
How are your reading the XML? (xml.dom, ElementTree, BeautifulSoup...)
Kent
___
Tutor maillist - [email protected]
http://mail
Hello all,
Could anyone help me by giving example of getAttribute
xmldata = ziparchive.read("content.xml")
xmldoc = minidom.parseString(xmldata)
officeNode = xmldoc.getElementsByTagName('office:text')
I have another function:
def go_thru (nodelist):
for x in range(nodelist.length):
n
On Friday 31 March 2006 17:37, Kent Johnson wrote:
> Keo Sophon wrote:
> > Hi all,
> >
> > How can I get a name of an XML node and and its property name and its
> > property value?
>
> How are your reading the XML? (xml.dom, ElementTree, BeautifulSoup...)
>
> Kent
>
> __
Hi all,
Is there anyway to get the content of an XML elements. I am using xml.dom.
Thanks,
Phon
___
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor
Thanks very much for that Kent, works fine and dandy now. >_< This is
one to chalk up to experience. I copied the dicts as you said.
Regards,
Liam
On 3/31/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Liam Clarke wrote:
> > Hi all,
> >
> > I'm working in my first multi-threaded environments, an
Keo Sophon wrote:
> On Friday 31 March 2006 17:37, Kent Johnson wrote:
>
>>Keo Sophon wrote:
>>
>>>How can I get a name of an XML node and and its property name and its
>>>property value?
>>
>>How are your reading the XML? (xml.dom, ElementTree, BeautifulSoup...)
>>
>
> I am using xml.dom.
I gen
kakada wrote:
> Hello all,
>
> Could anyone help me by giving example of getAttribute
>
> xmldata = ziparchive.read("content.xml")
> xmldoc = minidom.parseString(xmldata)
> officeNode = xmldoc.getElementsByTagName('office:text')
>
> I have another function:
> def go_thru (nodelist):
> for x
I have this python code
class Car:
"""Type of car."""
manufacturer = f.string()
model = f.string()
modelYear = f.integer()
_key(manufacturer, model, modelYear)
def __str__(self):
return '%s %s %s' % (self.modelYear, self.manufacturer, self.model)
-
and w
Ilias Lazaridis wrote:
> I have this python code
>
> class Car:
> """Type of car."""
>
> manufacturer = f.string()
> model = f.string()
> modelYear = f.integer()
>
> _key(manufacturer, model, modelYear)
>
> def __str__(self):
> return '%s %s %s' % (self.mo
From a table, I want to get the cells for then only choose some of them.
WY
Wyo.
...
Using:
for row in table('tr'): print row.contents
['\n', WY, '\n', Wyo., '\n']
[...]
I get a new line character between each cell.
Is possible get them without those '\n'?
Thanks in advance
[EMAIL PROTECTED] wrote:
> From a table, I want to get the cells for then only choose some of them.
>
>
>
> WY
> Wyo.
>
> ...
>
>
> Using:
>
> for row in table('tr'): print row.contents
>
>['\n', WY, '\n', Wyo., '\n']
>[...]
>
> I get a new line character between each cell.
Kent Johnson writes:
> [EMAIL PROTECTED] wrote:
>> From a table, I want to get the cells for then only choose some of them.
>>
>>
>>
>> WY
>> Wyo.
>>
>> ...
>>
>>
>> Using:
>>
>> for row in table('tr'): print row.contents
>>
>>['\n', WY, '\n', Wyo., '\n']
>>[...]
>>
>>
[EMAIL PROTECTED] wrote:
> Kent Johnson writes:
>
>
>>[EMAIL PROTECTED] wrote:
>>
>>> From a table, I want to get the cells for then only choose some of them.
>>>
>>>
>>>
>>>WY
>>>Wyo.
>>>
>>>...
>>>
>>>
>>>Using:
>>>
>>>for row in table('tr'): print row.contents
>>>
>>> ['\n', WY, '\n
Kent Johnson writes:
> [EMAIL PROTECTED] wrote:
>> Kent Johnson writes:
>>
>>
>>>[EMAIL PROTECTED] wrote:
>>>
From a table, I want to get the cells for then only choose some of them.
WY
Wyo.
...
Using:
for row in table('tr'
[EMAIL PROTECTED] wrote:
> You have reason but the problem is that some cells have anchors.
> Sorry, I forgot myself to say it.
>
> and using:
>
> for row in table('tr'):
> cellText = [cell.string for cell in row('td')]
> print cellText
>
> I get null values in cell with anchors.
Ca
Kent Johnson writes:
> [EMAIL PROTECTED] wrote:
>> You have reason but the problem is that some cells have anchors.
>> Sorry, I forgot myself to say it.
>>
>> and using:
>>
>> for row in table('tr'):
>> cellText = [cell.string for cell in row('td')]
>> print cellText
>>
>> I get
[EMAIL PROTECTED] wrote:
> List of states:
> http://en.wikipedia.org/wiki/U.S._state
>
> : soup = BeautifulSoup(html)
> : # Get the second table (list of states).
> : table = soup.first('table').findNext('table')
> : print table
>
> ...
>
> WY
> Wyo.
> Wyoming
> Cheyenne
> Cheyenne
> src="ht
Hello All,
I've been reading about "Inverted Indexing" - I'd like to try to write
something in Python that illustrates the concpet, as I've got to give
a presentation about it.
Where would be a good place to start?
S.
___
Tutor maillist - Tutor@pytho
Hello, I have come up with an idea of an app that I would like to write using python but I need some guidance. I would like to write an app for Linux/Unix that fetches a gzipped or bzipped file from a remote server by http or ftp. The file will be downloaded to a temporary directory, unzipped and
> I would like to write an app for Linux/Unix
> that fetches a gzipped or bzipped file from a remote server by http or ftp.
> The file will be downloaded to a temporary directory, unzipped and its
> contents copied to specific directory. If the process has gone well, the
> files in the temporary di
> ... this seems to me to be the kind of query where
> you could legitimately post to the main Python
> newsgroup / mailing list and/or to some Mac-specific
> one, if there is such a thing.
... and there is:
http://mail.python.org/mailman/listinfo/pythonmac-sig
cheers,
-- wesley
- - - - - - - -
Kent Johnson writes:
> [EMAIL PROTECTED] wrote:
>
>> List of states:
>> http://en.wikipedia.org/wiki/U.S._state
>>
>> : soup = BeautifulSoup(html)
>> : # Get the second table (list of states).
>> : table = soup.first('table').findNext('table')
>> : print table
>>
>> ...
>>
>> WY
>> Wyo.
Steve Nelson wrote:
> Hello All,
>
> I've been reading about "Inverted Indexing" - I'd like to try to write
> something in Python that illustrates the concpet, as I've got to give
> a presentation about it.
>
> Where would be a good place to start?
Do you need help getting started with Python or
> How can we remove one file inside of a zip archive?
>
> import zipfile
> ziparchive = zipfile.ZipFile('test.odt', 'r')
> xmldata = ziparchive.read('content.xml')
> ziparchive.close <--- ADD "( )" HERE TOO
Sophon,
You can remove any number of files from a ZIP fil
Hi all,
I've been too busy with life to do much Python of late. So, I am a bit
rusty. :-(
I've got some code that does what it needs to but I think I might be
overlooking a much smoother way to get what I need.
The code takes a list of strings and returns a list of dictionaries,
where each dic
Dear group,
I want to connect python to postgresql.
My python dist. is 2.4.2
My postgres: 8.1.2
My system: Linux Enterprise Linux, Intel Xeon, 4GB
RAM.
I tried to install pygresql: version: 3.8, it failed
throwing exception : Exception: pg_config tool is not
available.
I gave another try on go
Kent Johnson wrote:
...
Thank you for your comments. I realize that my request was not very
clear. I make a 2nd attemp, more simplified:
I have this python code:
class Car(BaseClass) :
manufacturer = stringFactory()
model = stringFactory()
modelYear = integerFactory()
d
On Fri, Mar 31, 2006, Srinivas Iyyer wrote:
>Dear group,
>
>I want to connect python to postgresql.
>My python dist. is 2.4.2
>My postgres: 8.1.2
>My system: Linux Enterprise Linux, Intel Xeon, 4GB
>RAM.
>
>I tried to install pygresql: version: 3.8, it failed
>throwing exception : Exception: pg_c
> Then, the output is like so:
>
> >>> atoms = ["a","b","c"]
> >>> tvas = tva_dict_maker(atoms)
> >>> display_tvas(tvas)
> a:Trueb:True c:True
> a:Trueb:True c:False
> a:Trueb:False c:True
> a:Trueb:False c:False
> a:False b:True c:True
> a:False
> >I tried to install pygresql: version: 3.8, it failed
> >throwing exception : Exception: pg_config tool is not
> >available.
> >
> >I gave another try on google and Postgres site and
> >found Pypgsql, PoPy and psycopg1.
>
> I think that psycopg is generally considered the preferred
> package.
a
Thanks Bill, and wesley,
Psycopg worked for me. I had to use setup.cfg .
Regular setup.py did not work.
AFA, pygresql I did used this some 2 years back.
However, the install was pretty easy due to proper
redhat rpm updates. I felt more comfortable with
PyGreSQL. I liked it somehow.
tar -xvf
hi srini,
i don't know what your system configuration was like for the
installation, but from what i saw in your post (below), it just seems
like /usr/local/pgsql/bin was not in your path since it looks like
"sh" could not find the pg_config command, not Python (which choked
afterwards).
anyway,
On 3/31/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Steve Nelson wrote:
>
> Do you need help getting started with Python or with inverted indexing
> in particular?
Sorry - I should have been clearer. I'm reasonably confident in
Python, and if I get stuck with that side of things will ask for he
What commands could capture input from the keyboard
(and the mouse while we're at it) even when the running python program isn't the
program in focus? Sorta like a keylogger, though that's not my goal (wouldn't be
very secret with a python console running anyways lol.)
-Jack
___
> The next step would be to introduce an index. I think again, the
> simplest thing that could possibly work would be a literal index of
> every word and every document in which it appears. This would save
> processing time, but wouldn't be very intelligent.
Yes, that's right, that's the idea
36 matches
Mail list logo