Re: Inconsistent SMTP/Gmail connection drop

2011-08-04 Thread Astley Le Jasper
Just to add a little bit to the mix, I have started having these problems since I rebuilt my machine (Xubuntu 11) and I changed the disc formats to ext4 without even thinking about it ... I was wondering if maybe that had something to do with it? -- http://mail.python.org/mailman/listinfo/python-l

Re: Inconsistent SMTP/Gmail connection drop

2011-08-04 Thread Astley Le Jasper
Thanks for those suggestions. I tried something last night before I got your ideas. 1. I added a line to send a copy of the report just to me, 2 lines before the line where it emails the report to all the recipients. 2. I also added a timer.sleep(5) pause just before the line that emails the repo

Re: Inconsistent SMTP/Gmail connection drop

2011-08-03 Thread Astley Le Jasper
11 at 5:46 PM, Astley Le Jasper > wrote: >> >> Any ideas? >> > > Is it possible that the first email is sent before the network connection > has been properly established? > > -- > David > blog: http://www.traceback.org > twitter: http://twitter.com/dsta

Inconsistent SMTP/Gmail connection drop

2011-08-03 Thread Astley Le Jasper
I have a laptop that wakes up and then runs a script that collects info and sends an email with a spreadsheet (zipped and about 350KB) report to a number of people. However, every time I get the following error: File "/usr/lib/python2.7/smtplib.py", line 343, in getreply raise SMTPServerDisco

Re: Multilingual documentation solutions

2010-10-27 Thread Astley Le Jasper
Thanks for the pointer. I'll have a look into it. -- http://mail.python.org/mailman/listinfo/python-list

Multilingual documentation solutions

2010-10-27 Thread Astley Le Jasper
My query isn't specific to Python, but some of you might have been in a similar position and if there are any technical solutions, I'd prefer to do it in Python. I have developed an application using Django and the supporting documentation needs to be multilingual. This isn't at code level, rather

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
> I think you have the same bug as Alf's code, you never merge existing > groups. Have you tried Arnaud's counterexample? > > By the way, are ('a', 'b') and ('b', 'a') to be considered equivalent for > your problem? > > Peter Hi Peter, Yes. I realise that this doesn't take into account existing

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
Thanks all. I was playing around with this and came up with another solution using dictionaries (... comfort zone ...!!) <<< Code >> from operator import itemgetter def group_stuff(data): group_dic = {} group_id = 0

Re: Grouping pairs - suggested tools

2010-09-21 Thread Astley Le Jasper
Thanks for the feedback both. I'll have a look at these. One of the frustrating things I find about python is that there are so many modules. There have been times when I've spend ages doing something and then some has said, "Oh yeah, there is a module for that". Anyway. Nearly finished. Cheers

Grouping pairs - suggested tools

2010-09-20 Thread Astley Le Jasper
I have a list of tuples that indicate a relationship, ie a is related to b, b is related to c etc etc. What I want to do is cluster these relationships into groups. An item will only be associated with a single cluster. Before I started, I wondered if there was any particular tool within Python I

Re: Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Astley Le Jasper
On Jun 15, 10:44 am, Tim Golden wrote: > On 15/06/2010 09:32, Astley Le Jasper wrote: > > > Does pywin32 use elements from Windows itself, or excel when > > dispatching? > > Yes: it's simply exposing to the Python user the API provided > by MS Office (or whatever

Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Astley Le Jasper
I'm creating excel docs on the fly using XLWT. However, I need to include filters which I believe can only be done with pywin32. Does pywin32 use elements from Windows itself, or excel when dispatching? -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a single list

2010-05-31 Thread Astley Le Jasper
On May 29, 4:10 pm, superpollo wrote: > Astley Le Jasper ha scritto: > > > > > This is probably a really silly question but, given the example code > > at the bottom, how would I get a single list? > > > What I currently get is: > > > ('id

Creating a single list

2010-05-29 Thread Astley Le Jasper
This is probably a really silly question but, given the example code at the bottom, how would I get a single list? What I currently get is: ('id', 20, 'integer') ('companyname', 50, 'text') [('focus', 30, 'text'), ('fiesta', 30, 'text'), ('mondeo', 30, 'text'), ('puma', 30, 'text')] ('contact', 5

Re: Default if none

2010-04-29 Thread Astley Le Jasper
... oh ... that simple. Now I feel dumb. Thanks! ALJ -- http://mail.python.org/mailman/listinfo/python-list

Default if none

2010-04-29 Thread Astley Le Jasper
I realise I could roll my own here, but I wondered if there was an inbuilt version of this? >. def default_if_none(*args): for arg in args: if arg: return arg return None x = None y = 5 z = 6 print default_if_none(x,y,z) >> 5 >

Re: Python, Reportlabs, Pil and Windows 7 (64bit)

2010-03-15 Thread Astley Le Jasper
Hi Robin, It looks like you've been busy. I'm sorry but you are well over my head at the moment! :-) If you need me to test an install then I'd be happy to help. However, I just received an email from Christoph Gohlke saying: " ... There are 64 bit versions of Reportlab and PIL for Python 2.6 f

Re: Python, Reportlabs, Pil and Windows 7 (64bit)

2010-03-11 Thread Astley Le Jasper
@Robin Thanks. I thought that this seemed to be a general python thing because it was effecting both installs. However, after also reading Martin's comments ... @Martin > This is somewhat imprecise: is it > a) that your CPU is AMD64, and thus supports 64-bit mode, or > b) that *in addition*, your

Python, Reportlabs, Pil and Windows 7 (64bit)

2010-03-11 Thread Astley Le Jasper
I have a Windows 7 (64bit AMD) machine and am having quite a lot of problems installing Reportlabs and Pil. I wondered if anyone else has had the same issues and what the best way of dealing with it. So far I've tried: 1. Reportlabs / Pil 32 installers - I've tried using these but they can't find

Re: Noob thread lock question

2009-12-03 Thread Astley Le Jasper
When you say don't forget about the GIL, what should I not be forgetting? I'm using sqlite and the following: <<> thread_lock = threading.RLock() def db_execute(sql): thread_lock.acquire() try: connection = sqlite3.connect(database_name)

Re: Noob thread lock question

2009-12-03 Thread Astley Le Jasper
Cheers for the responses. ALJ -- http://mail.python.org/mailman/listinfo/python-list

Noob thread lock question

2009-12-02 Thread Astley Le Jasper
I have a number of threads that write to a database. I have created a thread lock, but my question is this: - If one thread hits a lock, do a) all the other threads stop, or b) just the ones that come to the same lock? - I presume that the answer is b. In which case do the threads stop only if the

Re: What do you think of ShowMeDo

2009-04-30 Thread Astley Le Jasper
Gosh ... it's all gone quite busy about logging in, gui etc. Certainly, I would try to make it clearer what is free and what isn't. But flash ... using that doesn't bother me. Loggin in ... fine ... I don't care as long as it's quick and there is something I might want. i just wanted to know if th

What do you think of ShowMeDo

2009-04-28 Thread Astley Le Jasper
Hi, I've just stumbled over this (http://showmedo.com/) and being the very visual person I am, it seems like it could be a good way to learn about python. However, before I smack down $60, I wondered if anyone had any opinions on it. My gut feel is that it could be pretty good. ALJ -- http://mail

Re: Extracted files form zip corrupted

2009-03-26 Thread Astley Le Jasper
Thanks MRAB. What do you mean about backslashes? -- http://mail.python.org/mailman/listinfo/python-list

Extracted files form zip corrupted

2009-03-26 Thread Astley Le Jasper
I want to batch extract files from a directory of zips. The thing is that the files are excel spreadsheets. I don't want to read them in python, just dump them as extracted files in another directory. However, when I do a test the excel file becomes corrupted. Any clues? >>

Re: Running a Python script from crontab

2008-12-04 Thread Astley Le Jasper
On Dec 4, 12:34 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, Philip > > Semanchuk wrote: > > In my experience, the environment in which a cron job runs is > > different from the environment in which some command line scripts run... > >

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
On 3 Dec, 19:49, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: > > > > > On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > >> On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: > > >

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: > > > I've included a switch to include or exclude theloggingto console. > > Whenloggingonly to file, the script runs fine. > > > Of course, I

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
I've included a switch to include or exclude the logging to console. When logging only to file, the script runs fine. Of course, I still don't understand why dual logging, and specifically to the console, causes a problem and if anyone has any comments about the dual output logging code above then

Re: Running a Python script from crontab

2008-12-03 Thread Astley Le Jasper
Ok ... this is odd. I tried gregory's suggestion of redirecting the stdout & stderr to a text file. This worked. I could see all the logging information. However, there was no error to see this time ... the application worked completely without any problems. I also then tried Jon's suggestion of

Re: Running a Python script from crontab

2008-12-02 Thread Astley Le Jasper
James ... thanks for the suggestion. I have done this and the error logging usually catches all my errors and logs them. I wondered if logging itself was failing! Philip ... thanks also. I did wonder about making the everything explicit. I've seen that mentioned elsewhere. Writing out the stdout &

Running a Python script from crontab

2008-12-02 Thread Astley Le Jasper
I need help ... I've been looking at this every evening for over a week now. I'd like to see my kids again! I have script that runs fine in the terminal but when I try to run it in a crontab for either myself or root, it bails out. The trouble is that obviously I get no console when using crontab

Re: Threading on an old machine

2008-11-10 Thread Astley Le Jasper
On 10 Nov, 16:20, Terry Reedy <[EMAIL PROTECTED]> wrote: > Astley Le Jasper wrote: > > I have an application that put on an old machine with a fresh Xubuntu > > installation (with Python 2.5). But I can't get the threading to work > > > The application was wri

Re: Threading on an old machine

2008-11-10 Thread Astley Le Jasper
On 10 Nov, 11:07, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > Sorry ... that should be: > > for sitename in mysites: >     log.info("define thread") > > thread_list[sitename]=threading.Thread(name=sitename,target=myproceedure, > args=(sitename,)) >     log

Re: Threading on an old machine

2008-11-10 Thread Astley Le Jasper
Sorry ... that should be: for sitename in mysites: log.info("define thread") thread_list[sitename]=threading.Thread(name=sitename,target=myproceedure, args=(sitename,)) log.info("done") thread_list[sitename].start() log.info("Started") -- http://mail.python.org/mailman/listinfo/p

Threading on an old machine

2008-11-10 Thread Astley Le Jasper
I have an application that put on an old machine with a fresh Xubuntu installation (with Python 2.5). But I can't get the threading to work The application was written on a combination of Windows XP and OpenSuse and has been running without any problems using Eclipse/ Pydev. However, now that I tr

Re: PySqlite - division of real numbers without decimal fractions

2008-11-10 Thread Astley Le Jasper
On 8 Nov, 05:39, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 07 Nov 2008 14:36:52 +0100, Gerhard Häring <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Astley Le Jasper wrote: > > > I've been getting errors recently whe

Re: PySqlite - division of real numbers without decimal fractions

2008-11-07 Thread Astley Le Jasper
On Nov 7, 6:36 am, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Nov 6, 3:46 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > > > I've been getting errors recently when using pysqlite. I've declared > > the table columns as real numbers to 2 decimal place

PySqlite - division of real numbers without decimal fractions

2008-11-06 Thread Astley Le Jasper
I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that happen to have no decimal fractions, the results through pysqlite are coming through as integers. The funn

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
Thanks for all the responses. That helps. Ta ALJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
On 16 Oct, 18:53, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Astley Le Jasper schrieb: > > > > > On 16 Oct, 16:52, Carsten Haese <[EMAIL PROTECTED]> wrote: > >> Astley Le Jasper wrote: > >>> Sorry for the numpty question ... > &g

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
On 16 Oct, 16:52, Carsten Haese <[EMAIL PROTECTED]> wrote: > Astley Le Jasper wrote: > > Sorry for the numpty question ... > > > How do you find the reference name of an object? > > > So if i have this > > > bob = modulename.objectname() > > >

Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob' -- http://mail.python.org/mailman/listinfo/python-list

Re: Good programming style

2008-09-12 Thread Astley Le Jasper
On 12 Sep, 12:44, Bruno Desthuilliers wrote: > Astley Le Jasper a écrit : > > > I'm still learning python and would like to know what's a good way of > > organizing code. > > > I am writing some scripts to scrape a number of different website that > >

Xpath for HTML processing

2008-09-04 Thread Astley Le Jasper
Can anyone suggest something inthat can process an XPath like the following: "/html/body/table[2]/tbody/tr/td[5]/table/tbody/tr[3]/td/table[3]/ tbody/tr[5]/td" Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre method keyword-arg bug.

2008-08-18 Thread Jasper
o static variables. It doesn't help that the solution to get the expected behavior involves adding boiler-plate code all over. -Jasper -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre method keyword-arg bug.

2008-08-18 Thread Jasper
On Aug 18, 2:40 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Jasper wrote: > > Uggg! /That's/ an intuitive side-effect/wart. :-/ > > it's done that way on purpose, of course, because evaluating a full > closure for each default argument at every call would gr

Re: Bizarre method keyword-arg bug.

2008-08-18 Thread Jasper
On Aug 18, 1:49 am, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > 2008/8/18 Jasper <[EMAIL PROTECTED]>: > > > I'm stumped. I'm calling a method that has keyword args, but not > > setting them, and yet one of them starts off with data?! > >

Bizarre method keyword-arg bug.

2008-08-18 Thread Jasper
around this weirdness by having the caller set terrainArgs explicitly, but I can't shake the sensation that this "fix" just masks some deeper flaw in my code. Arg! -Jasper -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find the parent of an old-style class?

2008-04-24 Thread Jasper
On Apr 24, 10:02 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Apr 24, 7:16 am, Jasper <[EMAIL PROTECTED]> wrote: > > > I'm stuck using a library based on old style classes, and need to find > > a class's parent at runtime. > > > With new

How to find the parent of an old-style class?

2008-04-24 Thread Jasper
my search term Fu is weak. :-( Can anyone help me out here? There must be something simple. -Jasper -- http://mail.python.org/mailman/listinfo/python-list

Re: National grid to lat long conversion

2007-09-12 Thread Astley Le Jasper
Hi, I was a bit limited with time so in the end used an online service with an API which is great for the limited number of look-ups I needed. It can be found at: http://www.nearby.org.uk/ It was also very useful for site for other conversions and lookups. I manage to find a couple of other exa

Offer of free dedicated servers for the Python project

2007-04-23 Thread Jasper Bryant-Greene
ining what they would use the servers for. I encourage any project who could make good use of some free servers to get in touch, as this opportunity will not last. Thanks for your time. -- Jasper Bryant-Greene <[EMAIL PROTECTED]> Album Limited -- http://mail.python.org/mailman/listinfo/python-list