Re: Looking for the mysterious zlib.py* files in Python 2.6.4 (32-bit) for Windows

2010-03-04 Thread python
> IIRC a pyd file is really a DLL, but for a built-in its included into in this > case python26.dll. Mystery solved! Thanks Mark! Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Best practice way to detect internet connectivity under Python 2.6/Windows

2010-03-07 Thread python
Is the best pratice way to detect internet connectivity under Windows (using Python 2.6) simply to attempt to access a known internet website using urllib or urlib2 wrapped in a try/except construct? Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP mail filters tool

2010-03-07 Thread python
Ken, Check out Zed Shaw's very cool Lamson project. http://lamsonproject.org/ Malcolm - Original message - From: "Ken Seehart" To: python-list@python.org Date: Thu, 04 Mar 2010 21:33:26 -0800 Subject: IMAP mail filters tool I'm thinking of possibly making a simple

Re: (updated) Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime

2010-03-09 Thread python
We've decided to build a re-usable *general purpose* PY2EXE "runtime" that can be shared by a number of scripts vs. distributing a monolithic EXE for each of our scripts. A list of the Python 2.6.4 compatible modules/packages we decided to include (and exclude) in our "

Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime

2010-03-09 Thread python
We've decided to build a re-usable *general purpose* PY2EXE "runtime" that can be shared by a number of scripts vs. distributing a monolithic EXE for each of our scripts. A list of the Python 2.6.4 compatible modules/packages we decided to include (and exclude) in our "

Any downsides to UPX-ing my 32-bit Python 2.6.4 EXE/PYD/DLL files?

2010-03-11 Thread python
Are there any downsides to UPX-ing my 32-bit Python 2.6.4 development environment EXE/PYD/DLL files? The reason I'm asking is that I frequently use a custom PY2EXE script that UPX's copies of these files on every build. Yes, I could get fancy and try to cache UPXed files, but I think

Re: python to exe

2010-03-13 Thread python
Robin, > do you of an alternate compilter it doesn't work (py2exe) on my windows 7 box I can assure you that Py2exe does work on Windows 7 (my firm develops commercial Python applications packaged using Py2exe running on Windows 7), but it does take a bit of fiddling and some patience.

Re: "Breaking" the __main__ script

2010-03-14 Thread python
Michael, > Or you could use a real debugger, like pdb > http://docs.python.org/library/pdb.html Any reason you prefer PDB over WinPDB? http://winpdb.org/ Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: python to exe

2010-03-14 Thread python
Jonathan, > I summarised a all the alternatives to py2exe I could find, here: > http://spreadsheets.google.com/pub?key=tZ42hjaRunvkObFq0bKxVdg&output=html Really great work - thanks for sharing this with all of us!!! Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: "Breaking" the __main__ script

2010-03-14 Thread python
>> Any reason you prefer PDB over WinPDB? >> http://winpdb.org/ > Yes. I don't have Windows except one one PC :P WinPDB runs on non-Windows platforms :) Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Converting Python CGI to WSGI scripts

2010-03-16 Thread python
I have a few dozen simple Python CGI scripts. Are there any advantages or disadvantages to rewriting these CGI scripts as WSGI scripts? Apologies if my terminology is not correct ... when I say WSGI scripts I mean standalone scripts like the following simplified (as an example) template: import

Re: Web Hosting Python 3

2010-03-17 Thread python
Hidura, > Hello list, i am in a project what need hosting, who give hosting to python3? Check out www.webfaction.com. I'm extremely pleased with this vendor. Highly recommended! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting Python CGI to WSGI scripts

2010-03-17 Thread python
Sebastian/John, Thank you very much for your feedback. John: I initially missed the nuance of WSGI scripts being function calls. I suspect your tip has saved me a lot of pain :) Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Possible to open a file for shared write mode under Windows?

2010-03-17 Thread python
Is there a way to open a file for shared write mode under Windows? I have 2 processes that will write to different regions of this shared file. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible to open a file for shared write mode under Windows?

2010-03-17 Thread python
olm -- http://mail.python.org/mailman/listinfo/python-list

Re: (updated) Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime

2010-03-20 Thread python
> scripts against the same py2exe backend. Yes you can, but with our technique we only build and distribute our py2exe backend *once*. Our goal was to build a custom Python runtime that we could build and deploy once and then augment with the many scripts we distribute and update. By including

Pythonic way to trim and keep leading and trailing whitespace

2010-03-23 Thread python
ring processing). Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to trim and keep leading and trailing whitespace

2010-03-23 Thread python
Emile, > target = 'spam and eggs ' > stripped = target.strip() > replaced = target.replace(stripped,"%s" % stripped) Brilliant! That's just the type of clever solution I was looking for. Thank you! Malcolm - Original message ----- From: &q

Sniffing encoding type by looking at file BOM header

2010-03-24 Thread python
etecting one of these 5 header types and then calling codecs.open() with the appropriate encoding= parameter? Note: I'm only interested in Unicode encodings. I am not interested in any of the non-Unicode encodings supported by the codecs module. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Programmatically discovering encoding types supported by codecs module

2010-03-24 Thread python
erate this table through some form of module introspection. Ideas? Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the matter with docs.python.org?

2010-03-24 Thread python
il.python.org/mailman/listinfo/python-list

Re: Programmatically discovering encoding types supported by codecs module

2010-03-24 Thread python
Type[ key ] ) aliases = ', '.join( aliases ) print '%-20s%s' % ( key, aliases ) Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatically discovering encoding types supported by codecs module

2010-03-24 Thread python
message - From: "Gabriel Genellina" To: python-list@python.org Date: Wed, 24 Mar 2010 14:39:20 -0300 Subject: Re: Programmatically discovering encoding types supported by codecsmodule En Wed, 24 Mar 2010 13:17:16 -0300, escribió: > Is there a way to programmatically discover t

Is there a way to detect an environment's "default" encoding type (Windows)?

2010-03-24 Thread python
gt;> import locale >>> locale.getdefaultlocale()[1] 'cp1252' Any ideas? Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatically discovering encoding types supported by codecs module

2010-03-28 Thread python
Gabriel, Thank you for your analysis - very interesting. Enjoyed your fromlist choice of names. I'm still in my honeymoon phase with Python so I only know the first part :) Regards, Malcolm - Original message - From: "Gabriel Genellina" To: python-list@python.org Da

Re: Good Intermediate Tutorials

2010-04-03 Thread python
Pick an arbitrary point in time, and begin reading this mailing list's archives. I guarantee you will learn alot. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: a regexp riddle: re.search(r'(?:(\w+), |and (\w+))+', 'whatever a, bbb, and c') =? ('a', 'bbb', 'c')

2010-11-25 Thread python
eturn output test = 'cat, dog, big fish, goat and puppy and horse' print to_list( test ) Outputs: ['cat', 'dog', 'big fish', 'goat', 'puppy', 'horse'] Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-28 Thread python
I had planned on subclassing Tkinter.Toplevel() using property() to wrap access to properties like a window's title. After much head scratching and a peek at the Tkinter.py source, I realized that all Tkinter classes are old-style classes (even under Python 2.7). 1. Is there a technical r

Re: Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

2010-11-29 Thread python
pass Michele - your technique is *exactly* what I was searching for (and works well so far!). Terry - your explanation why Tkinter still uses old style classes (for compatibility with existing code) makes sense. Thank you both. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Possible to determine number of rows affected by a SQLite update or delete command?

2010-11-30 Thread python
://mail.python.org/mailman/listinfo/python-list

When to use codecs vs. io module (Python 2.7 and higher)

2010-12-01 Thread python
Python 2.7 or higher: Looking for reasons/scenarios where one should use the codecs vs. io module. Are there use cases that favor one specific module over the other module? My understanding is that the io module is much faster than the codecs module (and can be used interchangably), but the

Re: Packages at Python.org

2010-12-01 Thread python
> You may want to take a look at Dabo > http://dabodev.com/ +1 Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a window style in a Toplevel window

2010-12-09 Thread python
Eric, Besides style support, what are the advantages of ttk.Frame vs. Tkinter.Frame? Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Objects and validation

2010-12-12 Thread python
I have a routine in Python which is extracting information from a website. This information is read and inserted into objects. I currently have all the validations and checks implemented in the routines which are reading the HTML and creating the objects. It is however also possible to move all

Re: ANN: ActivePython 2.7.1.3 is now available

2010-12-13 Thread python
Sridhar, Do the Windows versions of ActivePython 2.7.1.3 have different versions of Tcl/Tk, sqlite3(.dll), and/or openssl (_ssl.pyd?) than the python.org builds of Python 2.7.1? Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: ActivePython 2.7.1.3 is now available

2010-12-13 Thread python
Sridhar, > You can find the versions used in ActivePython here, > http://docs.activestate.com/activepython/2.7/whatsincluded.html Thank you - that page answered my questions. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Map Linux locale codes to Windows locale codes?

2010-12-14 Thread python
option for us since we're using Python 2.7. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Shed Skin 0.7

2010-12-16 Thread python
Mark, Congratulations on your latest release! How well do python extension modules created with ShedSkin work with applications that expose a GUI, eg. Tkinter or wxPython apps? Can ShedSkin code be run in a thread and communicate with the main interpreter thread through a Queue or Lock? (Or

Is text processing with dicts a good use case for Python cross-compilers like Cython/Pyrex or ShedSkin?

2010-12-16 Thread python
Is text processing with dicts a good use case for Python cross-compilers like Cython/Pyrex or ShedSkin? (I've read the cross compiler claims about massive increases in pure numeric performance). I have 3 use cases I'm considering for Python-to-C++ cross-compilers for generating 32-

Re: If/then style question

2010-12-17 Thread python
> I now remember this idiom as the "break else" construct: either the loop > breaks, or the "else:" suite is executed. A perfect description. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Hosting a Python based TCP server

2010-12-23 Thread python
Rolf, > I'm writing a very small TCP server (written in Python) and now I want to > host it on some ISP so that it can be accessed anywhere from the Internet. > I've never done that before so I thought I should ask for some advice. Do you > guys know any good ISP that ca

Re: GUI Tools for Python 3.1

2010-12-24 Thread python
Randy, Tkinter is a viable GUI platform with Python 3.1's (and Python 2.7's) support for ttk (Tile). The new ttk module supports theme aware controls so that you can build beautiful GUI's that match your underlying platform's standards. Ttk also includes theme aware treeview a

How to programmatically exit from wsgi's serve_forever() loop

2010-12-27 Thread python
sole works) Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: How to programmatically exit from wsgi's serve_forever() loop

2010-12-28 Thread python
).start() Thank you for your help - really appreciated! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread python
Tk app is ugly, that's a reflection on the developer, not the toolkit*** +1 (emphasis added) Other tk/ttk benefits: - Very stable - Cross platform (w/native look and feel via Python 2.7/3.1 ttk) - Light weight - Easy to distribute - Extensible Regarding lack of print support: All GUI fr

Tkinter accessability options (was Re: Tkinter: The good, the bad, and the ugly!)

2010-12-30 Thread python
en reader products ... to make their Tkinter applications accessible to low vision/blind users. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2010-12-31 Thread python
Rick, > However, now Tkinter just looks old and dumpy. Have you taken a look at the ttk module (based on tile) that ships with Python 2.7/3.1? This adds native/theme-aware widgets to Tkinter. And it adds additional widgets such as a treeview (which can also be used as a grid), noteb

Re: CPython on the Web

2011-01-02 Thread python
e can take advantage of so calls to open() would work? Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython on the Web

2011-01-02 Thread python
Azakai/Gerry, > Errors when using Firefox 3.6.3: I'm running Firefox 3.6.1.3 and the interpreter is running fine. I'm on Windows 7 Pro 64-bit. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python comparison matrix

2011-01-03 Thread python
Alex, I think this type of documentation is incredibly useful! Is there some type of key which explains symbols like !, *, f, etc? Thanks for sharing this work with the community. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP problem

2011-01-14 Thread python
/mail.python.org/mailman/listinfo/python-list

Screen readers for Tkinter (was Re: Tkinter: The good, the bad, and the ugly!)

2011-01-19 Thread python
hat tools like dogtail and Accerciser can see them. Tka11y uses Papi, the Python Accessibility Programming Interface, which in turn uses ATK, the GNOME Accessibility Toolkit, to expose Tkinter widgets to AT-SPI, the Assistive Technologies Service Provider Interface. This allows a Tkinter application&

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread python
the presence of a sub-optimal gui kit that no one is required > to use ... +1 (very well said) Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-25 Thread python
back to Tkinter. How's that for an odd trend?! :) Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-27 Thread python
h the community to make Tkinter accessable under Windows. That sounds a lot easier than trying to fight for wxWidgets as a Tkinter replacement when so many good arguments have been made against this strategy. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Determining calculation order for group of related calculations

2011-01-28 Thread python
Wondering if there's a Python library or algorithm for determining the order in which a group of calculations should be performed when some calculations reference the result of other equations. I don't need anything as fancy as a spreadsheet engine, however I do need to detect recursive

Re: Determining calculation order for group of related calculations

2011-01-28 Thread python
Ian, > A google search for "python topological sort" returns lots of results. Perfect!! That's exactly what I was looking for but couldn't manage to put a name to. Cheers, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: locale settings and date parsing under windows

2011-02-03 Thread python
ue and I'm looking for master references for both sets of code. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: How to inspect a variable (sys.modules) for changes in the execution of a program?

2011-02-15 Thread python
Jorge, It's been a while since I felt the need to use a Python debugger, but I could swear that most (all?) Python debuggers allow you to watch a specific variable. Check out the debuggers on the following page: http://wiki.python.org/moin/PythonDebuggers Malcolm -- http://mail.pytho

Re: IMAP4_SSL, libgmail, GMail and corporate firewall/proxy

2011-02-17 Thread python
interpretation, anyway. I'm a big fan of your wxPython and GUI builder contributions!! Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-22 Thread python
Paul, > How about skipping the whole xml thing? You can dynamically import any python > module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your example requires a physical file on disk.

Re: What license/copyright text to include and where to include it when selling a commercial Python based application?

2010-04-14 Thread python
Thank you Robert! Regards, Malcolm - Original message - From: "Robert Kern" To: python-list@python.org Date: Mon, 12 Apr 2010 17:20:54 -0500 Subject: Re: What license/copyright text to include and where to include it when selling a commercial Python based application? On 201

Re: missing dll follow-up

2010-04-14 Thread python
lcolm -- http://mail.python.org/mailman/listinfo/python-list

Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-14 Thread python
I just stumbled across the following page which seems to indicate that the MS VC 2008 runtime files[1] required to distribute Python applications compiled with Py2exe and similar tools can be shipped without the license restriction many previously thought. See: Updated License Term Agreement for

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-14 Thread python
e: > I just stumbled across the following page which seems to indicate that > the MS VC 2008 runtime files[1] required to distribute Python > applications compiled with Py2exe and similar tools can be shipped > without the license restriction many previously thought. > > See: Updated

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-14 Thread python
free. Correct me if I'm wrong here? -- http://mail.python.org/mailman/listinfo/python-list

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread python
rily malicious. :) Regards, Malcolm - Original message - From: "Tim Roberts" To: python-list@python.org Date: Fri, 16 Apr 2010 00:31:35 -0700 Subject: Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1 Andrej Mitrovic wrote: > >I don't think this li

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread python
Lie, > Does it makes sense to be able to install a library in other's computer, but > not redistribute it? Hmm... I'll have to consult a lawyer. See Tim Robert's response (I can't remember which Python mailing list) The license agreement change fixes a problem that w

Re: error when printing a UTF-8 string (python 2.6.2)

2010-04-21 Thread python
Hi Peter, > Just a quick reminder: UTF-8 is not the same as unicode. Python3 works in > unicode and by default uses UTF-8 to read from or write into files. I'm not the OP, but wanted to make sure I was fully understanding your point. Are you saying all open() calls in Python tha

Re: error when printing a UTF-8 string (python 2.6.2)

2010-04-21 Thread python
Hi Peter, >> Are you saying all open() calls in Python that read text files, >> automatically convert UTF-8 content to Unicode in the same manner as the >> following might when using Python 2.6? >> >> codecs.open( fileName, mode='r', encoding='UTF8&#x

withhacks module (Re: Code redundancy)

2010-04-21 Thread python
Ryan, Your withhacks module looks very interesting. http://pypi.python.org/pypi/withhacks What are your specific concerns about its use? Are there portability concerns? Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: withhacks module (Re: Code redundancy)

2010-04-21 Thread python
Ryan, > So if you don't care about portability or about that dirty feeling you get > from messing with the Python internals, then have at it :-) Warnings aside, its very clever code. Thanks for sharing! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Detect OS shutdown or user logout across different operating systems

2010-04-26 Thread python
Is there a OS portable way to have a Python script detect when its operating system is shutting down or a user is logging out? If not, any Windows specific tips on how to detect these events? Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Detect OS shutdown or user logout across different operating systems

2010-04-27 Thread python
Hi Tim, > Doubt v. much if there's anything x-platform. I recently wrote-up > the work done my Klaas Tjebbes (sp?) which I think will do what > you want: http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html Looks good - I'll study this code. Thanks fo

Upgrading from Python 2.6.4 to 2.6.5 on Windows OS

2010-04-29 Thread python
I have a bunch of 3rd party packages loaded in my site-packages folder. Will these packages be affected if I upgrade my Python (32-bit Windows) installation from 2.6.4 to 2.6.5? Are there any gotchas I should watch out for when performing this type of upgrade? Does it ever make sense (and is it

Possible to import from an in-memory zipfile stored in a cString?

2010-04-30 Thread python
path or re-inventing the wheel. Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Exclusively lock a file to prevent other processes from reading it?

2010-05-04 Thread python
ng an 'append binary' mode, but I can use NotePad to read the file while I'm using it: fd = open( r'a-temp-file.dat', 'ab' ) My environment is Python 2.6.4 (32-bit) under Windows, but I'm looking for a cross-platform solution if that's possible.

Re: Generating nested code with context managers

2010-05-04 Thread python
Terry, > So here is my updated (3.1) proof-of-concept version. Very clever! An excellent example of how to use the 'with' statement with something besides the traditional file open example. Not the original OP, but thank you anyway. Malcolm -- http://mail.python.org/mailman/li

Re: Exclusively lock a file to prevent other processes from reading it?

2010-05-05 Thread python
Chris, Philip, Christian, John and others, Thank you all for your replies. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-05 Thread python
In a recent thread ("Movable Python or ActivePython), Sridhar Ratnakumar pointed out that the ActiveState Python releases can be downloaded as ZIP files vs. MSI files. (Great idea - thank you ActiveState!) > The .MSI installer does require installation, but there is also a .ZIP > pa

Re: ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-05 Thread python
st >> file as well). >> >> Can anyone explain why the ActiveState release uses different MS Visual >> C runtime files than the official Python Foundation's release of Python? > It doesn't. We use the same MSVC version as the python.org builds. > &g

Looking for a gettext and/or Babel tutorial for Windows

2010-05-05 Thread python
Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-06 Thread python
om: "Trent Mick" To: pyt...@bdurham.com Cc: python-list@python.org Date: Thu, 06 May 2010 09:33:05 -0700 Subject: Re: ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython) On 10-05-05 5:30 PM, pyt...@bdurham.com wrote: > Hi Tre

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, I took a look at the zip version of ActiveState's Python. There's a related thread in on this mailing list where I asked if the zip files are missing the Microsoft VC runtime files required by the Python interpreter. According to Trent from ActiveState, this is indeed th

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, > I just need test a few python scripts. I recommend you look at Movable Python or Portable Python. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Terry, > ... word[0:1] does the same thing. All Python programmers should learn to > use slicing to extract a char from a string that might be empty. Is there an equivalent way to slice the last char from a string (similar to an .endswith) that doesn't raise an exception when a stri

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Superpollo, > word[len(word)-1:] Perfect! Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Jerry, > If you use negative indexes in the slice, they refer to items from the end of > the sequence instead of the front. So slicing the last character from the > string would be: > > word[-1:] Perfect! Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread python
Martin, If we install over an existing version of Python 2.6.5, will our PTH files and site-packages be preserved? Or do we need to back out our 3rd party packages, install Python 2.6.5 and then manually restore our 3rd party packages? Thank you, Malcolm -- http://mail.python.org/mailman

Converting datetime.ctime() values to Unicode

2010-05-17 Thread python
I would like to convert datetime.ctime() values to Unicode. Using Python 2.6.4 running under Windows I can set my locale to Spanish like below: >>> import locale >>> locale.setlocale(locale.LC_ALL, 'esp' ) Then I can pass %a, %A, %b, and %B to ctime() to

Re: Converting datetime.ctime() values to Unicode

2010-05-17 Thread python
>>> codePage = locale.getpreferredencoding() ... in my original post's code (original post follows my signature). Malcolm - Original message - From: pyt...@bdurham.com To: python-list@python.org Date: Mon, 17 May 2010 13:54:27 -0400 Subject: Converting datetime.ctime() values to Unicode I would li

How to determine subprocess.Popen() failed when shell=True

2010-05-17 Thread python
Windows version of Python 2.6.4: Is there any way to determine if subprocess.Popen() fails when using shell=True? Popen() successfully fails when shell=False >>> import subprocess >>> p = subprocess.Popen( 'Nonsense.application', shell=False ) Traceback (most recent c

Re: How to determine subprocess.Popen() failed when shell=True

2010-05-19 Thread python
For the archives - solution posted at http://stackoverflow.com/questions/2861548/how-to-determine-subprocess-popen-failed-when-shelltrue Malcolm -- http://mail.python.org/mailman/listinfo/python-list

How to unescape a raw string?

2010-05-19 Thread python
ote, hex encoded and unicode encoded chars? I know I can do this explictly via a series of .replace() methods, but certainly there must be a built-in way to do this on a generic basis? Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Best practice for string substition with gettext

2010-05-19 Thread python
lcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: How to unescape a raw string?

2010-05-19 Thread python
Hi Chris, > That's not what the notion of raw strings in Python technically means, but > anyway... Agree - I was having a difficult time trying to describe my dilemma - thanks for hanging in there with my rather awkward intro :) > I'll assume you're quoting the file

string.Template.safe_substitute() with % type formatting?

2010-05-21 Thread python
Python 2.6: Is there a programming technique or 3rd party formatting module that supports string.Template.safe_substitute() type string substituion with % type formatting rules for width, decimals, justification, etc? Or do I need to use a 3rd party template engine to get the best of both worlds

gettext compatible, public domain collections of translations for strings commonly used in software applications?

2010-05-21 Thread python
x27;s Translator Toolkit, LaunchPad, Mygengo, etc. to find translations for common strings? I've tried to google this topic without success. Example: public domain po (translation|translations) Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Internationalizing an application via Babel

2010-05-24 Thread python
I'm evaluating Babel 0.9.5 [1] under Windows (Python 2.6) and have the following questions that I haven't been able to solve through reading the documentation or googling. 1. I would like to use an _ like abbreviation for ungettext. Is there a concencus on whether one should use n_

Using Babel: How to protect translator comments (and old translations) in GNU gettext PO files?

2010-05-26 Thread python
We're using the Python based Babel gettext utilities. Is there any technique we can use to make sure that translator comments and old ("obsolete") translations (marked with #~) in PO files are preserved across PO file updates? Thanks, Malcolm -- http://mail.python.org/mailman/

<    1   2   3   4   5   6   7   8   9   10   >