Re: Announcement: MindTree for Python beta -- feedback appreciated

2008-12-09 Thread Johann Spies
* ImportError: No module named future_builtins Regards Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch Let not sin therefore reign in your mortal body, that ye should obey it in the lusts thereof

Re: using csv dictreader in python

2009-11-04 Thread Johann Spies
and then compare. I am not sure I understand what is the problem here. Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch Train up a child in the way he should go: and when he is old, he will not depart from it. Proverbs 22:6

peppy

2009-11-30 Thread Johann Spies
-': wx.ACCEL_CMD, AttributeError: 'module' object has no attribute 'ACCEL_CMD' This is on Debian squeeze. How do I solve this? Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch Lo, children are an heritage of the LORD

Re: peppy

2009-12-03 Thread Johann Spies
On Tue, Dec 01, 2009 at 07:35:52AM +, Nobody wrote: On Tue, 01 Dec 2009 08:51:20 +0200, Johann Spies wrote: After reading about peppy on Freshmeat I decided to try it out after installing it using easy_install. But: $ peppy File /usr/lib/python2.5/site-packages/peppy

Parsing html with Beautifulsoup

2009-12-10 Thread Johann Spies
in the td's with plain text? I have experimented a little bit with regular expressions, but could so far not find a solution. Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch Lo, children are an heritage of the LORD

Re: Parsing html with Beautifulsoup

2009-12-10 Thread Johann Spies
Gabriel Genellina het geskryf: En Thu, 10 Dec 2009 06:15:19 -0300, Johann Spies jsp...@sun.ac.za escribió: How do I get Beautifulsoup to render (taking the above line as example) sunentint for img src=icons/group.pngnbsp;a href=#OBJ_sunetintsunetint/ABR and still provide the text-parts

Re: Parsing html with Beautifulsoup

2009-12-13 Thread Johann Spies
explanation. As far as I can see there was no documentation installed with the debian package. Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch But I will hope continually, and will yet praise thee more and more

Re: Regex help needed!

2009-12-21 Thread Johann Spies
above string is - 35343433 - 345343 - 8898 Your string is in /tmp/y in this example: $ grep -o [0-9]+ /tmp/y 345343 35343433 8898 Much simpler, isn't it? But that is not python. Regards Johann -- Johann Spies Telefoon: 021-808 4599 Informasietegnologie, Universiteit van Stellenbosch

Re: Need help with a program

2010-01-29 Thread Johann Spies
AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1 AGCTCACAATAT 1 AGGTCGCCTGACGGCTGC 0 $ grep -v 0 /tmp/y tmp/z $ cat /tmp/z AGATAAGCTAATTAAGCTACTGGGTT 1 AGCTCACAATAT 1 Regards Johann -- Johann Spies Telefoon: 021-808 4599

Re: Need help with a program

2010-01-29 Thread Johann Spies
change the grep to ' 0$' then only the lines with a singel digit '0' at the end of the line will be excluded. One can do the same using regulare expressions in Python and it will probably a lot slower on large files. Regards Johann -- Johann Spies Telefoon: 021-808 4599

Nested loop not working

2010-07-16 Thread Johann Spies
I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops through the second file but only uses the

Convert XML to SQL

2011-01-26 Thread Johann Spies
I an not a Python newbie but working with xml is new to me. I get data through a soap connection, using suds, and want to convert that to objects which I can use to populate a rather complex database. I have been able to parse the xml using tree = etree.iterparse(infile,events=(start,end)) but

Re: Convert XML to SQL

2011-01-26 Thread Johann Spies
On 26 January 2011 12:51, Stefan Behnel stefan...@behnel.de wrote: The example you sent me is almost perfect for lxml.objectify. Basically, you'd do something like this: Thank you very much. You have helped me a lot. Regards Johann -- May grace and peace be yours in abundance through the

Another lxml.objectify question

2011-02-22 Thread Johann Spies
Stefan has helped me in the past to make some progress on using lxml.objectify. I am trying to parse xml to create sql-compatible data. My problem is that the xml records are not consistant: some might have tags that does not appear in others. That makes it very difficult for me to setup an

xml - dict: lxml faq solution inadequate

2011-03-02 Thread Johann Spies
In the lxml-faq I read: How can I map an XML tree into a dict of dicts? I'm glad you asked. def recursive_dict(element): return element.tag, \ dict(map(recursive_dict, element)) or element.text However this does not work where you have xml-elements where there are more than

Converting html character codes to utf-8 text

2012-06-19 Thread Johann Spies
I am trying the following: Change data like this: Bien Donn#233; : agri tourism to this: Bien Donné agri tourism I am using the 'unescape' function published on http://effbot.org/zone/re-sub.htm#unescape-html but working through a file I get the following error: UnicodeDecodeError: 'ascii'

Using python on OS X Lion

2011-12-11 Thread Johann Spies
I have recently upgraded my Snow Leopard to Lion and now I am having all problems with python on my system e.g.: I have install PIL with easy_install but when I do import PIL Python cannot find the pil library. Installing psycopg2 in the same way was successful and I can use psycopg2 without a

Re: [OT] Book authoring

2011-12-11 Thread Johann Spies
Have a look at Markdown + pandoc. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- http://mail.python.org/mailman/listinfo/python-list

list comprehension question

2012-02-29 Thread Johann Spies
I understand the following: In [79]: instansie instansie Out[79]: 'Mangosuthu Technikon' In [80]: t = [x.alt_name for x in lys] t = [x.alt_name for x in lys] In [81]: t t Out[81]: [] In [82]: t.append(instansie) t.append(instansie) In [83]: t t Out[83]: ['Mangosuthu Technikon'] But then why

Python equivalent of SOAP-ISIWoK

2010-11-02 Thread Johann Spies
SOAP-ISIWoK is a Perl library for assessing Thomson Reuters Web of Knowledge Web Services. I don't know Perl well enough to use that library without spending too much time on it. Is there a Python equivalent available? Regards Johann --  May grace and peace be yours in abundance through the

suds: how to set proxy?

2010-11-08 Thread Johann Spies
According to the suds documentation I can set the proxy setting like this: d = dict(http='host:80', https='host:443', ...) client.set_options(proxy=d) My problem is that you can only do that after 'client' was initiated like this: client = Client(url) And I need the proxy to reach the url. I

http-headers for soappy

2010-11-12 Thread Johann Spies
How do I pass the following header Header name: Cookie Header value: [SID=the session identifier] to SOAP.HeaderHandler(): class HeaderHandler: # Initially fail out if there are any problems. def __init__(self, header, attrs): for i in header.__dict__.keys():

Re: Python for WEB-page !?

2017-01-19 Thread Johann Spies
It might be worth while to look at web2py (http://web2py.com). Here is a good tutorial: http://killer-web-development.com/ Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Johann Spies
Νίκος, I am glad that you solved the problem. I am not using mysql but postgresql. When I get a problem using python to communicate with the database, one of my first steps will be to determine whether the error is a python (maybe psycopg-related) related error or a database error. What I do

Re: Regular expression

2017-07-26 Thread Johann Spies
On 26 July 2017 at 13:52, Kunal Jamdade wrote: > There is a filename say:- 'first-324-True-rms-kjhg-Meterc639.html' . > > I want to extract the last 4 characters. I tried different regex. but i am > not getting it right. > > Can anyone suggest me how should i proceed.?

Re: can not use pycharm

2019-06-14 Thread Johann Spies
On Mon, 10 Jun 2019 at 19:46, aris wrote: > > > Hello,this is my first time trying to learn coding and programming and I > wanted to start with python.Though,when I download pycharm, I go to > configure>settings>project interpreter and i can not put a project > interpreter( I have download