Re: wxPython/wxWidgets ok for production use ? (was Re: Quality assurance in Python projects containing C modules)

2008-03-10 Thread Frank Millman
uests. Robin is a very active contributor to the list, and frequently provides very insightful answers. Also there are a number of other active contributors, some of whom have designed their own composite widgets using the underlying components of the toolkit, and are happy to share them. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no string return?

2008-03-11 Thread Frank Millman
following - def SendMethod(request): xstring = "Some text" print ReturnMethod(request, xstring) def SendMethod(request): xstring = "Some text" return ReturnMethod(request, xstring) HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with wxPython

2008-03-24 Thread Frank Niessink
xPython users mailinglist and ask there. It's a very helpful mailinglist. Robin Dunn (wxPython author) is very active in answering questions from wxPython users. See http://www.wxpython.org/maillist.php Cheers, Frank -- http://mail.python.org/mailman/listinfo/python-list

What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
I have a xxx.py which has code as below: import string print dir(string) print string.printable when I run it, I got the strange error: "\n" "\n" "##result##\n" "##msg##\n" "##pass_no##\n" "##pot_num##\n" "##pots_mashed##\n" "##yb_used##\n" "##right##\n" "\n" ['__builtins__', '__doc__', '__fil

Re: What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
On Feb 10, 3:20 pm, Chris Rebert wrote: > On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter wrote: > > I have a xxx.py which has code as below: > > > import string > > > print dir(string) > > print string.printable > > > when I run it, I got the strange er

[OT] Google Groups in bad odour

2008-12-10 Thread Frank Millman
re have to find a suitable news client. Any recommendations? Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Append a new value to dict

2008-10-22 Thread Frank Niemeyer
cure implict behind-the-scenes stuff. > So you > either have to use a workaround: > > >>> try: > ... counter['B'] += 1 > ... except KeyError: > ... counter['B'] = 1 Or you could simply use if counter.has_key('B'): counter[&#x

Re: Append a new value to dict

2008-10-23 Thread Frank Niemeyer
[EMAIL PROTECTED] schrieb: > Frank Niemeyer: >> There's simply no >> way to increment a non-existent value - not without performing some >> obscure implict behind-the-scenes stuff. > > Like importing and using a defaultdict(int). There's nothing implici

Re: String to sequence

2009-03-14 Thread Frank Pan
>>> a = eval("[%s]" % "'AAR','ABZ','AGA','AHO','ALC','LEI','AOC','EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'") >>> a ['AAR', 'ABZ', 'AGA', 'AHO', 'ALC', 'LEI', 'AOC', 'EGC', 'SXF', 'BZR', 'BIQ', 'BLL', 'BHX', 'BLQ'] On Sat, Mar 14, 2009 at 5:09 PM, mattia wrote: > How can I convert the following

Re: __import__ function broken in 2.6

2009-04-26 Thread Frank Millman
rks in 2.6, and seems to be present in 3.1 as well. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with custom events in wxpython

2008-05-12 Thread Frank Niessink
Hi Jimmy, 2008/5/12 Jimmy <[EMAIL PROTECTED]>: > On May 11, 11:27 pm, "Frank Niessink" <[EMAIL PROTECTED]> wrote: > > 2008/5/11 Jimmy <[EMAIL PROTECTED]>: > > > I have a class A handling some data processing work and another class > > >

Alternative to Decimal type

2008-06-09 Thread Frank Millman
-- At this stage I have not built in any rounding options, but this can be done later if I find that I need it. Any comments will be welcome. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 10:54 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > > Hi Frank, > I don't know why you think Decimal is complicated: it has some > advanced features, but for what you seem to be doing it should be easy > to replace your 'Number' with it. In fact, it ma

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 3:07 pm, Mel <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > > class Number(object): > >     def __init__(self,value,scale): > >         self.factor = 10.0**scale > >         if isinstance(value,Number): > >             value = value.value

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 4:06 pm, Frank Millman <[EMAIL PROTECTED]> wrote: > > Thanks for the reply, Mel. I don't quite understand what you mean. As so often happens, after I sent my reply I re-read your post and I think I understand what you are getting at. One problem with my approach is tha

Re: Alternative to Decimal type

2008-06-11 Thread Frank Millman
have not catered for, resulting in errors. If this is the case, I will drop this like a hot potato and stick to the Decimal type. Can anyone point out any pitfalls I might be unaware of? I will be happy to show the code for the new Number class if anyone is interested. Thanks Frank -- http://mai

Re: Alternative to Decimal type

2008-06-11 Thread Frank Millman
On Jun 11, 4:39 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > Thanks to all for the various replies. They have all helped me to > > refine my ideas on the subject. These are my latest thoughts. > > Out of curiosity, what is the purpose

Re: Alternative to Decimal type

2008-06-12 Thread Frank Millman
On Jun 11, 11:48 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Thanks to all for the various replies. They have all helped me to > refine my ideas on the subject. These are my latest thoughts. > [snip] > > My main concern is that my approach may be naive, and that I will

Question about properties

2008-07-17 Thread Frank Millman
et_y() 123 >>>t.__y AttributeError: 'Test' object has no attribute '__y' I was surprised that I could do the following - >>>t.__y = 456 >>>t.__y 456 >>>t.get_y() 123 It's not important, but I am curious to know what is going on internally here. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Is this a valid use of 'import'?

2008-07-22 Thread Frank Millman
ing the socket using select.select. It also exposes some functions that disguise the complexity of reading from and writing to the socket. This enables me to write a 'client' program that look like this - --- from Utils.client import * connect(userid=&#

Re: Is this a valid use of 'import'?

2008-07-22 Thread Frank Millman
On Jul 22, 5:22 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > In this particular case, when it is executed, it does a whole lot > > more. It reads in some parameters, establishes a socket connection, > > starts a thread, and starts monitoring the

Questions about asyncore

2008-07-29 Thread Frank Millman
ges, I run a 'while 1' loop in the main thread, with a sleep of 0.1, until recvData has something in it. It works, but it seems odd to use a separate thread, as one of the points of asyncore is to avoid multi-threading. Is there a better way to write the client program? Thanks Frank M

Re: Questions about asyncore

2008-07-30 Thread Frank Millman
On Jul 29, 3:40 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 29 Lug, 13:09, Frank Millman <[EMAIL PROTECTED]> wrote: Thanks for the reply, Giampaolo. > > The benefit of asynchat is that it automatically handles the buffering > of

Re: Questions about asyncore

2008-07-30 Thread Frank Millman
On Jul 30, 7:50 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 30 Lug, 09:49, Frank Millman <[EMAIL PROTECTED]> wrote: > Thanks again, Giampaolo, your input is really appreciated. > > I pretty much have the same overview I had before. > As far

Re: Questions about asyncore

2008-07-31 Thread Frank Millman
On Jul 31, 10:39 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 31 Lug, 08:30, Frank Millman <[EMAIL PROTECTED]> wrote: > > > I don't know why you find more convenient running asyncore.loop in a > separate thread but if your purpose is

Re: Questions about asyncore

2008-08-05 Thread Frank Millman
enance). > > (I normally don't hop on this list to comment, so please cc me on any > replies) > - Josiah > Valuable insights. Much appreciated. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython pop--up ("could not retrieve information...")

2008-08-07 Thread Frank Niessink
Tasks ? Cheers, Frank -- http://mail.python.org/mailman/listinfo/python-list

Is Leo better than Vim and emacs?

2008-04-09 Thread wang frank
Hi, Thanks for developing Leo. I have been using Vim for long time to write code. Is it a good time to switch to Leo? what is the advantage of Leo against vim and emacs? Thanks Frank _ マイクロソフトの最新次世代ブラウザIE7にMSN版ならではの便利な機能を

Re: Remote mac address

2008-04-14 Thread Frank Stutzman
s you could (if you had permission) parse the /proc/net/arp file. Granted this isn't terribly far off from parsing the output of 'arp -a', but at least it keeps you from spawning a shell to run the 'arp -a' in. -- Frank Stutzman -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with custom events in wxpython

2008-05-11 Thread Frank Niessink
is > updated. > I know cutom events in wxpython may work. You may want to look at the pubsub module. Available as wx.lib.pubsub in wxPython: http://www.wxpython.org/docs/api/wx.lib.pubsub-module.html, and also available separately on PyPI: http://pypi.python.org/pypi/PyPubSub/ Cheers, Fran

Re: atomic increment

2008-08-26 Thread Frank Millman
gt; > As above - the lock (under the assumption that it is actually a > threading.Lock) will ensure that. > > Diez Just out of interest, would the following, without a lock, be safe? old, atomic_int = atomic_int, atomic_int+1 Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Ensure only single application instance.

2008-08-29 Thread Frank Millman
rograms that provide functionality similar to setlock. -- HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

XML-schema 'best practice' question

2008-09-17 Thread Frank Millman
e the document with all values filled in. 2. Use python to check for missing values and fill in the defaults when processing the document. Or maybe the best practice is to *always* validate a document before processing it. How do experienced practitioners handle this situation? Thanks for any

Re: XML-schema 'best practice' question

2008-09-19 Thread Frank Millman
On Sep 18, 8:28 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > This is not strictly a Python question, but as I am writing in Python, > and as I know there are some XML gurus on this list, I hope it is > appropriate here. > > XML-schemas are used to def

Re: Sample code required to validate a xml file against XSD

2008-10-02 Thread Frank Millman
eve that lxml also handles xsd files, but I have not tried it, so I can't give any details. HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

SSL/TLS - am I doing it right?

2006-03-13 Thread Frank Millman
way that I am doing something wrong. Therefore I would be grateful if someone would review the steps I have taken (listed below), and advise on whether there is anything obviously wrong or missing. TIA Frank Millman 1. Install -- OpenSSL M2Crypto TLSLite 2. Create KeyPair

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Frank Millman
Sybren Stuvel wrote: > Frank Millman enlightened us with: > > while 1: > > conn,addr = s.accept() > > c = TLSConnection(conn) > > c.handshakeServer(certChain=certChain,privateKey=privateKey) > > data = c.recv(1024) > > It'

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Frank Millman
Paul Rubin wrote: > "Frank Millman" <[EMAIL PROTECTED]> writes: > > I was hoping to avoid this step. The point of the exercise for me is > > encryption. I am not too worried about authentication. The next step in > > my app is for the client to enter a use

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Frank Millman
Sybren Stuvel wrote: > Frank Millman enlightened us with: > > The point of the exercise for me is encryption. I am not too worried > > about authentication. > > Encryption can't function fully without authenication. > Ok, I have been thinking about the replie

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Frank Millman
Sybren Stuvel wrote: > Frank Millman enlightened us with: > > If I understand correctly, a 'man-in-the-middle' attack would > > involve someone setting up a 'pseudo server', which gives the > > correct responses to the client's attempt to log in >

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Frank Millman
Paul Rubin wrote: > "Frank Millman" <[EMAIL PROTECTED]> writes: > > I don't know how to check the certificates. None of the documentation I > > have read spells out in detail how to do this. > > Lemme see if I can find you something--I'll put up an

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Frank Millman
port select(). There is an abstract class called AsyncStateMachine which I think is provided to simulate this. If I do not figure it out I may come back here with more questions, but I will start a new thread for that. Many thanks to all. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL/TLS - am I doing it right?

2006-03-15 Thread Frank Millman
simply says "Although rare, the server can also request a certficate from the client". Obviously there are many different scenarios, but for my particular one, user id and password is 'good enough'. Frank -- http://mail.python.org/mailman/listinfo/python-list

Popfile and Poplib - Can They Work Together?

2006-03-15 Thread Frank Churchill
Has anyone used poplib and popfile together? I've tried everything I can think of to specify SRVR in poplib: "127.0.0.1:8081" "127.0.0.1,port=8081" "localhost:8081" "localhost,port=8081" and probably a few other things, but poplib can't see that it is looking at a mail server. popfile works fin

Re: Pycrypto - active ??

2006-03-20 Thread Frank Millman
initial handshake, there is hardly any noticeable slowdown. However, I have not found an MSW binary for Python 2.4 for any of the above packages. TLSLite works ok by itself, but it is noticeably slower when transferring large amounts of data. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Pycrypto - active ??

2006-03-20 Thread Frank Millman
Alex Martelli wrote: > Frank Millman <[EMAIL PROTECTED]> wrote: >... > > The docs say that if you have any of m2crypto, cryptlib, pycrypto, or > > GMPY installed, it will be used for fast cryptographic operations. I >... > > However, I have not found an

Re: Pycrypto - active ??

2006-03-20 Thread Frank Millman
to use an external module like m2crypto for that. When you say "It has to ...", do you mean that TLSLite will do this automatically if m2crypto is installed, or is it up to me to call the m2crypto functions to perform this check? TIA Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: Pycrypto - active ??

2006-03-20 Thread Frank Millman
Paul Rubin wrote: > "Frank Millman" <[EMAIL PROTECTED]> writes: > > > TLSLite is so far not really a complete SSL implementation by itself. > > > It doesn't know how to properly check the signatures on certificate > > > chains. It h

Re: Simple but fundamental: How to import a jython class?

2006-03-23 Thread Frank Schenk
- > import X > x = X() > x.hello() > > > I get TypeError: call of non function (module 'X') > Both files are in the same directory. try from X import X or x = X.X() Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test wxPython by unittest

2006-03-24 Thread Frank Niessink
;and then some') self.assertEqual('whateverand then some', self.textCtrl.GetValue()) if __name__ == '__main__': unittest.main() Cheers, Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: how to comment lot of lines in python

2006-04-03 Thread Frank Millman
e: Replace OK Done. To uncomment, as above but set Fill character to a space. It feels a bit fiddly, but I reckon if you use it a few times it will become quite smooth. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Best way to create a copy of a list

2006-04-03 Thread Frank Millman
tical, or is there a subtle distinction which I should be aware of. I did some timing tests, and 2 is quite a bit faster if 'row' pre-exists and I just measure the second statement. TIA Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to create a copy of a list

2006-04-04 Thread Frank Millman
Fredrik Lundh wrote: > Frank Millman wrote: > > > I have found two ways of doing it that seem to work. > > > > 1 - row = table[23][:] > > > > 2 - row = [] > > row[:] = table[23] > > > > Are these effectively identical, or is the

Re: Best way to create a copy of a list

2006-04-04 Thread Frank Millman
Alex Martelli wrote: > Frank Millman <[EMAIL PROTECTED]> wrote: >... > > If they are all equivalent from a functional point of view, I lean > > towards the second version. I agree with Rune that the third one is > > nicer to read, but somehow the [:] synt

how to login a newsgroup programmely and fetch its emails to read?

2006-04-05 Thread Frank Potter
how to login a newsgroup and get its informations by an account and a password? -- http://mail.python.org/mailman/listinfo/python-list

Re: Quickie: converting r"\x2019" to int

2006-04-07 Thread Frank Millman
uot; Therefore int(' 19') is equal to 19. "When an 'r' prefix is present, a character following a backslash is included in the string without change, and all backslashes are left in the string". Therefore r'\x2019' is left unchanged, and cannot be converted

Re: minidom + wxPython woes

2006-04-07 Thread Frank Millman
link. http://groups.google.com/group/comp.lang.python/browse_frm/thread/6fc1097d26083e43/5fbdf493f3c38942?q=&rnum=1&hl=en#5fbdf493f3c38942 In my case, it turned out to be a bug in the pyexpat module - it is known about, but for some reason difficult to fix, so it is still there. I found a workaround, which is documented in the above thread. HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-08 Thread Frank Millman
begin. > Any clues? Is there a specific name for this technique? The specific name you are looking for is to 'join' tables. There will be many references and tutorials available, but I suggest you start with the PostgreSQL tutorial, which is part of the documentation supplied with P

Re: minidom + wxPython woes

2006-04-08 Thread Frank Millman
Fredrik Lundh wrote: > Frank Millman wrote: > > > This sounds similar to a problem I reported a few months ago. This is > > the link. > > > http://groups.google.com/group/comp.lang.python/browse_frm/thread/6fc1097d26083e43/5fbdf493f3c38942?q=&rnum=1&hl=en#5fbd

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Frank Millman
which is what they would expect. Then you can mention that, if they just want the integer portion, they can use int(3/2). I think that most people with the slightest understanding of basic arithmetic will relate to this without a problem. My 2c Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-10 Thread Frank Millman
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Frank Millman > wrote: > > > Then you can mention that, if they just want the integer portion, they > > can use int(3/2). I think that most people with the slightest > > understanding of bas

Question about 'remote objects'

2009-12-09 Thread Frank Millman
re any particular benefit in using remote objects as opposed to writing a SocketServer? Any advice will be much appreciated. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I Block Events in wxPython

2009-12-09 Thread Frank Millman
received and acted upon, I have - event_waiting.set() # set event to True, which unblocks the gui thread HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I Block Events in wxPython

2009-12-10 Thread Frank Millman
Stephen Hansen wrote: > On Wed, Dec 9, 2009 at 10:21 PM, Frank Millman wrote: > >> I also need to block events in my wxPython app, though the time duration >> is >> very short. I have a separate thread that sends notification of gui >> events >> to a server

Re: How do I Block Events in wxPython

2009-12-10 Thread Frank Millman
x27;t need it. In fact, as I am writing this, I realise that I don't need a flag at all. I just override FilterEvent, and return True. Then when I want to block, I call SetCallFilterEvent(True), and when I want to stop, I call SetCallFilterEvent(False). This is very useful. Thanks again. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about 'remote objects'

2009-12-11 Thread Frank Millman
Frank Millman wrote: > > I am writing a multi-user business/accounting application. It is getting > rather complex and I am looking at how to, not exactly simplify it, but > find a way to manage the complexity. > [...] > > Is there any particular benefit in using remote

Python for simulating BRDF

2009-12-12 Thread Franky Frank
, being a higher level programming language, do we encounter more problems in debugging while developing such simulating program? Thank you very much for your kind help in the advance. Sincerely, Franky Frank -- http://mail.python.org/mailman/listinfo/python-list

Minor bug in multiprocessing?

2009-12-19 Thread Frank Millman
pass "name='test'" as one of the arguments, I get the following - Traceback (most recent call last): File "F:\junk\multiprocess\mp5.py", line 37, in p = Frank(name='test') File "F:\junk\multiprocess\mp5.py", line 18, in __init__ self.na

Re: Minor bug in multiprocessing?

2010-01-05 Thread Frank Millman
"Aahz" wrote: > Frank Millman wrote: >> >>Is this worth reporting, if it has not been reported already? > > Defiitely report it. Thanks, Aahz. I took the lack of responses to indicate that there was no reason *not* to report it, so I reported it on 24th De

multiprocessing and remote objects

2010-01-08 Thread Frank Millman
following traceback - Traceback (most recent call last): File "F:\junk\multiprocess\mp13b.py", line 29, in acno = cust.add_column('Acno') File "", line 2, in add_column File "C:\Python26\lib\multiprocessing\managers.py"

TypeError: __name__ must be set to a string object

2010-01-11 Thread Frank Millman
tr('my_function'), my_function) Is there any reason why __name__ cannot be a unicode object in Python 2.x? If so, there is probably little chance of this being changed, so it is probably not worth reporting. Any thoughts? Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: __name__ must be set to a string object

2010-01-15 Thread Frank Millman
"Frank Millman" wrote in message news:hieoq6$4i...@ger.gmane.org... > Hi all > > This problem is similar to one I posted recently regarding the > multiprocessing module and unicode. > > However, although this one manifests itself while using the > multiprocess

Is defaultdict thread safe?

2010-01-25 Thread Frank Millman
Hi all Is defaultdict thread safe? Assume I have - from collections import defaultdict my_dict = defaultdict(list) If two threads call "my_dict['abc'].append(...)" simultaneously, is it guaranteed that my_dict['abc'] will end up containing two el

Re: Is defaultdict thread safe?

2010-01-25 Thread Frank Millman
On Jan 25, 11:26 am, Raymond Hettinger wrote: On Jan 25, 12:59 am, "Frank Millman" wrote: > Hi all > Is defaultdict thread safe? Sometimes. It depends on whether an operation has callbacks to pure Python. > Assume I have - > from collections import def

Invitation to connect on LinkedIn

2009-10-14 Thread Frank Pan
LinkedIn Frank Pan requested to add you as a connection on LinkedIn: -- Jaime, I'd like to add you to my professional network on LinkedIn. - Frank Accept invitation from Frank Pan http://www.linkedin.

bad operand type for unary +: tuple

2009-10-22 Thread Frank Millman
= ('a', 'b', 'c') >>> t2 = 'x', + t[1:] Traceback (most recent call last): File "", line 1, in TypeError: bad operand type for unary +: 'tuple' >>> It is not a problem - I will just stick to using the brackets. However, I would be interested to find out the reason for the error. Version is 2.6.2. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: bad operand type for unary +: tuple

2009-10-22 Thread Frank Millman
Diez B. Roggisch wrote: > Frank Millman wrote: > >> >>>>> t = ('a', 'b', 'c') >>>>> t2 = 'x', + t[1:] >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: bad

pyodbc - problem passing None as parameter

2009-10-22 Thread Frank Millman
you to supply arguments directly, instead off putting them inside a tuple. I have tried with and without a tuple - the result is the same. Any assistance will be appreciated. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: pyodbc - problem passing None as parameter

2009-10-22 Thread Frank Millman
Tim Golden wrote: > Frank Millman wrote: >> >>>>> cur.execute('select * from ctrl.dirusers where todate is ?', None) >> Traceback (most recent call last): >> File "", line 1, in pyodbc.ProgrammingError: ('42000', >>

Re: pyodbc - problem passing None as parameter

2009-10-23 Thread Frank Millman
Tim Goldenwrote: > Frank Millman wrote: >> >> I want the final WHERE clause to show 'WHERE todate IS NULL'. > > Of course, I understand that. What I mean is that if a piece > of SQL say: > > WHERE table.column IS ? > > then the only possible (meani

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread Frank Millman
ur main program - - to start the timer tmr = Timer() tmr.start() - to stop the timer tmr.stop() It is easy to extend this by passing the number_of_seconds_to_wait, or a function name to be executed, as arguments to the Timer. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run a repeating timer every n minutes?

2009-10-30 Thread Frank Millman
the answer is yes, but I am no expert. Perhaps someone else can confirm. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library "support" propaganda lists?

2009-10-30 Thread Frank Millman
"Aaron Watters" wrote in message news:69f74b6c-e996-4e5c-a9f2-b5173e33a...@d21g2000yqn.googlegroups.com... > Let me vent my annoyance. > > In the last couple months on a few occasions > I've tried various Python libraries (and I'm not going to > name names) and run into some problem. > > Followi

Re: Python library "support" propaganda lists?

2009-10-30 Thread Frank Millman
"Aaron Watters" wrote in message news:69f74b6c-e996-4e5c-a9f2-b5173e33a...@d21g2000yqn.googlegroups.com... > Let me vent my annoyance. > > In the last couple months on a few occasions > I've tried various Python libraries (and I'm not going to > name names) and run into some problem. > > Followi

Re: Python library "support" propaganda lists?

2009-10-30 Thread Frank Millman
has happened to me before. The instructions typically do not make it clear that you have to subscribe first, so I just posted. After getting no response, I tried subscribing and then posting, and it worked. Instructions could be clearer, I agree. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Simple question about Queue.Queue and threads

2010-02-05 Thread Frank Millman
tasks and terminated itself. However, the queue is not empty - it still has the final None in it. Is it advisable to finalise the cleanup like this? - while not q.empty(): q.get() q.task_done() q.join() Or is this completely redundant? Thanks Frank Millman -- http

Re: Simple question about Queue.Queue and threads

2010-02-05 Thread Frank Millman
On Feb 6, 7:59 am, "Gabriel Genellina" wrote: En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman escribió: [...] > However, the queue is not empty - it still has the final None in it. Yes - but who cares? :) That was my point. I didn't think I needed to care, but I wa

Re: Simple question about Queue.Queue and threads

2010-02-08 Thread Frank Millman
each worker thread). Thanks, Steven. This works perfectly in my scenario, and tidies up the code a bit. Minor point - according to the 2.6 docs, .setDaemon(True) is the old API - the current way of specifying this is .daemon = True. Thanks for the tip. Frank -- http://mail.python.org

Re: how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-11 Thread Frank Millman
get=httpd.serve_forever).start() Now it does respond to Ctrl-C. HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Sublassing tuple works, subclassing list does not

2010-03-30 Thread Frank Millman
. return list.__new__(cls, values) ... names = ['A', 'B', 'C'] values = ['a', 'b', 'c'] lst = MyList(names, values) Traceback (most recent call last): File "", line 1, in TypeError: list() takes at most 1 argument (2 given) I can find a workaround, but I would be interested to know the reason why it does not work. Version is 2.6.2. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Sublassing tuple works, subclassing list does not

2010-03-31 Thread Frank Millman
"lbolla" wrote in message news:f8011c0b-0b1b-4a4f-94ff-304c16ef9...@q16g2000yqq.googlegroups.com... On Mar 31, 7:49 am, "Frank Millman" wrote: Hi all When subclassing immutable types, you need to override __new__; otherwise you need to override __init__. Perfe

Re: Sublassing tuple works, subclassing list does not

2010-03-31 Thread Frank Millman
On Mar 31, 8:49 am, "Frank Millman" wrote: Hi all Thanks to all for the helpful replies. Rob, you are correct, I had not realised I was adding attributes to the class instead of the instance. Your alternative does work correctly. Thanks. Carl, I understand your concern about

Re: Getting Local MAC Address

2010-04-02 Thread Frank Millman
--- I only target windows and linux. I don't know if it works for all platforms. I wrote this a long time ago. I think it would now be preferable to use subprocess() instead of os.popen(). Note the commented-out line in the linux block. This is an alternative method I cri

Re: Program, Application, and Software

2010-11-19 Thread Josef Frank
Am 19.11.2010 15:22, schrieb Martin Gregorie: On Fri, 19 Nov 2010 01:43:28 +0100, Alexander Kapps wrote: What difference does it make? Is 'print "Hello"' a program or a script? Are you saying, that it depends on whether you have to manually call some compiler? Thats the way the term 'script'

instance has no __call__ method

2010-12-10 Thread frank cui
Hi all, I'm a novice learner of python and get caught in the following trouble and hope experienced users can help me solve it:) Code: --- $ cat Muffle_ZeroDivision.py #!/usr/bin/env python class MuffledCalculator: muffled =

Question on the Module Import

2011-01-17 Thread frank cui
coding style, we dont use the second form,but does the first one also reach the same effect ? (importing all the classes and functions and pollute the namespace?) thanks in advance for your answer. Regards, Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple values for keyword argument

2011-01-29 Thread Frank Dierkes
On Sat, 29 Jan 2011 14:18:30 +0100, Tobias Blass wrote: > On Sat, 29 Jan 2011, Francesco Bochicchio wrote: > >>> class MainWin(Frame): >>>         def create_edit(row,self): >>> def create_edit(self, row): >> >> >> > Ok it works now. So the problem was that python requires 'self' to be

wsgi, ajax, and multiple requests

2011-02-09 Thread Frank Millman
can process it, call start_response(), and return the response body, but I cannot figure out how to get back to process the queued request. Any advice will be much appreciated. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Frank Millman
Frank Millman wrote: Hi all I have a question about wsgi. As far as I can tell from the spec and from the reference implementation, wsgi requires that each request from the client is responded to by one or more headers, followed by the response body. It is then ready to handle the next

2to3 chokes on bad character

2011-02-23 Thread Frank Millman
The one that was accepted consists of three bytes - 226, 128, 153 (as reported by python 2.6) or 226, 8364, 8482 (as reported by python3.2). The one that crashed consists of a single byte - 146 (python 2.6) or 8217 (python 3.2). The issue is not that 2to3 should handle this correctly, but th

<    5   6   7   8   9   10   11   >