Re: How to del item of a list in loop?

2005-01-15 Thread Mitja
mplish (how complicated it is), lst = [i for i in lst if i!=2] might look better. -- Mitja -- http://mail.python.org/mailman/listinfo/python-list

Re: "Mail receiver server"

2005-01-31 Thread Mitja
On Mon, 31 Jan 2005 23:23:46 +0100, manatlan <[EMAIL PROTECTED]> wrote: in fact, i'd like to control "computer A" by sending smtp email from "computer B". What kind of server should i write on computer "B", a smtp server ? a pop server ? It would be easier if you used an existing mail serve

Re: Python Newbie

2005-07-15 Thread Mitja
On Thu, 14 Jul 2005 12:24:29 +0200, linuxfreak <[EMAIL PROTECTED]> wrote: > So heres me asking if anyone has any pointers > to some good basic python tutorial. Something that teaches one to get > going. The official tutorial is quite informal yet effective: python.org -> documentation -> tutorial

Re: Regexp question

2004-12-01 Thread Mitja
27;xx' Relevant lines: s = s[:s.index('(')] + s[s.index(')'):] s = s[:s.index('[')] + s[s.index(']')+1:] s = s.strip() -- Mitja -- http://mail.python.org/mailman/listinfo/python-list

Re: Power with modulu

2004-12-05 Thread Mitja
and it works well. My question is: How can I write it is a form of an expression, like a**b? AFAIK you can't. I prefer not to fill my script with calls of the form long.__pow__(a,b,c). That's a bit ugly, yes; pow is also a builtin, e.g.: pow(21,443,2)==1 -- Mitja -- http://mail.python.org/

Re: Help beautify ugly heuristic code

2004-12-08 Thread Mitja
ble patterns you have to match (kind of like the docstring at the beginning, only more elaborate), otherwise it's hard to know what kind of code you're trying to implement. -- Mitja -- http://mail.python.org/mailman/listinfo/python-list

Re: Help beautify ugly heuristic code

2004-12-09 Thread Mitja
ll(host): points += min(len(num)**2,60); #substrings that are more than just a hint of a dynamic ip for word in reWord.findall(host): if word in dynWords: points+=30 if word in staticWords: points-=30 print '[[',points,']]' return points>80 if __name__=='_

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Mitja
p with subject[0:lastFound] = [] HTH Mitja -- http://mail.python.org/mailman/listinfo/python-list

Re: Python cgi

2005-10-21 Thread Mitja Trampus
jbrewer wrote: > I'm currently writing my first CGI script (in Python), and I keep > getting an error I don't know how to address. I'm not sure if this is > a Python or Apache error, but I suspect it's an Apache config thing. I suspect it's neither :) Make sure your HTML form looks like -- http

Re: python cgi script not understood as html

2005-10-24 Thread Mitja Trampus
Philippe C. Martin wrote: > Hi, > > The following code outputs the actual HTML text to the browser, not the > interpreted text. > > Any idea ? > > html_ok = """ > Content-Type: text/html\n > > ... > """ Avoid the starting newline (before content-type). Add at least TWO newlines after conten

Re: Trying to find regex for any script in an html source

2005-12-21 Thread Mitja Trampus
28tommy wrote: > Hi, > I'm trying to find scripts in html source of a page retrieved from the > web. > I'm trying to use the following rule: > > match = re.compile('') > > I'm testing it on a page that includes the following source: > >