xmlrpc and processes

2010-08-08 Thread iu2
Hi, I have a SimpleXMLRPCServer running on one PC. I need several ServerProxy-s talking to it, each one running on a different PC. That is, I run on each PC a client application, that talks to the one server using xml-rpc. Is the xml-rpc designed to work like this? If not, is there something I ca

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

2010-08-08 Thread Νίκος
On 8 Αύγ, 17:59, Thomas Jollans wrote: > Two problems here: > > str.replace doesn't use regular expressions. You'll have to use the re > module to use regexps. (the re.sub function to be precise) > > '.'  matches a single character. Any character, but only one. > '.*' matches as many characters a

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

2010-08-08 Thread Christoph Gohlke
On Aug 8, 9:54 pm, "W. eWatson" wrote: > On 8/8/2010 5:51 PM, Steven D'Aprano wrote: > > > 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 ev

Re:Need mentor

2010-08-08 Thread Ranjith Kumar
Hi all, I have described the theme of my project here, When the script is runned a configuring window has to be displayed where the user has to configure for there desired Web Browser, Audio Player, Video Player, Text Editor (Each Specified in separate SS Tab). Here the script should retrieve all

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

2010-08-08 Thread Martin v. Loewis
>The basic answer is that nobody is in charge. There's nobody > even trying to herd the third-party modules. Unlike CPAN, which > has standards for Perl packages and some level of quality > control, PyPi is just a link farm. Do the standards of CPAN also include uninstallation? To my knowle

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

2010-08-08 Thread Martin v. Loewis
> There's a discrepancy because package management on Python is > completely broken. Distutils and Setuptools (and it's new fork, > Distribute) are inadequate- they act as installers, but don't provide > a way to uninstall the program. That's not true. If you use the bdist_wininst, bdist_msi, or b

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

2010-08-08 Thread John Nagle
On 8/8/2010 9:51 AM, Mark Lawrence 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 Python itself. How can matplotlib and sci

Re: python interview quuestions

2010-08-08 Thread Terry Reedy
On 8/8/2010 10:16 PM, Peter wrote: I'm pretty sure both Peter Otten and Terry Reedy were being sarcastic and/ or ironic. About the most I ever am ;=)! I'm sure you're right - and I repeat that I meant no offense. My comments were intended in the spirit of what to do or do not do in an inter

Re: os.unlink on Windows

2010-08-08 Thread Shambhu
Hi Thomas, Steven, Thanks for explanation. It is working now after using double backslash in pathname. I was misinterpreting the display output and thinking that it was being added by 'os' module. Regards, Shambhu. T On Aug 8, 6:29 pm, Steven D'Aprano wrote

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

2010-08-08 Thread W. eWatson
On 8/8/2010 5:51 PM, Steven D'Aprano wrote: 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 t

requirements in writing an email/rss/usenet client?

2010-08-08 Thread George Oliver
hi, I'd like to know what to consider when writing an email/rss/usenet client. Apologies for such a broad question, but I've never attempted a project of this scope and I'm currently feeling out the requirements. My target is something like a gui-based mutt (I use a Windows OS btw), with influenc

Re: python interview quuestions

2010-08-08 Thread Peter
On Aug 9, 10:39 am, Steven D'Aprano wrote: > On Sun, 08 Aug 2010 17:28:59 -0700, Peter wrote: > > On Aug 9, 6:49 am, Terry Reedy 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: > > >> > pr

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 cod

Re: Python Portability

2010-08-08 Thread alex23
"W. eWatson" 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 at those who com

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

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 (a

Re: python interview quuestions

2010-08-08 Thread Roy Smith
In article <388041a0-4bc5-4f65-bae3-d516fb90f...@l25g2000prn.googlegroups.com>, Peter 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 firmament. Anybody wh

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 specifica

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 everythin

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 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 >>

Re: python interview quuestions

2010-08-08 Thread Peter
On Aug 9, 6:49 am, Terry Reedy 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 >

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 > 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

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'

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 (release26-

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 wrote: > On 8/8/2010 10:56 AM, Benjamin Kaplan wrote: >> >> On Sun, Aug 8, 2010 at 10:21 AM, David Robinow  wrote: >>> >>> On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence >>>  wrote: On 08/08/2010 17:16, W. eWatson wrote: > > See Subject.

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 -- http://ma

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 Robinow wrote: On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence 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 p

Re: Regular expression issue

2010-08-08 Thread Chris Rebert
On Sun, Aug 8, 2010 at 3:32 PM, Thomas Jollans 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 >> >> import re

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 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 expressi

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

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,

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

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 print("1\n2\nFizz\n4\nBuzz\nFiz

Re: pre-uninstall script in bdist_wininst

2010-08-08 Thread Nils
On 6 Aug., 04:02, Mark Hammond 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 *after*, so >          

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 inst

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 "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 .

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: # 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 ha

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 interpr

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 quo

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 wrote: > On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence > 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.

Re: Python "why" questions

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 10:24 AM, 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 P

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 Some Date String SomeTag A Title

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 > > >Some Date String

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 '' tages from within and also insert a very first line of where id must be an identification unique number of every page for counter tracking

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 wrote: > On 08/08/2010 04:06 PM, Νίκος wrote: > > > > > > > On 8 Αύγ, 15:40, Thomas Jollans 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

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: 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 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 Python itself. Ho

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 wa

Re: Class initialization

2010-08-08 Thread Benjamin Kaplan
On Sun, Aug 8, 2010 at 6:32 AM, 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 diff

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 goog

Re: suitable py2app.

2010-08-08 Thread Aahz
In article <744e466d-40c8-4a20-97cc-c8973aa36...@c38g2000vba.googlegroups.com>, ata.jaf 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. -- Aahz (a...@pyt

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: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Tim Harig wrote: > On 2010-08-08, Tim Harig wrote: >> On 2010-08-08, 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 w

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, Tim Harig wrote: > On 2010-08-08, 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. > > It is no

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 http://

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 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 associated with the

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, 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. It is not so much using __init__() that makes the

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 wit

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 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() a.

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 wrote: > > Others have told you that at a and b belo

Re: Class initialization

2010-08-08 Thread Jesse Jaggars
On Sun, Aug 8, 2010 at 10:01 AM, Tim Harig wrote: > On 2010-08-08, 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 >> >> Somehow, when I try

Re: Class initialization

2010-08-08 Thread Tim Harig
On 2010-08-08, 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 > > Somehow, when I try to acces the 'a' variable in c2 it has the same > value as the '

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 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

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 in

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 = fo

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: easy question on parsing python: "is not None"

2010-08-08 Thread Albert van der Horst
In article <8c2uiufg9...@mid.individual.net>, Peter Pearson 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: 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" 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: 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, 201

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

2010-08-08 Thread Νίκος
On 8 Αύγ, 15:40, Thomas Jollans 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 'counter.py

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 this

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 >> > > > h

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 9:13 pm, Thomas Jollans 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:\\"' . And > > w

# 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 date

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 th

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

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.

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: 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 t

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 7:45 pm, Thomas Jollans wrote: > On 08/08/2010 12:23 PM, blur959 wrote: > > > > > On Aug 8, 6:05 pm, Thomas Jollans wrote: > >> On 08/08/2010 10:35 AM, blur959 wrote: > > >>> On Aug 8, 4:15 pm, Chris Rebert wrote: > On Sun, Aug 8, 2010 at 1:02 AM, blur959 wrote: > > Hi, all,

Re: cscope like source code navigation for python code

2010-08-08 Thread Tim Harig
On 2010-08-08, Gelonida wrote: > On 08/08/2010 01:42 AM, Tim Harig wrote: >> On 2010-08-07, Gelonida 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.ne

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.tx

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 wrote: >> On 08/08/2010 10:35 AM, blur959 wrote: >> >> >> >>> On Aug 8, 4:15 pm, Chris Rebert wrote: On Sun, Aug 8, 2010 at 1:02 AM, blur959 wrote: > Hi, all, I am writing a program that renames files inside OS >

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

2010-08-08 Thread Νίκος
On 8 Αύγ, 13:13, Thomas Jollans 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: 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: Microsoft lessening commitment to IronPython and IronRuby

2010-08-08 Thread Lawrence D'Oliveiro
In message , 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 the modern world of dynamic languages. Looks like

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 -- http

Re: Python Portability

2010-08-08 Thread David Cournapeau
On Sun, Aug 8, 2010 at 10:10 AM, W. eWatson 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 version rem

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

2010-08-08 Thread Lawrence D'Oliveiro
In message , 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. -- http://mail.python.org/mailman/listinfo/python-

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: 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 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 quite inter

Re: Renaming of files in OS directory

2010-08-08 Thread blur959
On Aug 8, 6:05 pm, Thomas Jollans wrote: > On 08/08/2010 10:35 AM, blur959 wrote: > > > > > On Aug 8, 4:15 pm, Chris Rebert wrote: > >> On Sun, Aug 8, 2010 at 1:02 AM, blur959 wrote: > >>> Hi, all, I am writing a program that renames files inside OS > >>> directories the user provides. I am at t

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: 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: 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 wrote: >> On Sun, Aug 8, 2010 at 1:02 AM, blur959 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 pr

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,

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 filen

  1   2   >