Re: Checking if email is valid

2023-11-01 Thread Ian Hobson via Python-list
ng regex sounds like a bad idea to me and the other options I found required paying for third party services. Could someone push me in the right direction please? I just want to find out if a string is a valid email address. Thank you. Simon. -- Ian Hobson Tel (+66) 626 544 695 -- https://

Re: Comparing sequences with range objects

2022-04-09 Thread Ian Hobson
n 0 # They are equal and key data for both is present 2) Sort the data using the comparator function. 3) Run through the data with a trailing enumeration loop, merging matching records together. 4) If there are no records copied out with missing key data, then you are done, so exit. 5) Choose

Re: Silly question, where is read() documented?

2020-08-29 Thread Ian Hobson
27;s not a built-in function and it's not documented with (for example) the file type object sys.stdin. So where is it documented? :-) -- Ian Hobson -- This email has been checked for viruses by AVG. https://www.avg.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the purpose the hook method showing in a class definition?

2019-10-20 Thread Ian Hobson
Hi Jach, On 20/10/2019 09:34, jf...@ms4.hinet.net wrote: What puzzles me is how a parent's method foo() can find its child's method goo(), no matter it was overwrote or not? MRO won't explain this and I can't find document about it also:-( This is a generalised description - Python may be sl

Re: Seeking help regarding Python code

2019-07-11 Thread Ian Hobson
Hi, Afraid the formatting gremlins got to your data before we saw it, so I am taking a guess at what you want to achieve. On 11/07/19 06:54, Debasree Banerjee wrote: I want to calculate the difference between LAQN_NO2 and NO2_RAW everyday at 04:00 and add that value to NO2_RAW values in all ro

Re: comp.lang.python

2019-02-12 Thread Ian Hobson
On 12/02/2019 05:54, Jaya Priya wrote: The comp.lang.python.announce newsgroup (or c.l.py.a for short) has been created in early 1998 as a companion newsgroup for comp.lang.python focused on Python-related announcements. ... other items of general interest to the Python community. https://www.

Re: sampling from frequency distribution / histogram without replacement

2019-01-15 Thread Ian Hobson
some kind of iterative / partitioning approach calling this repeatedly. But before I do I thought I'd ask if anyone has tackled this before. Can't find much on the web. Cheers. Duncan -- Ian Hobson Tel (+351) 910 418 473 -- https://mail.python.org/mailman/listinfo/python-list

Help needed with unittest and global

2011-01-09 Thread Ian Hobson
Hi all, I am trying to develop a PyQt application, and I want to unittest it. After three false starts, I am plainly unaware of something rather basic - can some kind person please help me out? This is a log to show what I have so far D:\work\ian>type testAll.py # coding=utf8 # testAll.py

Encoding problem - or bug in couchdb-0.8-py2.7.egg??

2010-09-20 Thread Ian Hobson
Hi all, I have hit a problem and I don't know enough about python to diagnose things further. Trying to use couchDB from Python. This script:- # coding=utf8 import couchdb from couchdb.client import Server server = Server() dbName = 'python-tests' try: db = server.create(dbName) except cou

Help needed - function apparently global cannot be called.

2010-09-07 Thread Ian Hobson
Hi all you experts, This has me beat. Has anyone any ideas about what might be going wrong? This is code from within a windows service (hence no print statements - no sys.stdout to print on!). I am trying to trace through to find where the code is not working. No stdout so I have to log to a

redirecting stdout and stderr for a windows service

2010-09-06 Thread Ian Hobson
Hi all, I am trying to redirect stdout and stderr on a python windows service, so that the service will not stall after 256 chars is written, and so I can use print for simple debugging. I have the following 4 lines (copy/pasted) in the source of my code. if __name__ == '__main__': sys.

Help needed with Windows Service in Python

2010-09-02 Thread Ian Hobson
Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason's book) running - see below. It starts fine - but it will not stop. :( net stop "Python Service" and using the services GUI both leave the services showing it as "stoppin

adodbapi help needed

2010-08-24 Thread Ian Hobson
Hi all, I am just starting to learn Python and I have a setup problem - I think. Python 3.1. I have a small test script that is not working as expected. Start script--- # coding=utf8 import adodbapi connectString = ( "DRIVER={MySQL ODBC 5.1 Driver} ;" "SERVER=127.0.0.1;" "

Re: Code generator and visitor pattern

2010-07-15 Thread Ian Hobson
On 15/07/2010 18:58, Karsten Wutzke wrote: Hello, this is obviously a Python OO question: Since Python isn't stringly typed, single-dispatch isn't available per se. So is the "double-dispatch" Visitor pattern, which is usually used in OO systems to implement code generators. So, what is the de

Re: Code generator and visitor pattern

2010-07-15 Thread Ian Hobson
On 15/07/2010 18:58, Karsten Wutzke wrote: Hello, this is obviously a Python OO question: Since Python isn't stringly typed, single-dispatch isn't available per se. So is the "double-dispatch" Visitor pattern, which is usually used in OO systems to implement code generators. So, what is the de

Where is StackPanel in IronPython / .Net 4?

2010-06-27 Thread Ian Hobson
Hi All, According to this page http://msdn.microsoft.com/en-us/library/system.windows.controls.stackpanel.aspx StackPanel is in the System.Windows.Controls Namespace When I try and set up a reference to that Namespace I get a "Could not add reference to assembly System.Windows.Controls" erro