[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 ap

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

2010-05-26 Thread Tim Johnson
* Luke Paireepinart [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 to have a second

[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 'templatepath

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

2010-10-16 Thread Tim Johnson
* Dave Angel [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. I didn't know there was such a convention. Serves me righ

[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 [101019 12:25]: > On Tue, Oct 19, 2010 at 1:56 PM, Tim Johnson 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 a

[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 /home/h

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

2010-10-30 Thread Tim Johnson
* Evert Rol [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 non-cgi locat

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

2010-10-30 Thread Tim Johnson
* शंतनू [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 pytho

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

2010-10-30 Thread Tim Johnson
* Tim Johnson [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 or akwebsoft.

[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 r

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Alan Gauld [101114 13:12]: > Not quite sure how you defione your terms there. > But all of the above can be used with Apache. Hi Alan. See my reply to Evert where I refer to situations where I would have neither SSH nor root access. thanks -- Tim tim at johnsons-web.com or akwebsoft.com

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Evert Rol [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 Apache > server, t

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Tim Johnson [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 of the deployment en

[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 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? > >

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, 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, I was glad to see

[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 > > yo

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

[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:' subs

Re: [Tutor] regex problem with colon

2009-08-06 Thread Tim Johnson
* Kent Johnson [090806 18:31]: > On Thu, Aug 6, 2009 at 8:47 PM, Tim Johnson 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: > &

[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 res

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

2009-08-08 Thread Tim Johnson
* Kent Johnson [090808 05:06]: > On Fri, Aug 7, 2009 at 10:18 PM, Tim Johnson 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 injection attacks. Th

Re: [Tutor] O.T.

2004-12-30 Thread Tim Johnson
ugh I have no intentions of giving up python and vim. I run both linux and windows concurrently on my work station so I guess I "swing both ways" when it comes to OS'es. Hobbies are gardening, landscaping, brewing beer, hiking and generally puttering 'round my property. H

[Tutor] Recommended SOAP libraries

2005-01-07 Thread Tim Johnson
What SOAP libraries might be recommended for python? -- thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Problems with test cgi script on windows XP/Apache

2005-02-13 Thread Tim Johnson
I'm attempting to run a test cgi script on windows xp with apache as the http server. I keep getting a not found error from IE, and the error log shows the following error message. No such file or directory: script not found or unable to stat: c:/program files/apache group/apache/cgi-bin/test.py A

Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-13 Thread Tim Johnson
At 12:22 PM 2/13/2005, you wrote: I'm attempting to run a test cgi script on windows xp with apache as the http server. I keep getting a not found error from IE, and the error log shows the following error message. No such file or directory: script not found or unable to stat: c:/program files/apa

Fwd: Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Tim Johnson
Date: Mon, 14 Feb 2005 10:25:28 -0900 From: Tim Johnson <[EMAIL PROTECTED]> Subject: Re: [Tutor] Problems with test cgi script on windows XP/Apache To: Tim Johnson <[EMAIL PROTECTED]> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 At 12:22 PM 2/13/2005, you wrote: I'm attempt

[Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Hello Pythonmeisters: Is it possible to dynamically compose a module name for import? Pointers to documentation or other discussions would be sufficient at this time. thanks -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutio

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
ing the auto modules (which isn't necessarily written in python). but like I said, I'm just thinking about this now, and am open to alternatives. Thanks Alan tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Appreciate the replies. Also found this link: http://diveintopython.org/functional_programming/dynamic_import.html See Example 16.15. :-) Very pythonesque! Methinks. thanks tj -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutio

[Tutor] Class and Scope Question

2005-05-05 Thread Tim Johnson
test.py Traceback (most recent call last): File "test.py", line 11, in ? test() File "test.py", line 9, in test s = test % Eval() File "test.py", line 4, in __getitem__ return eval(key) File "", line 0, in ? NameError: name 'i' is

Re: [Tutor] Class and Scope Question

2005-05-06 Thread Tim Johnson
* Karl Pflästerer <[EMAIL PROTECTED]> [050506 10:40]: >Karl > -- > Please do *not* send copies of replies to me. > I read the list My Thanks to both Karl and Rich for help me to understand this problem. I also appreciate the documentation reference. cheers tim -- T

Re: [Tutor] (no subject). Ord and Chr query

2005-05-26 Thread Tim Johnson
mester and the book that we used was "Learn to Program Using Python", by Alan Gauld. I'm going to recommend it, even tho' many features have been added to python since (2001), it does a good job on the basics. -- tj -- Tim Johnson <[EMAIL PROTECTED]>

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 :!gnome-terminal -e=python\ -i\ % > > This opens a window and runs the

[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 system

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

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 fi

[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 T

[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 very

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

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

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/te

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 represen

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

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/te

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 - Tutor@pytho

Re: [Tutor] IDEs

2005-09-14 Thread Tim Johnson
ave bitmaps for your backgroud, but of course that can be distracting, if you are (for instance) coding over the top of Mariah Carey. For Windows, the finest Shareware edit IMHO is Boxer. But if I programmed only in Python and only on windows, I'd use PythonWin. MTCW tim --

Re: [Tutor] IDEs

2005-09-14 Thread Tim Johnson
laying with JSP at the moment and am very impressed > with the open source NetBeans IDE. It would be nice if someone > modified it to work with Python! :-) > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailma

Re: [Tutor] Python Editors (particualrly Vim)

2005-09-22 Thread Tim Johnson
anguage environment mainly on Linux. *but* if I were programming only in python and doing so on Windows, I'd probably use pythonwin. I've used it in the past and was very impressed, a real python IDE. MTCW tim -- Tim Joh

[Tutor] Circular approach to a dictionary structure

2005-10-28 Thread Tim Johnson
the next item, and that the value for the last key is the *first* key. Is there a different way to do this? Works fine for me this way, but I'm just curious about an alternative, :-) expecially if it is better. thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-

Re: [Tutor] Circular approach to a dictionary structure

2005-10-28 Thread Tim Johnson
ating the last one, Yes. You are correct! tj > then I'd think of a list, > and using some modulus when iterating. > Can you explain more of what you are trying to do? > > > Hugo > > Tim Johnson wrote: > > Hello: > > > > # I have the f

Re: [Tutor] Circular approach to a dictionary structure

2005-10-28 Thread Tim Johnson
er update or new record) and presenting another URL with "open" as path part 2. Example: http://www.mydomain.com/cgi-bin/script.py/new/open => http://www.mydomain.com/cgi-bin/script.py/new/review => http://www.mydomain.com/cgi-bin/script.py/n

Re: [Tutor] Circular approach to a dictionary structure

2005-10-28 Thread Tim Johnson
* Andrei <[EMAIL PROTECTED]> [051028 15:57]: Andrei, I really like your approach. Will which up an object interface for it. Will have other applications, I'm sure. thanks tim > Tim Johnson wrote: > > Hello: > > > > # I have the following dictionary: > >

[Tutor] AJAX resources for Python

2005-10-28 Thread Tim Johnson
Hi All: Are AJAX resources available for python? http://en.wikipedia.org/wiki/AJAX thanks Tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/m

[Tutor] Tainted characters and CGI

2005-10-31 Thread Tim Johnson
the forseeable future, we will be running our CGI services on *nix systems. Thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Newbie Question - Python vs Perl

2005-10-31 Thread Tim Johnson
ing. > > Thanks in advance. > > Scott > ___________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tainted characters and CGI

2005-10-31 Thread Tim Johnson
* Ron Weidner <[EMAIL PROTECTED]> [051031 12:38]: > > > --- Tim Johnson <[EMAIL PROTECTED]> wrote: > > > Hello: > > I need to tighten my handling of CGI transmissions. > > I particular, I need to develop a strategy of safely > > dealing with &quo

Re: [Tutor] Tainted characters and CGI

2005-10-31 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051031 14:16]: > On 01/11/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > > Hello: > > I need to tighten my handling of CGI transmissions. > > I particular, I need to develop a strategy of safely dealing > > with "ta

[Tutor] iteritems() vs items()

2005-11-12 Thread Tim Johnson
members must be done in the same manner in which key/value pairs were added. I'm currently using Python 2.3.4 on both workstation and internet servers and must keep backward compatible to that venue. Thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solut

Re: [Tutor] iteritems() vs items()

2005-11-13 Thread Tim Johnson
* Kent Johnson <[EMAIL PROTECTED]> [051112 20:33]: > Tim Johnson wrote: > >I need to get up to speed on iterators. I learned python 1.5~ via > >Alan G's book ... > >For an example, I've written a subclass of dict where keys are kept in > >a ordered fashi

Re: [Tutor] iteritems() vs items()

2005-11-13 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051113 12:16]: > On 14/11/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > > Now if I assign a value to the iteritems method, as in > > it = s.iteritems() > > I get an object of > > and dir(it) shows that (it) has one

Re: [Tutor] iteritems() vs items()

2005-11-13 Thread Tim Johnson
* Kent Johnson <[EMAIL PROTECTED]> [051113 12:04]: > Tim Johnson wrote: > > Question: Can one subclass an iterator object? > > thanks for making this a little clearer. > > Most *classes* can be subclassed. What do you have in mind? Oh, I'm just playin

Re: [Tutor] iteritems() vs items()

2005-11-13 Thread Tim Johnson
cs.python.org/ref/yield.html It appears that a generator, is an object, but not derived from a class, but from a generator function, using yield. > Liam Clarke-Hutchinson > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tim >

Re: [Tutor] iteritems() vs items()

2005-11-13 Thread Tim Johnson
Well put. Got it. Thanks Kent tj * Kent Johnson <[EMAIL PROTECTED]> [051113 14:44]: > Tim Johnson wrote: > > * Liam Clarke-Hutchinson <[EMAIL PROTECTED]> [051113 12:41]: > > > >>Someone correct me if I'm wrong, but I believe there is no specific iterator

Re: [Tutor] Any TurboGears users out there?

2005-11-14 Thread Tim Johnson
s. I hope to do some testing in the next couple of days, time permitting. tj > Alan G > Author of the learn to program web tutor > http://www.freenetpages.co.uk/hp/alan.gauld > > > ___ > Tutor maillist - Tutor@python.o

[Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
;hello') >>> s = mylib.sub() Traceback (most recent call last): File "", line 1, in ? File "mylib.py", line 1612, in __init__ val() NameError: global name 'val' is not defined ## what do I need to do to make the 'test method visible ## class &

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
| Do I understand that classes inherit methods, but not | | variable attributes? | ------ Thanks: I've use inherited classes before but haven't tried

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051130 19:21]: <..snip...> > On 01/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > superclass __init__ methods, or when you want to call them. So, it is > up to you to make that call. > > You can do that like this: > >

Re: [Tutor] Escaping double quotes

2005-12-07 Thread Tim Johnson
* Tim Johnson <[EMAIL PROTECTED]> [051207 15:56]: > I must be having a Senior Moment here, but the following > baffles me: > >>> label = 'this is "quoted"' > >>> label.replace('"','\"') > 'this is &qu

[Tutor] Escaping double quotes

2005-12-07 Thread Tim Johnson
I must be having a Senior Moment here, but the following baffles me: >>> label = 'this is "quoted"' >>> label.replace('"','\"') 'this is "quoted"' ## This works >>> label.replace('"&#x

Re: [Tutor] Escaping double quotes

2005-12-08 Thread Tim Johnson
all > otherwise your solution can also be done with raw strings: > > >>> label.replace('"','\\"') > 'this is \\"quoted\\"' > >>> label.replace('"',r'\"') > 'this is \\"quoted\\"' Good tip tho' I keep forgetting about raw strings. > ok, i'll stop thinking about it now. ;-) Thanks! tj > cheers, > -wesley -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] bitwise manipulation

2005-12-08 Thread Tim Johnson
made calls like set_bit(vInteger,bit_position) and unset_bit(vInteger,bit_position). Thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] bitwise manipulation

2005-12-08 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051208 16:55]: > On 09/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > > Are there any python resources available that can make setting/unsetting > > bits directly? I used to do that in "C" with preprocessor macros that

[Tutor] Introspecting class and method names

2005-12-14 Thread Tim Johnson
scope of the method? If so, how? and pointers to docs would be welcome also. thanks -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Books

2005-12-21 Thread Tim Johnson
gp/product/0735710902/qid=1135222880/sr=2-1/ref=pd_bbs_b_2_1/103-3865586-6854221?s=books&v=glance&n=283155 Foundations of Python Network Programming: http://www.amazon.com/gp/product/1590593715/qid=1135222941/sr=2-1/ref=pd_bbs_b_2_1/103-3865586-6854221?s=books&v=glance&n=

Re: [Tutor] IDE - Editors - Python

2006-02-06 Thread Tim Johnson
interview stops right there and we keep looking. MTCW tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDE - Editors - Python

2006-02-06 Thread Tim Johnson
in* > > > > ___________ > > Tutor maillist - Tutor@python.org > > http://mail.python.org/mailman/listinfo/tutor > > > > -- > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDE - Editors - Python

2006-02-06 Thread Tim Johnson
able in diving through old C > code that I have not written. Definitely! > Admittedly, I don't use debuggers in > Python, but I do see the value in forcing oneself to jump levels of > abstraction. But maybe this approach is obsolete now and I'm just an old > fuddy-du

[Tutor] Trying a csv error

2006-02-10 Thread Tim Johnson
pt cvs._csv.Error: ## or something like this print "bad csv record, skipping " continue except StopIteration: break The problem is that python does not recognize the error objects and gives me: "'module' object has no attribute '_cs

Re: [Tutor] Trying a csv error

2006-02-10 Thread Tim Johnson
v > >>> csv.Error > > ## > > So internally, csv.Error is the thing you've been seeing, but from the > API, you should try to ignore that particular internal implementation > detail, and just use csv.Error instead. > > > Best of wishes! > > __

[Tutor] using popen(n) to intercept stdout

2006-02-15 Thread Tim Johnson
call another process on the same machine and capture the output of that process, assuming that the child process is writing to stdout. thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using popen(n) to intercept stdout

2006-02-15 Thread Tim Johnson
man' (it uses less for paging) One way to get the > whole manpage as text without paging is to do: > > man -P /bin/cat > > So you won't have to do strange stuff in stdin to get it to give you the > whole text. > > Hugo -- Tim Johnson <[EMAIL PROTECTED]>

Re: [Tutor] defined()

2006-04-03 Thread Tim Johnson
. Kind of like hasattr() > I'm interested in what use you would make of such a thing? My business partner is a perl programmer. He uses defined() a lot, I think, I've seen it in his code I use value? a lot in rebol. I like python's in operator. Very handy ti

Re: [Tutor] defined()

2006-04-03 Thread Tim Johnson
* Bob Gailer <[EMAIL PROTECTED]> [060403 17:12]: > > def defined(name): > return name in globals() > Hah! Good tip. I'll call it value() I think "language wars" are a waste of time, but I like the way that using different languages inform the programm

Re: [Tutor] defined()

2006-04-03 Thread Tim Johnson
ur business partner doesn't have the line 'use strict' in their > code, then give them a good kick and tell them to use it! It's criminal > for a professonal Perl programmer not to "use strict", I'm sure he has his "stay out of jail card"

Re: [Tutor] Not Really Questions

2006-06-04 Thread Tim Johnson
is more productive, line for line, from my experience. But because of python's OOP engineering it, it scales better, enabling more maintainable code in larger projects. Consequently, I use python for big projects, rebol for small. """ The right tool for the righ

Re: [Tutor] IDE for Python

2006-07-25 Thread Tim Johnson
in my own way. The trade-off is time tj > Mike > http://users.adelphia.net/~mahansen/programming/editorides.html > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor

[Tutor] Cookies with CGI

2006-07-26 Thread Tim Johnson
Hello: I'd like to set (write) and get (read) cookies on a client computer via CGI. Does python have the libraries to do this. If so, pointers to the libraries and documentation is welcomed. thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-so

Re: [Tutor] Cookies with CGI

2006-07-26 Thread Tim Johnson
* Kent Johnson <[EMAIL PROTECTED]> [060726 17:49]: > Tim Johnson wrote: > > Hello: > > > > I'd like to set (write) and get (read) cookies on a client > > computer via CGI. > > > > Does python have the libraries to do this. If so, pointers

[Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
understand" the file type. Does anyone have any experience with this issue? Or could anyone recommend a more appropriate place to post this question? Thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
* Luke Paireepinart <[EMAIL PROTECTED]> [060914 17:36]: > Tim Johnson wrote: > >Hi: > > > >This is *not* really a python problem, but :-) since this > >is such an helpful list and others may have the same issue... > > > >I have a python script whi

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
ted this to a forum: One expert response reads like this: "I think that's just the way Mozilla acts." Actually, I like the way Firefox does it. Looks like we just live with the differences. thanks again tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] tuples versus lists

2006-09-14 Thread Tim Johnson
eturn multiple values from a function using tuples. > > Why would you use one in preference to the other? I use tuples as above and where I don't want data changed... tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com __

Re: [Tutor] Problems serving up PDF

2006-09-16 Thread Tim Johnson
es > to succeed. Imitation is the sincerest form of flattery. thanks. that is a very helpful tool. and I'm seeing that headers are consistant with what I've sent. Good tip! tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com __

[Tutor] Paramstyle/sql injection [was Python CGI Script]

2006-09-20 Thread Tim Johnson
tting a little 'script nanny' to check my python files for usage of Paramstyle. thanks tim > which talks about this a bit more. > ___________ > Tutor maillist - Tutor@python.org > htt

[Tutor] is gotchas?

2006-11-06 Thread Tim Johnson
I've been using python is 1.5* but haven't used `is` that much. 1)where do `is` and `==` yield the same results? 2)where do they not yield the same results? 3)is there a special method for `is'. 4)Pointers to docs are welcome. thanks tim -- Tim Johnson <[EMAIL PROT

Re: [Tutor] (OT) Flame wars

2006-11-06 Thread Tim Johnson
lity. (Tim: rebol = 50% python = 50%) -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is gotchas?

2006-11-06 Thread Tim Johnson
nd evaluate to False when the assigned value is more that 1 byte? I think I ran into this before and that's why I never used `is'. Good thread. Beats flame wars. thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

  1   2   >