Re: Multiprocessing / threading confusion

2013-09-05 Thread mar...@python.net
On Thu, Sep 5, 2013, at 03:27 PM, Paul Pittlerson wrote: > I'm trying to understand data handling using multiprocessing and > threading, haven't gotten very far without running into problems. This is > my code: [snip (not sure why you are using multiprocessing and threading at the same time] >

Re: Reading log and saving data to DB

2013-08-14 Thread mar...@python.net
On Wed, Aug 14, 2013, at 09:18 AM, Guy Tamir wrote: > Hi all, > > I have a Ubuntu server running NGINX that logs data for me. > I want to write a python script that reads my customized logs and after > a little rearrangement save the new data into my DB (postgresql). > > The process should run

Re: String object has no attribute "append"

2013-05-28 Thread mar...@python.net
On Tue, May 28, 2013, at 02:25 PM, Matt Graves wrote: > I receive this error while toying around with Functions... > > def pulldata(speclist,speccolumn): > with open('profiles.csv', 'r') as f: > reader = csv.reader(f) > for column in reader: > (sp

Re: Illegal seek error with seek() and os.lseek()

2013-05-14 Thread mar...@python.net
On Tue, May 14, 2013, at 03:00 PM, krishna2pra...@gmail.com wrote: > I am trying to use os.open() and os.lseek() methods to operate on a > device file in Linux. My code goes something like this - > > # first, open the file as a plain binary > try: > self.file = open(/dev/relpcfpga, "r+b", b

Re: [Off topic] Software epigrams

2013-05-13 Thread mar...@python.net
On Mon, May 13, 2013, at 05:20 AM, Steven D'Aprano wrote: > My, it's been a long time since I've seen these: > > http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html > > They pre-date the Zen of Python by at least a decade, and quite frankly I > think many of them miss the mark. But whet

Re: Help me with Event handlers please

2013-03-17 Thread mar...@python.net
On Sun, Mar 17, 2013, at 03:30 PM, Dreamer wrote: > Hi can anybody share some expertise on event handlers...i need to use em > to update user activity in my web appthanks in advance > Cheers You're proably going to need to be more specific about what help you need. Just a ge

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread mar...@python.net
> My questions: > 1. Why is Ruby on Rails much more popular than Django? AFAIK Rails got a slightly longer head start than Django. And it has been said that RoR's first killer app was a screencast. A little marketing can go a long way. Since then Django has caught up a bit with RoR in terms

Re: os.system() not responding on django... any reason?

2013-03-01 Thread mar...@python.net
On Fri, Mar 1, 2013, at 09:24 AM, Roy Smith wrote: > In article <4fcc93b7-3be9-416f-a2d4-bdc6cba21...@googlegroups.com>, > Jaiky wrote: > > [a lot of code involving ssh and paramiko] > > Here's a few general suggestions: > > 1) Try to reduce this to t

Re: Experiences with Py2Exe

2006-10-12 Thread MaR
We use py2exe on regular basis for most of our app's, both for internal and external distribution. We then pack it to an installer using NSIS (http://nsis.sourceforge.net/Main_Page) which is also free :o) -- http://mail.python.org/mailman/listinfo/python-list

Re: default variable in python $_

2006-10-11 Thread MaR
rh0dium wrote: > Hi all, > > So I have this simple little routine.. say like this.. > > > def foo() >return {"a":"b", "b":"c"} > > if foo(): >print "Have foo" > > > Now I want the dictionary item a (ie. b) > > How can I do it the above way or do I still have to go like this.. > > def foo(

Logic Programming

2006-10-10 Thread MaR
Yes! The question rears its head once again! ;o) I have done some search and trial and horrors.. (PyLog has vanished?) But I fail to find anything useful when it comes to do Logic Programming (e.g. Prolog'ish) in the context of Python. And yes, I tend to beleive that I need to! No, I do not really

Re: Making sure script only runs once instance at a time.

2006-09-29 Thread MaR
A very brutal but simple and effective method is to bind() to a socket on localhost eg (127.0.0.1, 4711), listen() but never accept(). Any other process trying to to bind() on the same port will fail.. When the process dies, the port is released automatically, pending som timedelay.. But this assu

Re: Socks server and client code in Python (Twisted?)

2006-09-29 Thread MaR
The answer may depend somewhat on whether your app is doing mostly storage (filessystem) or calculations (cpu). If you need to handle a fair number of sockets but do little processing, you may wish to look at the standard modules asyncore/asynchat. But Twisted is not a bad advice :o) Maybe a litt

Re: does anybody earn a living programming in python?

2006-09-26 Thread MaR
walterbyrd wrote: > If so, I doubt there are many. My share of the waterfall :o) I do earn my (preposterously nice *wink*) salary from doing *all* major efforts, at the company I work for, in Python. Not only that, since I started out here some 5 years ago, nearly all software development of

Re: Using py2exe to wrap a service?

2006-09-21 Thread MaR
CONCLUSION: Tim Golden sent me a patched version of his active_directory.py ver 0.4 and that solved my problem! Thanks all for your attention and in particular, Tim! //Maria 111a112 > from win32com.client.gencache import EnsureDispatch 180c181 < _connection = Dispatch ("ADODB.Connection") ---

Re: Using py2exe to wrap a service?

2006-09-21 Thread MaR
Tim Golden wrote: [snip..] > At this point there are several options open to us: > > (in no particular order) > 1) You could nudge the code at line 217 to make use of > that suggestion. > 2) I could do that and send you the result. > 3) I could alter the module so it doesn't use gencache > at all.

Re: Using py2exe to wrap a service?

2006-09-21 Thread MaR
Tim Golden wrote: > [MaR] > > | I do not call pythoncom.CoInitialize () as I tend to expect a module > | wrapping COM stuff to do that. > > Hmmm. A slightly philosophical point. [snip] :o) I agree! I have added the CoInit.. call to the __init__() of the threaded class

Re: Using py2exe to wrap a service?

2006-09-21 Thread MaR
Thanks guys! :o) It seems that no module is missing since the Service starts and the error message seem to indicate an error in the COM call to the AD. I would expect some other exception.. I do have a separate thread for the asyncore.loop() as I otherwise would risk a lockup. I do not call pyth