ANN: Shed Skin 0.5

2010-08-08 Thread Mark Dufour
Hi all, I have just released Shed Skin 0.5, an experimental (restricted) Python-to-C++ compiler. Please see my blog for more details about the release: http://shed-skin.blogspot.com/ Thanks, Mark Dufour. -- http://www.youtube.com/watch?v=E6LsfnBmdnk --

Re: I need a starter ptr writing python embedded in html.

2010-08-08 Thread Eknath Venkataramani
BeautifulSoup On Sun, Aug 8, 2010 at 8:12 AM, Steven W. Orr ste...@syslang.net wrote: I'm ok in python but I haven't done too much with web pages. I have a web page that is hand written in html that has about 1000 entries in a table and I want to convert the table from entries like this

Re: easy question on parsing python: is not None

2010-08-08 Thread Stefan Schwarzer
Hi Ben, On 2010-08-08 01:16, Ben Finney wrote: Don't use strings for such values. The data isn't going to be used, so there's no sense using a semantically rich data type like a string. Instead, use an ‘object’ instance; then, the only way to get a binding that will compare equal is to use

Renaming of files in OS directory

2010-08-08 Thread blur959
Hi, all, I am writing a program that renames files inside OS directories the user provides. I am at the early stage of writing it and I encountered some problems. Below is my code. There is an error i received when i run this code. The error is, WindowsError: [Error 123] The filename, directory

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Steven D'Aprano
On Sat, 07 Aug 2010 17:20:24 -0700, Νίκος wrote: I don't know how to handle such a big data replacing problem and cannot play with fire because those 500 pages are my cleints pages and data of those filesjust cannot be messes up. Take a backup copy of the files, and only edit the copies.

Re: Renaming of files in OS directory

2010-08-08 Thread Chris Rebert
On Sun, Aug 8, 2010 at 1:02 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am writing a program that renames files inside OS directories the user provides. I am at the early stage of writing it and I encountered some problems. Below is my code. There is an error i received when i run this

Re: ctypes: pointer to method

2010-08-08 Thread Martin Landa
On Aug 7, 12:46 pm, Martin Landa landa.mar...@gmail.com wrote: the problem occurs when restype is not None, but c_int. E.g. solved. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Νίκος
On 8 Αύγ, 11:09, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 07 Aug 2010 17:20:24 -0700, Νίκος wrote: I don't know how to handle such a big data replacing problem and cannot play with fire because those 500 pages are my cleints pages and data of those filesjust

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 4:15 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 8, 2010 at 1:02 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am writing a program that renames files inside OS directories the user provides. I am at the early stage of writing it and I encountered some problems.

Re: I need a starter ptr writing python embedded in html.

2010-08-08 Thread Chris Rebert
On Sat, Aug 7, 2010 at 7:42 PM, Steven W. Orr ste...@syslang.net wrote: I'm ok in python but I haven't done too much with web pages. I have a web page that is hand written in html that has about 1000 entries in a table and I want to convert the table from entries like this    tr      td Some

ANN: Shed Skin 0.5

2010-08-08 Thread Mark Dufour
Hi all, I have just released Shed Skin 0.5, an experimental (restricted) Python-to-C++ compiler. Please see my blog for more details about the release: http://shed-skin.blogspot.com/ Thanks, Mark Dufour. -- http://www.youtube.com/watch?v=E6LsfnBmdnk --

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Νίκος
Script so far: #!/usr/bin/python import cgitb; cgitb.enable() import cgi, re, os print ( Content-type: text/html; charset=UTF-8 \n ) id = 0 # unique page_id for currdir, files, dirs in os.walk('data'): for f in files: if f.endswith('php'): # get abs path to

Re: Python Portability

2010-08-08 Thread Thomas Jollans
On 08/08/2010 03:10 AM, W. eWatson wrote: I think I posted the errors my partner got above. Let me look. Yes, here's the copy. He gets Traceback (most recent call last): File C:\Documents and Settings\HP_Administrator.DavesDesktop\Desktop\NC-FireballReport20100729.py, line 40, in module

Re: Renaming of files in OS directory

2010-08-08 Thread Thomas Jollans
On 08/08/2010 10:35 AM, blur959 wrote: On Aug 8, 4:15 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 8, 2010 at 1:02 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am writing a program that renames files inside OS directories the user provides. I am at the early stage of writing it

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Thomas Jollans
On 08/08/2010 04:46 AM, rantingrick wrote: *facepalm*! I really must stop Usenet-ing whilst consuming large volumes of alcoholic beverages. THAT explains a lot. Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Thomas Jollans
On 08/08/2010 11:21 AM, Νίκος wrote: Please help me adjust it, if need extra modification for more php tags replacing. Have you tried it ? I haven't, but I see no immediate reason why it wouldn't work with multiple PHP blocks. #!/usr/bin/python import cgitb; cgitb.enable() import cgi, re,

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 6:05 pm, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 10:35 AM, blur959 wrote: On Aug 8, 4:15 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 8, 2010 at 1:02 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am writing a program that renames files inside OS

Re: cscope like source code navigation for python code

2010-08-08 Thread Gelonida
On 08/08/2010 01:42 AM, Tim Harig wrote: On 2010-08-07, Gelonida gelon...@gmail.com wrote: I'm using g?vim and its c-scope plugin for browsing C-code. What would be a good way of navigating larger python projects with vim? ctags: http://ctags.sourceforge.net/ Thanks Tim. This looks

Re: Why is python not written in C++ ?

2010-08-08 Thread Lawrence D'Oliveiro
In message 8c4g22f5l...@mid.individual.net, Gregory Ewing wrote: FWIW, certain parts of the Darwin kernel are written in a carefully-selected subset of C++. So Apple evidently think that it makes sense to use some C++ in a Unix kernel under some circumstances. I wonder if that explains

Re: Why is python not written in C++ ?

2010-08-08 Thread Lawrence D'Oliveiro
In message l6segt@spenarnc.xs4all.nl, Albert van der Horst wrote: The bottom line is that to implement a programming language you want to use a simpler programming language, not a more complicated one. That would rule out ever using a language to implement itself. --

Re: Python Portability

2010-08-08 Thread David Cournapeau
On Sun, Aug 8, 2010 at 10:10 AM, W. eWatson wolftra...@invalid.com wrote: On 8/7/2010 4:45 PM, Martin v. Loewis wrote: To add to the msg I just sent to M. Torrie. We are given the msi programs for Python, PIL,matplotlib, and numpy. The question of how to uninstall and re-install a different

Re: cscope like source code navigation for python code

2010-08-08 Thread Thomas Jollans
On 08/07/2010 07:53 PM, Gelonida wrote: Hi, I'm using g?vim and its c-scope plugin for browsing C-code. What would be a good way of navigating larger python projects with vim? thanks for any suggestions http://pypi.python.org/pypi/pycscope/0.2 Looks like an option --

Re: Microsoft lessening commitment to IronPython and IronRuby

2010-08-08 Thread Lawrence D'Oliveiro
In message tq17o.2754$fh2@viwinnwfe02.internal.bigpond.com, Neil Hodgson wrote: http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html Frankly I never understood the point of IronPython and IronRuby. They seemed like a desperate attempt to keep Dotnet relevant in

Re: os.unlink on Windows

2010-08-08 Thread Shambhu
Hi Thomas, I checked, file is present. Here is my sample script: import os filename = C:\SHAMBHU\tmp\text_delete.txt os.unlink(filename) File C:\SHAMBHU\tmp\text_delete.txt is accessible but C:\\SHAMBHU\ \tmp\\text_delete.txt is not (with extra backslash in path which is added by

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Νίκος
On 8 Αύγ, 13:13, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 11:21 AM, Νίκος wrote: Please help me adjust it, if need extra modification for more php tags replacing. Have you tried it ? I haven't, but I see no immediate reason why it wouldn't work with multiple PHP blocks.

Re: Renaming of files in OS directory

2010-08-08 Thread Thomas Jollans
On 08/08/2010 12:23 PM, blur959 wrote: On Aug 8, 6:05 pm, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 10:35 AM, blur959 wrote: On Aug 8, 4:15 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 8, 2010 at 1:02 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am writing a

Re: os.unlink on Windows

2010-08-08 Thread Thomas Jollans
On 08/08/2010 01:41 PM, Shambhu wrote: Hi Thomas, I checked, file is present. Here is my sample script: import os filename = C:\SHAMBHU\tmp\text_delete.txt os.unlink(filename) File C:\SHAMBHU\tmp\text_delete.txt is accessible but C:\\SHAMBHU\ \tmp\\text_delete.txt is not

Re: cscope like source code navigation for python code

2010-08-08 Thread Tim Harig
On 2010-08-08, Gelonida gelon...@gmail.com wrote: On 08/08/2010 01:42 AM, Tim Harig wrote: On 2010-08-07, Gelonida gelon...@gmail.com wrote: I'm using g?vim and its c-scope plugin for browsing C-code. What would be a good way of navigating larger python projects with vim? ctags:

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 7:45 pm, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 12:23 PM, blur959 wrote: On Aug 8, 6:05 pm, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 10:35 AM, blur959 wrote: On Aug 8, 4:15 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 8, 2010 at 1:02

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Thomas Jollans
On 08/08/2010 01:41 PM, Νίκος wrote: I was so dizzy and confused yesterday that i forgot to metnion that not only i need removal of php openign and closing tags but whaevers data lurks inside those tags as well ebcause now with the 'counter.py' script i wrote the html fiels would open ftm

Re: Python Portability

2010-08-08 Thread W. eWatson
On 8/8/2010 4:08 AM, David Cournapeau wrote: ... python-Numpy-1.2.0. No scipy anything. Well, this is interesting. I just noticed Martin v. Loewis on the Python 2.5 entry. That's you, right? You are conflating so many issues at the same time, it is very difficult to follow what you are doing.

Re: Renaming of files in OS directory

2010-08-08 Thread Thomas Jollans
On 08/08/2010 02:35 PM, blur959 wrote: Sorry, This is my first time using the os commands in python, Ok, firstly, I entered C:\ inside raw_input and stored it inside fileroot. When i print repr(fileroot), my result was 'C:\\' . And when I run os.listdir with fileroot, I got that error. I typed

Re: os.unlink on Windows

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 04:41:14 -0700, Shambhu wrote: Hi Thomas, I checked, file is present. Here is my sample script: import os filename = C:\SHAMBHU\tmp\text_delete.txt Did you intend to provide a filename with two TAB characters in it? c colon backslash s h a m b u TAB m p TAB

Class initialization

2010-08-08 Thread Costin Gament
Hi there. I'm kind of a beginner with Python (and programming in general). My problem is with initializing a class. Let's say I've defined it like this: class foo: a = 0 b = 0 and later I'm trying to initialize two different classes like this: c1 = foo() c2 = foo() The problem I have is

# of Months between two dates

2010-08-08 Thread Greg Lindstrom
I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy has been in effect. The

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 9:13 pm, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 02:35 PM, blur959 wrote: Sorry, This is my first time using the os commands in python, Ok, firstly, I entered C:\ inside raw_input and stored it inside fileroot. When i print repr(fileroot), my result was 'C:\\' .

Re: cscope like source code navigation for python code

2010-08-08 Thread Gelonida
Hi Thomas, On 08/08/2010 01:27 PM, Thomas Jollans wrote: On 08/07/2010 07:53 PM, Gelonida wrote: Hi, I'm using g?vim and its c-scope plugin for browsing C-code. What would be a good way of navigating larger python projects with vim? thanks for any suggestions

Re: Class initialization

2010-08-08 Thread Roald de Vries
On Aug 8, 2010, at 3:32 PM, Costin Gament wrote: Hi there. I'm kind of a beginner with Python (and programming in general). My problem is with initializing a class. Let's say I've defined it like this: class foo: a = 0 b = 0 and later I'm trying to initialize two different classes like

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Νίκος
On 8 Αύγ, 15:40, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 01:41 PM, Νίκος wrote: I was so dizzy and confused yesterday that i forgot to metnion that not only i need removal of php openign and closing tags but whaevers data lurks inside those tags as well ebcause now with the

Re: Class initialization

2010-08-08 Thread Costin Gament
Thank you for your answer, but it seems I didn't make myself clear. Take the code: class foo: a = 0 b = 0 c1 = foo() c1.a = 5 c2 = foo() print c2.a 5 Somehow, when I try to acces the 'a' variable in c2 it has the same value as the 'a' variable in c1. Am I missing something? On Sun, Aug 8,

Re: I need a starter ptr writing python embedded in html.

2010-08-08 Thread Steven W. Orr
On 08/07/10 23:57, quoth Miki: On Aug 7, 7:42 pm, Steven W. Orr ste...@syslang.net wrote: I'm ok in python but I haven't done too much with web pages. I have a web page that is hand written in html that has about 1000 entries in a table and I want to convert the table from entries like

Re: easy question on parsing python: is not None

2010-08-08 Thread Albert van der Horst
In article 8c2uiufg9...@mid.individual.net, Peter Pearson ppear...@nowhere.invalid wrote: On Fri, 06 Aug 2010 15:37:04 +0200, Stefan Schwarzer wrote: [snip] I can imagine a case where you might want to compare a string with `is`: FORWARD = forward BACKWARD = backward ...

Re: Class initialization

2010-08-08 Thread Roald de Vries
On Aug 8, 2010, at 4:14 PM, Costin Gament wrote: Thank you for your answer, but it seems I didn't make myself clear. You could have been clearer in your first post, yeah. Take the code: class foo: a = 0 b = 0 c1 = foo() c1.a = 5 c2 = foo() print c2.a 5 Somehow, when I try to acces the 'a'

Re: Class initialization

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 17:14:08 +0300, Costin Gament wrote: Thank you for your answer, but it seems I didn't make myself clear. Take the code: class foo: a = 0 b = 0 c1 = foo() c1.a = 5 c2 = foo() print c2.a 5 Incorrect. class foo: ... a = 0 ... b = 0 ... c1 = foo() c1.a = 5

Re: Class initialization

2010-08-08 Thread Costin Gament
Apparently, the code I've given here does, in fact, work. Still, I am encountering a similar problem in a much larger class (it is in a separate module, if that is any help). Also, the variable I am having trouble with is itself another class. I don't think it's appropriate to paste so much code

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Thomas Jollans
On 08/08/2010 04:06 PM, Νίκος wrote: On 8 Αύγ, 15:40, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 01:41 PM, Νίκος wrote: I was so dizzy and confused yesterday that i forgot to metnion that not only i need removal of php openign and closing tags but whaevers data lurks inside those

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Costin Gament costin.gam...@gmail.com wrote: Thank you for your answer, but it seems I didn't make myself clear. Take the code: class foo: a = 0 b = 0 c1 = foo() c1.a = 5 c2 = foo() print c2.a 5 Somehow, when I try to acces the 'a' variable in c2 it has the same

Re: Class initialization

2010-08-08 Thread Jesse Jaggars
On Sun, Aug 8, 2010 at 10:01 AM, Tim Harig user...@ilthio.net wrote: On 2010-08-08, Costin Gament costin.gam...@gmail.com wrote: Thank you for your answer, but it seems I didn't make myself clear. Take the code: class foo:   a = 0   b = 0 c1 = foo() c1.a = 5 c2 = foo() print c2.a 5

Re: Class initialization

2010-08-08 Thread Costin Gament
So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference between my exemple and using __init__, but I will read the docs about it. On Sun, Aug 8, 2010 at 6:01 PM, Tim Harig user...@ilthio.net wrote: Others have told you

Re: Class initialization

2010-08-08 Thread Costin Gament
That looks just like my code. What's the problem? On Sun, Aug 8, 2010 at 6:13 PM, Jesse Jaggars jhjagg...@gmail.com wrote: Is it possible that you are using a mutable class object? A common gotcha is to do something like this: class foo(object): ...   x = [] ... a = foo() b = foo()

Re: cscope like source code navigation for python code

2010-08-08 Thread Kenny Meyer
Gelonida (gelon...@gmail.com) wrote: Hi Thomas, On 08/08/2010 01:27 PM, Thomas Jollans wrote: On 08/07/2010 07:53 PM, Gelonida wrote: Hi, I'm using g?vim and its c-scope plugin for browsing C-code. What would be a good way of navigating larger python projects with vim? thanks

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Costin Gament costin.gam...@gmail.com wrote: So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference between my exemple and using __init__, but I will read the docs about it. It is not so much using

Re: Class initialization

2010-08-08 Thread Costin Gamenț
Thanks a lot. I'll try give it a go and see if it helps. On Sun, Aug 8, 2010 at 6:28 PM, Tim Harig user...@ilthio.net wrote: It is not so much using __init__() that makes the difference as it what scope the variables are assigned to.  If you define them as you where, then the variables are

DjangoCon 2010

2010-08-08 Thread Steve Holden
This is a reminder that DjangoCon US 2010 is now under a month away! The third such conference, DjangoCon returns this year to the green Doubletree Hotel in Portland, OR from September 7-9, with a three day sprint hosted by Urban Airship from September 10-12. The program schedule is at

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Tim Harig user...@ilthio.net wrote: On 2010-08-08, Costin Gament costin.gam...@gmail.com wrote: So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference between my exemple and using __init__, but I will

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Tim Harig user...@ilthio.net wrote: On 2010-08-08, Tim Harig user...@ilthio.net wrote: On 2010-08-08, Costin Gament costin.gam...@gmail.com wrote: So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference

Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread W. eWatson
See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see numpy listed. Why? I use a search and find only numpy and Python itself. How can matplotlib and scipy be uninstalled? -- http://mail.python.org/mailman/listinfo/python-list

Re: suitable py2app.

2010-08-08 Thread Aahz
In article 744e466d-40c8-4a20-97cc-c8973aa36...@c38g2000vba.googlegroups.com, ata.jaf a.j.romani...@gmail.com wrote: I'm looking for a suitable tutorial for py2app. I googled it but couldn't find anything. Can you help me please? What did you google for? py2app tutorial finds lots of hits. --

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Mark Lawrence
On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see numpy listed. Why? I use a search and find only numpy and Python itself. How can matplotlib and scipy be uninstalled? Have you heard of

Re: Class initialization

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 6:32 AM, Costin Gament costin.gam...@gmail.com wrote: Hi there. I'm kind of a beginner with Python (and programming in general). My problem is with initializing a class. Let's say I've defined it like this: class foo:   a = 0   b = 0 and later I'm trying to

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Michael Torrie
On 08/08/2010 10:16 AM, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see numpy listed. Why? I use a search and find only numpy and Python itself. How can matplotlib and scipy be uninstalled? The best way

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread David Robinow
On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see numpy listed. Why? I use a search and find only numpy and

Re: Python why questions

2010-08-08 Thread Default User
Not to prolong a good food fight, but IIRC, many years ago in QBasic, one could choose OPTION BASE 0 or OPTION BASE 1 to make arrays start with element [0] or element [1], respectively. Could such a feature be added to Python without significantly bloating the interpreter? Then, if starting

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread John S
On Aug 8, 10:59 am, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 04:06 PM, Νίκος wrote: On 8 Αύγ, 15:40, Thomas Jollans tho...@jollans.com wrote: On 08/08/2010 01:41 PM, Νίκος wrote: I was so dizzy and confused yesterday that i forgot to metnion that not only i need

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread Joel Goldstick
� wrote: Hello dear Pythoneers, I have over 500 .php web pages in various subfolders under 'data' folder that i have to rename to .html and and ditch the '?' and '?' tages from within and also insert a very first line of !-- id -- where id must be an identification unique number of every page

Re: I need a starter ptr writing python embedded in html.

2010-08-08 Thread Thomas Jollans
On Sunday 08 August 2010 04:42:25 Steven W. Orr wrote: I'm ok in python but I haven't done too much with web pages. I have a web page that is hand written in html that has about 1000 entries in a table and I want to convert the table from entries like this tr td Some Date String

Re: I need a starter ptr writing python embedded in html.

2010-08-08 Thread Joel Goldstick
Steven W. Orr wrote: I'm ok in python but I haven't done too much with web pages. I have a web page that is hand written in html that has about 1000 entries in a table and I want to convert the table from entries like this tr td Some Date String /td td SomeTag /td td

Re: Python why questions

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 10:24 AM, Default User hunguponcont...@gmail.com wrote: Not to prolong a good food fight, but IIRC, many years ago in QBasic, one could choose OPTION BASE 0 or OPTION BASE 1 to make arrays start with element [0] or element [1], respectively.  Could such a feature

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 10:21 AM, David Robinow drobi...@gmail.com wrote: On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control

urllib quote problem

2010-08-08 Thread John Nagle
This warning appeared from urllib.quote: /usr/local/lib/python2.6/urllib.py:1222: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal res = map(safe_map.__getitem__, s) Here's urllib.quote from Python 2.6: def

Re: Python why questions

2010-08-08 Thread MRAB
Default User wrote: Not to prolong a good food fight, but IIRC, many years ago in QBasic, one could choose OPTION BASE 0 or OPTION BASE 1 to make arrays start with element [0] or element [1], respectively. Could such a feature be added to Python without significantly bloating the

Re: # of Months between two dates

2010-08-08 Thread MRAB
Greg Lindstrom wrote: I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy

Re: # of Months between two dates

2010-08-08 Thread Joel Goldstick
Greg Lindstrom wrote: I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy has

Re: Python why questions

2010-08-08 Thread Thomas Jollans
On 2010-08-08 05:18, Dennis Lee Bieber wrote: Was it this thread where I commented that many early BASICs would allocate an eleven element array on DIM A(10) VB.net does this -- to cater for the classic VB programmer who is used to being able to index the number in brackets, and the .net

Re: Class initialization

2010-08-08 Thread Costin Gamenț
Thank you all for your answers and your patience. As soon as I can, I'll update my code and read up on the subject. If I still can't get it working, I'll bother you again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Portability

2010-08-08 Thread Martin v. Loewis
Add-Remove would be a very good answer, except for one thing. Understand that I'm in Win7 so CP takes on a different form. On Control Panel Add-Remove, I can find exactly two Python files: Python 2.5, and python-Numpy-1.2.0. No scipy anything. Well, it should be there. Perhaps it was

Re: pre-uninstall script in bdist_wininst

2010-08-08 Thread Nils
On 6 Aug., 04:02, Mark Hammond skippy.hamm...@gmail.com wrote: According to a comment in pywin32's post-install script:          elif arg == -remove:              # bdist_msi calls us before uninstall, so we can undo what we              # previously did.  Sadly, bdist_wininst calls us

Re: python interview quuestions

2010-08-08 Thread Terry Reedy
On 8/7/2010 7:53 AM, Peter Otten wrote: You mean you'd go for the candidate who took the conservative approach and got it right: print 1 print 2 print 'Fizz' print 4 print 'Buzz' print 'Fizz' print 7 print 8 print 'Fizz' print 'Buzz' Way too verbose. How about

Re: Smith-Waterman Algorithm in Python

2010-08-08 Thread Terry Reedy
On 8/7/2010 1:43 PM, Daniel Fetchinson wrote: Every one of the first 20 entries is either the OP questions or your reply. And you think it was there before the OP sent his message? Oh wait, did you just invent a time machine? :) Daniel - you are no help at all, and no funny. Actually, I'm

Regular expression issue

2010-08-08 Thread genxtech
I am trying to learn regular expressions in python3 and have an issue with one of the examples I'm working with. The code is: #! /usr/bin/env python3 import re search_string = [^aeiou]y$ print() in_string = 'vacancy' if re.search(search_string, in_string) != None: print( ay, ey, iy, oy

Re: Perl - Python unpack

2010-08-08 Thread Thomas Jollans
On Friday 06 August 2010, it occurred to James Mills to exclaim: Quick question for you Python enthusiasts that also happen to know Perl quite well... Few and far between ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression issue

2010-08-08 Thread Thomas Jollans
On Monday 09 August 2010, it occurred to genxtech to exclaim: I am trying to learn regular expressions in python3 and have an issue with one of the examples I'm working with. The code is: #! /usr/bin/env python3 import re search_string = [^aeiou]y$ To translate this expression to

Re: Regular expression issue

2010-08-08 Thread MRAB
genxtech wrote: I am trying to learn regular expressions in python3 and have an issue with one of the examples I'm working with. The code is: #! /usr/bin/env python3 import re search_string = [^aeiou]y$ You can think of this as: a non-vowel followed by a 'y', then the end of the string.

Re: Regular expression issue

2010-08-08 Thread Chris Rebert
On Sun, Aug 8, 2010 at 3:32 PM, Thomas Jollans tho...@jollybox.de wrote: On Monday 09 August 2010, it occurred to genxtech to exclaim: I am trying to learn regular expressions in python3 and have an issue with one of the examples I'm working with. The code is: #! /usr/bin/env python3

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread W. eWatson
On 8/8/2010 10:56 AM, Benjamin Kaplan wrote: On Sun, Aug 8, 2010 at 10:21 AM, David Robinowdrobi...@gmail.com wrote: On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrencebreamore...@yahoo.co.uk wrote: On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly

Re: Regular expression issue

2010-08-08 Thread Tim Chase
On 08/08/10 17:20, genxtech wrote: if re.search(search_string, in_string) != None: While the other responses have addressed some of the big issues, it's also good to use if thing_to_test is None: or if thing_to_test is not None: instead of == None or != None. -tkc --

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 4:15 PM, W. eWatson wolftra...@invalid.com wrote: On 8/8/2010 10:56 AM, Benjamin Kaplan wrote: On Sun, Aug 8, 2010 at 10:21 AM, David Robinowdrobi...@gmail.com  wrote: On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrencebreamore...@yahoo.co.uk  wrote: On 08/08/2010 17:16,

Re: Class initialization

2010-08-08 Thread Mel
Costin Gament wrote: So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference between my exemple and using __init__, but I will read the docs about it. Here's the thing about class variables: Python 2.6.2

Re: Class initialization

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 19:47:18 -0400, Mel wrote: Costin Gament wrote: So you're saying I should just use __init__? Will that get me out of my predicament? No, I don't quite understand the difference between my exemple and using __init__, but I will read the docs about it. Here's the thing

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 13:21:55 -0400, David Robinow wrote: On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see

Re: python interview quuestions

2010-08-08 Thread Peter
On Aug 9, 6:49 am, Terry Reedy tjre...@udel.edu wrote: On 8/7/2010 7:53 AM, Peter Otten wrote: You mean you'd go for the candidate who took the conservative approach and got it right: print 1 print 2 print 'Fizz' print 4 print 'Buzz' print 'Fizz' print 7 print 8 print

Re: python interview quuestions

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 17:28:59 -0700, Peter wrote: On Aug 9, 6:49 am, Terry Reedy tjre...@udel.edu wrote: On 8/7/2010 7:53 AM, Peter Otten wrote: You mean you'd go for the candidate who took the conservative approach and got it right: print 1 print 2 print 'Fizz' print 4 print

Python -Vs- Ruby: A regexp match to the death!

2010-08-08 Thread rantingrick
Hello folks, You all know i been forced to use Ruby and i am not happy about that. But i thought i would share more compelling evidence of the moronicity of the Ruby language syntax from the perspective of regexp's. I recently built myself a nice little Ruby script editor because i hate

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 16:15:45 -0700, W. eWatson wrote: To suggest Google as above, makes no sense to me. This is the place to ask, as another poster stated. He may have stated it, but the evidence suggests he's wrong. You're asking a question about the details of the installers used

Re: python interview quuestions

2010-08-08 Thread Roy Smith
In article 388041a0-4bc5-4f65-bae3-d516fb90f...@l25g2000prn.googlegroups.com, Peter peter.milli...@gmail.com wrote: Realistically, if the application is anything other than trivial then it will most likely have somebody poking around in it at some stage who isn't the brightest spark in the

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-08 Thread MRAB
rantingrick wrote: Hello folks, [snip] - Strings - Single line strings are exactly the same in both languages except in Ruby double quoted strings are backslash interpreted and single quote strings are basically raw. Except Ruby introduces more cruft

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-08 Thread Steven D'Aprano
On Sun, 08 Aug 2010 17:43:03 -0700, rantingrick wrote: Ha. Ruby does not really have multi line strings. Except, of course, it does, as you go on to show. Ruby has what they call a Here Doc. Besides picking the most boneheaded name for such an object It's standard terminology that has

Re: Python Portability

2010-08-08 Thread alex23
W. eWatson wolftra...@invalid.com wrote: I now have the answer I need, and I do not care one more wit about a one character change. I'm done here. That's a fantastic response to give to people who were actually willing to sacrifice their time to help you with your problems. I'm always stunned

Need a mentor

2010-08-08 Thread Ranjith Kumar
Hi all, I`m doing a python based project, I need a mentor who can guide me and help me to complete the project. the idea is fully based upon application programming. What I want is just suggest me how to implement so that I write the code and send it back to you. And there you can check the

Re: python interview quuestions

2010-08-08 Thread Peter
On Aug 9, 10:39 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 08 Aug 2010 17:28:59 -0700, Peter wrote: On Aug 9, 6:49 am, Terry Reedy tjre...@udel.edu wrote: On 8/7/2010 7:53 AM, Peter Otten wrote: You mean you'd go for the candidate who took the conservative

  1   2   3   4   >