[Tutor] testing, please disregard

2015-08-18 Thread Tim Johnson
I have had some problems with another python.org ML. I am sending this to see if it is received. Please disregard. thanks -- Tim http://www.akwebsoft.com, http://www.tj49.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Tim Johnson
* WolfRage wolfrage8...@gmail.com [150402 11:45]: On 04/02/2015 03:08 PM, Tim Johnson wrote: SNIP You have already received valuable replies from two advanced python experts. If you are looking for a book (available digitally for kindle) I would recommend Guide To: Functional

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Tim Johnson
* WolfRage wolfrage8...@gmail.com [150402 08:25]: These are just some questions that I have regarding the topic of Functional Programming. I am working towards a more functional approach to programming but acknowledge that it is far from Functional, especially since this is mostly

Re: [Tutor] Tutor Digest, Vol 132, Issue 51

2015-02-21 Thread Tim Johnson
Hi Guys, Very simple question, I imagine. this code throws of off a counter not defined error. Can you help? *def word_counter(word, string):* *counter = 0* *for item in string:* *if item == word:* *counter = counter + 1* *print counter* Thanks, Tim -- Tim Johnson

Re: [Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Tim Johnson
* Danny Yoo d...@hashcollision.org [131223 07:48]: Would everyone mind dropping this thread, at least for a few days? As far as I can tell, there's zero Python content in it, so I'm not getting much information from it. More than that, it's affecting my morale in a fairly negative manner.

[Tutor] __class__.__name__ for literal integer causes SyntaxError

2012-04-04 Thread Tim Johnson
See the following console session: 4.6.__class__.__name__ 'float' 6.__class__.__name__ File stdin, line 1 6.__class__.__name__ ^ SyntaxError: invalid syntax x = 6 x.__class__.__name__ 'int' me.__class__.__name__ 'str' I note that the reference to '__class__.__name__' for

[Tutor] What to call a string with embedded descriptor?

2012-03-30 Thread Tim Johnson
This is kind of a theoretical question. I.E. I am looking for a keyword to do research on. Consider the following string: '3:2,6:2,4:3,5:0|age50height63nametimvalue' If the string above is split on the first occurance of '|', the result is a 'leftmost' component which can be decomposed into a

Re: [Tutor] What to call a string with embedded descriptor?

2012-03-30 Thread Tim Johnson
* Emile van Sebille em...@fenx.com [120330 12:21]: If the string above is split on the first occurance of '|', the result is a 'leftmost' component which can be decomposed into a nested list of integers which can then be used to parse the 'rightmost' string into a dictionary. What would

Re: [Tutor] GNU Emacs and Python

2011-11-01 Thread Tim Johnson
* Alexander Etter rhettna...@gmail.com [01 03:36]: Rinu, I use emacs. I use Python and C++. I'm also a university student. Last semester I learned python 2.7 using IDLE, and continued with IDLE while I searched for alternatives over the summer. I didn't find what I was looking for. Say,

Re: [Tutor] Tutor Digest, Vol 92, Issue 123

2011-10-31 Thread Tim Johnson
* Rinu Boney rinu.mat...@gmail.com [111031 07:03]: I Use Windows.I Already Know C/C++ which makes python syntax seem very easy. Maybe Setting Up Emacs With Python Will Make Me Productive. I Have Eclipse With PyDev. Why Is There Not A Pythonic Emacs? Rinu, by this time I believe that Alan has

Re: [Tutor] Setting Up Emacs

2011-10-30 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [111030 07:40]: Rinu Boney wrote: I am New To Python. I Would Like To Setup Emacs As A Python IDE. I Don't Know Anything About Emacs! If you don't know anything about emacs, and you don't know anything about Python, why do you want to make things ten

Re: [Tutor] Setting Up Emacs

2011-10-30 Thread Tim Johnson
* Alan Gauld alan.ga...@btinternet.com [111030 09:26]: On 30/10/11 13:23, Rinu Boney wrote: I am New To Python. Welcome to the group. Do you know any other languages or are you new to programming as well? I Would Like To Setup Emacs As A Python IDE. I Don't Know Anything About Emacs!

Re: [Tutor] Mac IDE

2011-09-29 Thread Tim Johnson
* Wayne Werner waynejwer...@gmail.com [110929 03:52]: My personal favorite? Two terminal windows - one with Vim, editing my Python scripts, and another with an interactive interpreter. Since you can map keys in Vim, I have F5 mapped to save and run current file. If you're in the habit of

Re: [Tutor] Mac IDE

2011-09-29 Thread Tim Johnson
* Alan Gauld alan.ga...@btinternet.com [110929 09:29]: On 29/09/11 12:50, Wayne Werner wrote: Two terminal windows - one with Vim, editing my Python scripts, and another with an interactive interpreter Of course these capabilities (and many many more) are available with Emacs. I

[Tutor] Converting from a single module to a package

2011-08-05 Thread Tim Johnson
I'm been coding in python now for close to 10 years. one of the modules that I have composed for re-use has gotten pretty big: It is implemented as import tlib as std I am thinking about 'downsizing' this module and breaking it up into smaller components, thus a package. And I would like to

Re: [Tutor] Converting from a single module to a package

2011-08-05 Thread Tim Johnson
* Christopher King g.nius...@gmail.com [110805 12:03]: To make a package, you make a folder named what you want to name the package, for example: virus_toolkit. Then you make a file in it called __init__.py. This is what you import if you import the virus_toolkit. You usually put documentation

Re: [Tutor] Converting from a single module to a package

2011-08-05 Thread Tim Johnson
* Emile van Sebille em...@fenx.com [110805 15:51]: On 8/5/2011 4:22 PM Tim Johnson said... * Christopher Kingg.nius...@gmail.com [110805 12:03]: To make a package, you make a folder named what you want to name the package, for example: virus_toolkit. Then you make a file in it called

[Tutor] dummy, underscore and unused local variables

2011-06-11 Thread Tim Johnson
Consider the following code: for i in range(mylimit): foo() running pychecker gives me a Local variable (i) not used complaint. If I use for dummy in range(mylimit): ## or for _ in range(mylimit): I get no complaint from pychecker. I would welcome comments on best

Re: [Tutor] atr in dir Vs. hasattr

2011-03-16 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [110316 05:26]: Tim Johnson wrote: What is the difference between using hasattr(object, name) and name in dir(object) ? Did you read the Fine Manual? No but I will :) http://docs.python.org/library/functions.html#dir The default dir

[Tutor] atr in dir Vs. hasattr

2011-03-15 Thread Tim Johnson
What is the difference between using hasattr(object, name) and name in dir(object) ? TIA -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change

[Tutor] atr in dir Vs. hasattr

2011-03-15 Thread Tim Johnson
This following post was originally posted to the wrong thread. I am reposting (hopefully correctly) with the first and very succint response. I thing the answer is a revealation to be noted: ## On Tue, Mar 15, 2011 at 8:00 PM, Tim Johnson t

Re: [Tutor] Namespace variables vs. instantiation keywords - best practices

2011-02-03 Thread Tim Johnson
* Tim Johnson t...@johnsons-web.com [110203 10:34]: # OR (project config file) kws = load.config(myconfig,tmpl_kws) kws.update({prj:myproject,templatepath:views}) #Grr! The following line is wrong .. kws = {prj:myproject,templatepath:views} Should be #content = LoadView(**kws) sorry -- Tim

[Tutor] Class Docs - how much is too much?

2011-01-26 Thread Tim Johnson
FYI: I'm currently using version 2.6.5 I've developed a module which necessitates a very large amount of documentation. At this point all of the documentation is in the class docstring. I'm thinking that perhaps I should pare down the docstring and deliver specific documentation topics with

Re: [Tutor] Class Docs - how much is too much?

2011-01-26 Thread Tim Johnson
* Emile van Sebille em...@fenx.com [110126 12:30]: On 1/26/2011 11:03 AM Tim Johnson said... I've developed a module which necessitates a very large amount of documentation. At this point all of the documentation is in the class docstring. I'm thinking that perhaps I should pare down

Re: [Tutor] Named-value formatting fails

2011-01-09 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [110108 19:46]: A more detailed response. Dear me... messing with globals and locals. That's always a bad sign. But let's assume this is that one time in 100 that it is actually justified... if localvals is None: self.locals =

Re: [Tutor] Named-value formatting fails

2011-01-09 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [110109 13:23]: Tim Johnson wrote: ... Are you aware that this is non-portable and subject to change without notice? No! 1)Can you explain further? . Wow! You've given me a huge amount of technical information. I can't thank you enough

[Tutor] Named-value formatting fails

2011-01-08 Thread Tim Johnson
I'm using 2.6.5 on ubuntu 10.04. I'm evaluating a very large string using a named-value formatting scheme. The process fails with the following error message: not enough arguments for format string In the first place, I wouldn't expect to even see this error message, because as the python

[Tutor] Initialize values from a text input file

2011-01-03 Thread Tim Johnson
I'm just have a little fun here, but I bet that comments will help further elighten me on the subtleties of python. consider the following console session: L = ['foo','bar'] locals()[L[0]] = L[1] foo 'bar' 'foobar' in locals() False 'foo' in locals() True locals() {'__builtins__': module

Re: [Tutor] Initialize values from a text input file

2011-01-03 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [110103 15:03]: Tim Johnson wrote: I'm just have a little fun here, but I bet that comments will help further elighten me on the subtleties of python. consider the following console session: L = ['foo','bar'] locals()[L[0]] = L[1] This will not do

Re: [Tutor] Initialize values from a text input file

2011-01-03 Thread Tim Johnson
* Alan Gauld alan.ga...@btinternet.com [110103 14:47]: Tim Johnson t...@johnsons-web.com wrote consider the following console session: L = ['foo','bar'] locals()[L[0]] = L[1] foo 'bar' locals() {'__builtins__': module '__builtin__' (built-in), 'L': ['foo', 'bar'], '__package__': None

Re: [Tutor] Initialize values from a text input file

2011-01-03 Thread Tim Johnson
* Hugo Arts hugo.yo...@gmail.com [110103 17:12]: On Tue, Jan 4, 2011 at 2:06 AM, Alan Gauld alan.ga...@btinternet.com wrote: Tim Johnson t...@johnsons-web.com wrote  Now, Alan, do you know anything about PHP? If you do, can you  comment on the PHP extract() function? I know enough

Re: [Tutor] Code evaluation inside of string fails with __get_item

2010-12-12 Thread Tim Johnson
* Steven D'Aprano st...@pearwood.info [101211 17:20]: Tim Johnson wrote: I've never had the occasion to use assert() or any other python - shooting tools, any thoughts on that? Assertions are a great tool, but never ever, under pain of great pain, use assert for testing user input

Re: [Tutor] Code evaluation inside of string fails with __get_item

2010-12-11 Thread Tim Johnson
* Peter Otten __pete...@web.de [101211 03:41]: (1) the method is spelt __getitem__ (two leading and two trailing underscores) (2) the left side is a python string with legal %(...)s-style format expressions. Given a format string s = %(s.upper())s try to feed it a real dict print

[Tutor] Code evaluation inside of string fails with __get_item

2010-12-10 Thread Tim Johnson
This is a resend. I note that the original had an incorrect `reply-to' ID attached to it. (sorry) -- I'm using Python 2.6.5. The following problem is coming from inside of a complex code base and involves an implementation that I have

[Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
I need a function that will import a module (using __import__) from only one specific location on my filesystem. Name collisions are possible. To avoid this I could *temporarily* modify sys.path for the operation so that it contains only the path that I want to work from. console example:

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
* Evert Rol evert@gmail.com [101128 07:56]: I need a function that will import a module (using __import__) from only one specific location on my filesystem. Name collisions are possible. To avoid this I could *temporarily* modify sys.path for the operation so that it contains only the

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
* Alan Gauld alan.ga...@btinternet.com [101128 15:17]: Tim Johnson t...@johnsons-web.com wrote Just curious, but could the imp module help you? imp.find_module I'll be darned. I never even heard of that module, but I just did an import and looked at the docs. I *will* give that a try. I

[Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
I've been web programming for 15 years now. 8 of it using python. Lately I have been 'studying' PHP via the CodeIgnitor Framework. Since python remains my first choice, but since I am also impressed with the concept of CodeIgnitor, I would welcome recommendations on a python MVC framework. One

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Evert Rol evert@gmail.com [101114 12:12]: Django can run be run through mod_wsgi (or mod_python if you really want). And other web servers than Apache will also work. Don't know what you mean with shared server, but if you mean multiple accounts running their web apps through one

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Tim Johnson t...@johnsons-web.com [101114 11:45]: One restriction: must *not* need an application server, I.E. works thru Apache and is adaptable to a shared server. thanks for all of who responded. I should clarify: I have been considering django as a first choice for most

[Tutor] possible to run a python script from non-cgi?

2010-10-30 Thread Tim Johnson
FYI: I am working in a linux environment with python 2.6.5 am an experienced web developer with 8 years in python, but :) I have never tried this trick before: I note that with the right .htaccess file, I can run a php file, from a non-cgi location. Example: On my machine, my wwwroot is at

Re: [Tutor] possible to run a python script from non-cgi?

2010-10-30 Thread Tim Johnson
* Evert Rol evert@gmail.com [101030 13:23]: FYI: I am working in a linux environment with python 2.6.5 am an experienced web developer with 8 years in python, but :) I have never tried this trick before: I note that with the right .htaccess file, I can run a php file, from a

Re: [Tutor] possible to run a python script from non-cgi?

2010-10-30 Thread Tim Johnson
* शंतनू shanta...@gmail.com [101030 14:08]: Hi Tim, Reply inline. Sorry, I don't understand the preceding line. On 31-Oct-2010, at 1:02 AM, Tim Johnson wrote: FYI: I am working in a linux environment with python 2.6.5 am an experienced web developer with 8 years in python, but :) I have

Re: [Tutor] possible to run a python script from non-cgi?

2010-10-30 Thread Tim Johnson
* Tim Johnson t...@johnsons-web.com [101030 15:24]: I've taken this one step further: .htaccess = RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ ./index.py/$1 [L,QSA] now I get the response from http://localhost/reg/ cheers -- Tim tim at johnsons-web.com

[Tutor] Requesting restricted URL (further authentication requested)

2010-10-19 Thread Tim Johnson
I've written the following function which successfully gets an authenticated URL: def getRestrictedURL(authName,URL,log,pswd): auth_handler = urllib2.HTTPBasicAuthHandler() auth_handler.add_password(authName, URL,log,pswd) opener = urllib2.build_opener(auth_handler)

Re: [Tutor] Requesting restricted URL (further authentication requested)

2010-10-19 Thread Tim Johnson
* Vince Spicer vi...@vinces.ca [101019 12:25]: On Tue, Oct 19, 2010 at 1:56 PM, Tim Johnson t...@johnsons-web.com wrote: Tim, Unless you are tied to the standard library I would recommend looking at httplib2 http://code.google.com/p/httplib2/ This handles your authentication

Re: [Tutor] 'module' object has no attribute (setting a class attribute)

2010-10-16 Thread Tim Johnson
* Dave Angel da...@ieee.org [101016 03:45]: 1) The code is correct. But it'd be much clearer if you followed conventions and named your class with a leading uppercase. So the module would be called tmpl, and the class would be called Tmpl. blush I didn't know there was such a

[Tutor] 'module' object has no attribute (setting a class attribute)

2010-10-15 Thread Tim Johnson
My intention is to set a class attribute so that any number of instantiations will have this value. the module is tmpl.py. the class is tmpl. if from the script I do this: import tmpl tmpl.tmpl.templatepath = kbLib.templatepath I get error message: 'module' object has no attribute

[Tutor] Successfully trapping the [505 file not found] error

2010-05-26 Thread Tim Johnson
Using Python 2.6.2 on Slackware 13.0 32-bit. I'm using Python as a command-line application to do an FTP download which processes a file of jpg filenames, downloading each. Not all of the file names can be found. I'm having a problem trapping *all* of the file not found errors. As an example my

Re: [Tutor] Successfully trapping the [505 file not found] error

2010-05-26 Thread Tim Johnson
* Luke Paireepinart rabidpoob...@gmail.com [100526 15:37]: Are you sure you aren't doing anything with the ftp object in the more code follows? You are probably creating another error of the same type while processing your exception, so the second one doesn't get caught. :) Ain't it nice

Re: [Tutor] Overriding MySQLdb.cursors.DictCursor.execute()

2009-08-08 Thread Tim Johnson
* Kent Johnson ken...@tds.net [090808 05:06]: On Fri, Aug 7, 2009 at 10:18 PM, Tim Johnsont...@johnsons-web.com wrote: If you use the two argument form of cursor.execute - passing the parameter values in a sequence, rather than substituting them yourself - then you have to worry about

[Tutor] Overriding MySQLdb.cursors.DictCursor.execute()

2009-08-07 Thread Tim Johnson
Hello: I am currently using python 2.5 and do a lot of database programming with MySQLdb. I have developed a wrapper class that uses two cursors: 1)a MySQLdb.cursors.DictCursor object 2)a MySQLdb.cursors.Cursor object #1 returning a dictionary from query results, #2 returning a tuple from query

[Tutor] regex problem with colon

2009-08-06 Thread Tim Johnson
using python 2.5. I'm having a problem with including a colon as part of a substring bounded by whitespace or beginning of line. Here's an example: p = re.compile(r'\bcc:\b',re.IGNORECASE) res = p.findall('malicious cc: here CC: there') res [] ## Darn! I'd hope that the 'cc:' and 'CC:'

Re: [Tutor] regex problem with colon

2009-08-06 Thread Tim Johnson
* Kent Johnson ken...@tds.net [090806 18:31]: On Thu, Aug 6, 2009 at 8:47 PM, Tim Johnsont...@johnsons-web.com wrote: using python 2.5. I'm having a problem with including a colon as part of a substring bounded by whitespace or beginning of line. Here's an example: p =

Re: [Tutor] is it possible to traverse two lists simulatenously using python

2009-04-30 Thread Tim Johnson
On Wednesday 29 April 2009, mobiledream...@gmail.com wrote: Python for i,j in topgirls, richgirls: print i,j Cheetah #for $i,$j in $topgirls, $richgirls$i, $j #end for This doesnt work Hello - Please do not send email to the python ML via undisclosed recipients. It's really poor form

[Tutor] Trapping warnings from MySQLdb

2009-04-13 Thread Tim Johnson
FYI: Using python 2.5 with the MySQLdb module. I need to be able to raise an exeception on a MySQL warning. I have used my own class for years that wraps the MySQLdb module, but never did build in a feature that would let me 'tell' my class instances to raise an except for a warning: Example: I'm

Re: [Tutor] Trapping warnings from MySQLdb

2009-04-13 Thread Tim Johnson
On Monday 13 April 2009, Kent Johnson wrote: From a quick look at MySQLdb-1.2.2, it seems to be using the python std lib module warnings to report warnings. http://docs.python.org/library/warnings.html From the warnings docs, it seems like warnings.simplefilter() is what you are

Re: [Tutor] Python Logo

2009-03-25 Thread Tim Johnson
On Wednesday 25 March 2009, you wrote: On Tue, Mar 24, 2009 at 6:26 PM, mobiledream...@gmail.com wrote: http://img99.imageshack.us/img99/5422/webpy.png That is the logo for web.py (a Python web framework), not for the Python language itself. http://luke.jottit.com/webpy_logo All the same,

[Tutor] Python Logo

2009-03-24 Thread Tim Johnson
Hi Folks: My company is setting up a new website, like to have a python logo on it. Can anyone recommed a logo that would be legal for us to use? Thanks Tim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Logo

2009-03-24 Thread Tim Johnson
On Tuesday 24 March 2009, Kent Johnson wrote: On Tue, Mar 24, 2009 at 4:45 PM, Tim Johnson t...@johnsons-web.com wrote: Hi Folks: My company is setting up a new website, like to have a python logo on it. Can anyone recommed a logo that would be legal for us to use? http://www.python.org

[Tutor] Installing python via ftp in virtual domain

2009-02-02 Thread Tim Johnson
I have a client who is hosting under virtual domain services that do not provide python. He has unlimited disk space available ( or so the hoster says) and they would allow installation of binaries in the virtual domain via ftp. It's a linux 'box' with a /private folder under the domain root.

Re: [Tutor] Installing python via ftp in virtual domain

2009-02-02 Thread Tim Johnson
On Monday 02 February 2009, John Fouhy wrote: 2009/2/3 Tim Johnson t...@johnsons-web.com: I have a client who is hosting under virtual domain services that do not provide python. He has unlimited disk space available ( or so the hoster says) and they would allow installation of binaries

[Tutor] Is instance of what?

2009-01-31 Thread Tim Johnson
Using python 2.5.1 If I create a class a class a: pass initialize o as: o=a and call isinstance(o,a) the return value is True. Is there a function that takes one argument and returns the class? Example: class = whatclass(o) a Since I'm hoping the answer to this question will help me

Re: [Tutor] Re : Is instance of what?

2009-01-31 Thread Tim Johnson
On Saturday 31 January 2009, Andre Engels wrote: ... o=a Actually, it is false. To make it true, you have to do o=a() rather than o=a You're correct. That was my typo. Is there a function that takes one argument and returns the class? Example: class = whatclass(o) ...

Re: [Tutor] cgi scripts

2008-11-09 Thread Tim Johnson
On Saturday 08 November 2008, Kent Johnson wrote: On Sat, Nov 8, 2008 at 3:38 AM, Jim Morcombe [EMAIL PROTECTED] wrote: I think the problem wasn't in getting the keys and values, but I might have been producing illegal HTML code before. I think I'd better brush up on my HTML skills.

Re: [Tutor] Listing imported modules

2008-09-13 Thread Tim Johnson
On Friday 12 September 2008, you wrote: On Fri, Sep 12, 2008 at 8:42 PM, Tim Johnson [EMAIL PROTECTED] wrote: If I execute the following code: imported = sys.modules.keys() print imported Do I indeed get a list of _all_ modules imported by this module? You get a list of all

[Tutor] Listing imported modules

2008-09-12 Thread Tim Johnson
If I execute the following code: imported = sys.modules.keys() print imported Do I indeed get a list of _all_ modules imported by this module? If so, then could anyone offer suggestion on how to parse the non-standard modules from this list. I.E. modules _not_ included in the standard python

Re: [Tutor] Sending email as html

2008-09-07 Thread Tim Johnson
On Saturday 06 September 2008, Alan Gauld wrote: Tim Johnson [EMAIL PROTECTED] wrote since PDF files are not very hard to edit with a simple text editor. (Never have really.) Looks like I could make up a PDF template and then put substitutions You could although they are not pure

Re: [Tutor] Sending email as html

2008-09-07 Thread Tim Johnson
On Sunday 07 September 2008, you wrote: On Sun, Sep 7, 2008 at 11:27 AM, Tim Johnson [EMAIL PROTECTED] wrote: On Saturday 06 September 2008, Alan Gauld wrote: There is an interersting looking link here: http://www.python.org/workshops/2002-02/papers/17/index.htm Yes! Did you find

Re: [Tutor] Sending email as html

2008-09-06 Thread Tim Johnson
On Saturday 06 September 2008, Glen Wheeler wrote: From: Alan Gauld [EMAIL PROTECTED] Lie Ryan [EMAIL PROTECTED] wrote programs which can edit PDFs which has somewhat destroyed their value as a read-only document format for contracts, invoices etc... If you have used tried using

[Tutor] Sending email as html

2008-09-05 Thread Tim Johnson
Greetings: I've been using smtplib for years to send plain text emails programmatically. Now I have a customer who is requesting that I (at least) investigate sending invoices by email as html. I would appreciate examples, URLs to documentation or discussions of the topic and even an argument

Re: [Tutor] Sending email as html

2008-09-05 Thread Tim Johnson
On Friday 05 September 2008, Alan Gauld wrote: ... The argument to the contrary is simple enough - its not secure and vulnerable to 'virus' type attack. For that reason many corporate firewalls trap or even prevent its delivery. (This is due to the ability to embed script tags with VBScript

Re: [Tutor] Sending email as html

2008-09-05 Thread Tim Johnson
On Friday 05 September 2008, Tim Johnson wrote: Sounds like nothing much has changed in 5 years. I did a project like this in 1993 with another programming language despite my reservations and had the client sign a Hold Harmless doc before I proceeded. Erratum: Should have 2003, not 1993 My

Re: [Tutor] Sending email as html

2008-09-05 Thread Tim Johnson
On Friday 05 September 2008, Kent Johnson wrote: On Fri, Sep 5, 2008 at 8:30 PM, Tim Johnson [EMAIL PROTECTED] wrote: On Friday 05 September 2008, Alan Gauld wrote: ... The argument to the contrary is simple enough - its not secure and vulnerable to 'virus' type attack. For that reason

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-13 Thread Tim Johnson
On Tuesday 12 August 2008, Jaggo wrote: Hello. I haven't much experience with programming. I'd like to point this question to programmers who write in editors other than the default PyWin32: Why do you use your editor rather than using Pywin? What feature has editor X got that PyWin

Re: [Tutor] Problems with List Server?

2007-12-06 Thread Tim Johnson
On Thursday 06 December 2007, you wrote: It arrived. Since you appear to be the only one reporting the problem, perhaps it's something on your end? It was the domain hoster. It has now been corrected. thanks tim ___ Tutor maillist -

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tiger12506 wrote: ## s = '/home/test/' s1 = s.lstrip('/ehmo') s1 'test/' ## I've been having some problems posting to this list, so this is also a kind of test: I just wrote a global lstring def

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tiger12506 wrote: ## s = '/home/test/' s1 = s.lstrip('/ehmo') s1 'test/' ## I've been having some problems posting to this list, so this is also a kind of test: I just wrote a global lstring def

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Friday 30 November 2007, Eric Brunson wrote: Tim Johnson wrote: Hello: I'm seeing some strange behavior with lstrip operating on string representations of *nix-style file paths Example: s = '/home/test/' s1 = s.lstrip('/home') s1 'test/' ## '/test/' was expected

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
Trying this again. This list has not be receiving all of my emails.. == On Friday 30 November 2007, Eric Brunson wrote: Tim Johnson wrote: Hello: I'm seeing some strange behavior with lstrip operating on string representations of *nix-style file paths

Re: [Tutor] Problems with List Server?

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tim Johnson wrote: I appear to be having a weird problem with the List Server. At first, email sent to this address did not appear at all. After contacting the ML maintainers only one email from me to this address go through. When I replied to the thread which

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
-- On Friday 30 November 2007, Eric Brunson wrote: Tim Johnson wrote: Hello: I'm seeing some strange behavior with lstrip operating on string representations of *nix-style file paths Example: s = '/home/test/' s1 = s.lstrip('/home') s1 'test/' ## '/test/' was expected

[Tutor] Problems with List Server?

2007-12-03 Thread Tim Johnson
I appear to be having a weird problem with the List Server. At first, email sent to this address did not appear at all. After contacting the ML maintainers only one email from me to this address go through. When I replied to the thread which the email started, it was not delivered. This is a

[Tutor] lstrip removes '/' unexpectedly

2007-11-30 Thread Tim Johnson
Hello: I'm seeing some strange behavior with lstrip operating on string representations of *nix-style file paths Example: s = '/home/test/' s1 = s.lstrip('/home') s1 'test/' ## '/test/' was expected! '/' was unexpectedly removed Any comments or corrective measures are welcome thanks Tim

Re: [Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-24 Thread Tim Johnson
On Thursday 23 August 2007, Kent Johnson wrote: I would welcome some opinions on this matter. Make a file called mylibraries.pth with contents /path/to/mylibraries Aha! User-defined .pth file is recognized by python Put the file in your site-packages folder (I don't know wherethat is for

Re: [Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-24 Thread Tim Johnson
On Friday 24 August 2007, Tim Johnson wrote: On Thursday 23 August 2007, Kent Johnson wrote: I would welcome some opinions on this matter. Make a file called mylibraries.pth with contents /path/to/mylibraries Aha! User-defined .pth file is recognized by python Put the file in your

[Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-23 Thread Tim Johnson
I have a seperate library directory both on my work station on the the remote servers that I write applications for.. I commonly use sys.path.append('/path/to/mylibraries') in my python code. That code has to be placed in any standalone script that I write. I can also place that path in a

Re: [Tutor] Invoking Python from Vim

2007-06-07 Thread Tim Johnson
On Thursday 07 June 2007, Matt Smith wrote: Hi, Bit of a Vim specific question this one but I hope someone might have an answer. I currently have the following line in my .gvimrc file (I'm using Ubuntu Linux): map F2 :!gnome-terminal -e=python\ -i\ %CR This opens a window and runs the

Re: [Tutor] cookie expiration date format

2007-03-19 Thread Tim Johnson
http://mail.python.org/mailman/listinfo/tutor -- Tim Johnson [EMAIL PROTECTED] Palmer, Alaska, USA ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] cookie expiration date format

2007-03-17 Thread Tim Johnson
On Saturday 17 March 2007 02:31, Luke Paireepinart wrote: Tim Johnson wrote: I'm not clear what datatype is needed here. Can anyone clarify this for me? Sounds like it's an integer or float, such as returned by time.time() I shouldn't have used the word 'datatype', 'cuz I'm sure

Re: [Tutor] cookie expiration date format

2007-03-17 Thread Tim Johnson
On Saturday 17 March 2007 08:13, Tim Johnson wrote: On Saturday 17 March 2007 02:31, Luke Paireepinart wrote: Tim Johnson wrote: I'm not clear what datatype is needed here. Can anyone clarify this for me? Sounds like it's an integer or float, such as returned by time.time() I

[Tutor] cookie expiration date format

2007-03-16 Thread Tim Johnson
: --- expires Integer expiry date in seconds since epoch, --- I'm not clear what datatype is needed here. Can anyone clarify this for me? Thanks Tim -- Tim Johnson [EMAIL PROTECTED] Palmer, Alaska, USA

Re: [Tutor] Python referrence

2007-02-09 Thread Tim Johnson
as pydoc -p 1234 (where 1234 is the non-conflicting port number of your choice) And then point my browser to http://localhost:1234 (subsititute your port number) This will pick up your own docstrings, libraries and classes as well as the installed python system. -- Tim Johnson [EMAIL PROTECTED

[Tutor] Problem with Reference Manual (duplicate ISBN)

2007-02-07 Thread Tim Johnson
? regards -- Tim Johnson [EMAIL PROTECTED] Palmer, Alaska, USA ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem with Reference Manual (duplicate ISBN)

2007-02-07 Thread Tim Johnson
On Thursday 08 February 2007 01:50 am, Bob Gailer wrote: libraries, universities, wholesalers and distributors. IMHO the revision should be considered a new edition therefore have a new ISBN. Right on! Hopefully this gets to someone with some contact with the publisher. thanks tj -- Tim

[Tutor] Using __import__ and byte-compiling

2007-02-05 Thread Tim Johnson
) then compile module.py else ## module.pyc does not exist compile module.py ## Or is there a python asset that handles this? cheers tim -- Tim Johnson [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Using __import__ and byte-compiling

2007-02-05 Thread Tim Johnson
I should add one thing: If the source module is in the same directory, it *is* byte-compiled. thanks tim On Tuesday 06 February 2007 03:46 pm, Tim Johnson wrote: I am currently using the __import__ function to do conditional importing of modules, whose names are determined at runtime

[Tutor] site-packages and permissions to byte-compile

2007-01-29 Thread Tim Johnson
Hello: I just installed python 2.5 on Linux/Slackware 10.0 I have placed three files in the root of site-packages on my machine that is /usr/local/lib/python2.5/site-packages python appears to be importing this files with no complaint, but they are not being byte-compiled. Note: I see that

Re: [Tutor] site-packages and permissions to byte-compile

2007-01-29 Thread Tim Johnson
On Monday 29 January 2007 03:17 pm, Dave Kuhlman wrote: On Mon, Jan 29, 2007 at 01:35:22PM -0900, Tim Johnson wrote: Hello: I just installed python 2.5 on Linux/Slackware 10.0 I have placed three files in the root of site-packages on my machine that is /usr/local/lib/python2.5/site

Re: [Tutor] Best IDE for Python

2007-01-25 Thread Tim Johnson
On Thursday 25 January 2007 06:17 am, Mike Hansen wrote: Someone mentioned that VIM 7 does this. You might need to pick up the latest python.vim file from vim.org. Vim offers some intriguing possibilities for python: If you compile Vim from source, the python interpreter can be compiled into

  1   2   >