Any one using the GNU gettext utilities to internationalize their
python applications?
I'm looking for tips and/or tools on how to efficiently work with
gettext PO files when making small edits to large msgid values.
Example: We have lots of multi-sentence/multi-paragraph messages
that are s
lity. Do you know if
the codecs module is still required in Python 3.x?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Why not a GUI based on HTML, CSS and Javascript?
To paraphrase another poster and to borrow from SQLite:
Pick any *THREE*:
- Simple
- Beautiful
- Cross-platform
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
> Yes, just wait until somebody builds a web-browser that runs in your
> web-browser!
?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Ant,
Have you checked out the Dabo framework? Dabo provides a set of tools
and underlying framework that makes VB style GUI development possible
using Python.
Dabo is designed to be GUI framework independent however it currently
only supports wxPython.
Dabo has a very friendly and helpful
tically delete messages > a
specific age on a folder by folder basis. Fastmail also supports a
variety of ways to file messages into folders - from simple to
sophisticated (Sieve based).
Highly recommended!
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
7;file_locked.tmp'
unittest_file_locked = open( UNITTEST_FILE_LOCKED, 'w' )
UNITTEST_UNICODE_PATH= ur'\xunicode_test_\xb0_\xb1_'
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
I'm looking for some suggestions on how to detect exceptions
raised during common types of file access (os, shutil, codecs,
etc.) on a cross-platform basis. I'm looking for feedback
relative to Python 2.6 and 2.7 but would also appreciate hearing
of any Python 3.x specific behaviors.
Un
Brian,
> Since many seem to be married to a particular GUI framework, I was just
> suggesting that a thin wrapper around the framework might be fruitful,
The guys on the Dabo project have created such a wrapper.
www.dabodev.org.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
I'm looking for one or more very complicated gettext PO files for
testing. I know this sounds a bit OT, but these files will be
used to test some Python-based PO utilities we've had to write to
manage our PO files. We have our own in-house produced test
files, but its always dangero
Anton,
Very nice.
As an aside: I don't think you need to explicitly set your image size,
eg. I found your examples worked well with the following CSS properties
removed from the img specification:
width:100px;
height: 100px;
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Travis,
Great job - thanks for sharing your research!
Note: you may want to add cherrypy.org to your framework page. This is
an excellent, light weight, template agnostic framework. Turbogears runs
on top of CherryPy.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
command require
the entire module to be processed.
If this comes down purely to preference, are there PEP 8-like
standards regarding which approach to use when?
Thanks,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
s() to our
formatting functions.
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
they can figure out how to expand
variable references in string expressions. Eventually this library will
be replaced with a more conventional template package; however, for the
moment, I'm just keeping what we currently have working smoothly :)
Cheers,
Malcolm
--
http://mail.python.org/mai
Use a set instead of a dictionary for done keys?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6.4 (Win32): Anyone have any explanation for the
following
encodings.idna.ToASCII( unicodeStr ) != unicodeStr.encode( 'idna'
)
Given that other processes may have to use the output of these
methods, what is the recommended technique?
Demonstration:
>>> import enco
Python 2.6.5 (Win32): Is there a work around for ftplib's (and
ftputil's) apparent inability to support Unicode file names?
I'm thinking that I might be able to use the encodings.idna as a
work around for this?
In other words, regardless of whether I'm getting or putting a
f
Curious if any of you are using GPG or PGP encryption and/or signatures
in your Python apps?
In particular are you:
1. clearsigning specific emails?
2. validating clearsigned emails from others?
3. encrypting/decrypting files?
4. generating signatures for files that you are exchanging/posting
locale specific formatting was still incomplete.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
split across modules) and then combined through
inheritance or aggragration.
And yes, I recognize I haven't answered your original question :)
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
ilman/listinfo/python-list
(): join list of lines with an empty char
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
ts into a list of lines
(splits lines at \n; does not include \n in split values)
- ''.join(): join list of lines with an empty char
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
.W_OK, etc.
--
http://mail.python.org/mailman/listinfo/python-list
rg/mailman/listinfo/python-list
I'm working with some Python 2.6 code that is using the doctest
module for unittests.
I tried adding tests whose code and results required newlines
(\n). Apparently newlines in string constants breaks the doctest
code.
Any workarounds other than using another char for newlines and
wrappin
sults. No
matter what combination of backslashes or raw strings I use, I am unable
to find a way to code the following.
>>> encode( '", \, \t, \n' )
'\", \\, \\t, \\n'
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6 under Windows: are the two non-zero values returned by
this function of any practical use? The documentation [1] is
vague and points to the Windows Platform API which I'm not sure
maps 1:1 to the help description.
In looking at the values returned on my system (Windows 7,
64-bi
Tim,
> 2.x?! You were lucky. We lived for three months with Python 1.x in a septic
> tank. We used to have to get up at six in the morning, write our 1.x code
> using ed, eat a crust of stale bread, go to work down in machine language,
> fourteen hours a day,
week-in week-out, fo
"wow,
this is so much easier than what I've been doing"!
>> 2.x?! You were lucky. We lived for three months with Python 1.x in a septic
>> tank. We used to have to get up at six in the morning, write our 1.x code
>> using ed, eat a crust of stale bread, go to w
http://mail.python.org/mailman/listinfo/python-list
the user's default printer)
http://timgolden.me.uk/python/win32_how_do_i/print.html#shellexecute
Example:
win32api.ShellExecute( 0, 'print', fileName, None, '.', 0 )
Under Windows: Is there a way to print a file using the file's file
extension association using eithe
And don't forget the oft requested strip_tease().
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
ally I agree 1e-11 is a better notation than 0.000, but I
currently need the long one. Is there a way to overwrite the switch to
the scientific notation? Apparently there is a switch in notation
'between' 1e-6 and 1e-7.
Thijs
--
http://mail.python.org/mailman/listinfo/python-list
s a
RESTful API. Any recommendations here?
3. Build this capability myself using Python and Python's DBI layer to
store files in a local SQLite database at first (but with the ability to
upsize to a real client server database in the future). Seems like a fun
project to work on, but also smells like I
Python 2.7 for Windows: Does Python 2.7 for Windows use the same
version of the MS VC runtime as Python 2.6?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
What is the best practice way to open files in Python 2.6+
It looks like there are at least 3 different ways to open files:
- built-in open()
- io.open()
- codecs.open()
It seems like io.open() combines the best of the built-in open()
and the codecs open(). Am I missing any obvious drawbacks to
Windows: How can I detect whether a Python app/script is running
in console/GUI mode? By app I mean a script compiled to an exe
via py2exe or similar.
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Brian,
> As an FYI, the builtin open() uses io.open() on at least 3.1
(maybe also 3.0, don't know). I don't know your use cases or >
what you get or don't get from any of those options, but the
future is io.open.
>
> >>> io.open is open
> True
Under P
"Windows") modes.
Here are 2 links that explain this in more detail.
<http://stackoverflow.com/questions/493536/can-one-executable-be-both-a-console-and-gui-app>
<http://objectmix.com/delphi/403126-sending-output-stdout-non-console-app.html>
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
discrete
items (handling quoted strings, backslashes, etc)
I have a bunch of command lines (as strings) and I would like to
parse them into argv-like lists for analysis and documentation.
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6: Is there a built-in way to check if a Unicode string
has non-ASCII chars without having to check each char in the
string?
Here's my use case: I have a section of code that makes frequent
calls to hasattr. The attribute name being tested is derived from
incoming data which at time
Timeless classics - highly recommended:
Software Tools by Plaugher
Mythical Man Month by Brooks
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
ative Python
that would benefit from being recoded as native C modules.
Welcome!
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
core
processing workstation, we can typically process 2 Gb of data in ~5
minutes. I would think a worst case processing time would be less than
an hour for 14 Gb of data.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
On 6 jul 2009, at 18:14, David House wrote:
2009/7/6 Python :
as far as I know try has no 'else'
It does:
http://docs.python.org/reference/compound_stmts.html#the-try-statement
it's 'finally'
There is a `finally', too, but they are semantically different.
; part that may raise an exception, say a ValueError. So I
was hoping to do something like the following:
try:
except KeyError:
else:
except ValueError:
However, this isn't allowed in Python.
An obvious way round this is to move the `else' clause into the
`try'
> If you do write the interpreter, let me know. I would certainly experiment
> with it.
+2 over here!
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Ben,
> I have got very good results from teaching using the analogy of "paper tags
> tied to physical objects" to describe Python's references to values.
Great analogy!! And an excellent analogy for newcomers to Python. (this
would have saved me some personal pain in my
our code and would be grateful if you shared
it with this list.
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
>> I am interested in seeing your code and would be grateful if you shared it
>> with this list.
> All right here it is. Hope it helps.
Hendrik,
Thank you very much!! (I'm not the OP, but found this thread
interesting)
Best regards,
Malcolm
--
http://mail.python.org/mai
Phillip,
We've had great success writing simple, project specific algorithms to
split content into chunks appropriate for ETL type, Python based
processing in a hosted cloud environment like Amazon EC2 or the recently
launched Rackspace Cloud Servers. Since we're purchasing our cloud
ho
Python 2.6/Windows: shlex.split() does not support unicode
strings. Is this simply a limitation of the current shlex
implementation or is this an intentional design decision that
reflects the behavior of how the Windows shell supports unicode
values?
Specifically, it doesn't appear
ing is that the only time one needs to use shell=True is
when they are 'executing' a non-executable file whose executable must be
discovered via file association rules? Does that sound accurate?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
a list of all legal commands) and include this
suggestion in our diagnostic output.
I'm not sure what you would call the type of algorithm I'm
looking for: closest matching string or auto-correct?
Any suggestions on algorithms or python libraries that would help
me do what I'm looking
Michael,
Thanks for summarizing and sharing your results. Very interesting.
Regards,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Is there a standard library function to remove a folder that may
contain files and subfolders? Or must I write a function that
walks my folder's children and deletes all files/subfolders
first, and then call os.removedirs()?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/p
Is there a simple way wrap a string as a generator or do I need
to create a custom function for this?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
MRAB,
> it = iter(some_long_string)
Well, that was easy! :)
Thanks for your help.
Malcolm
- Original message -
From: "MRAB"
To: python-list@python.org
Date: Wed, 22 Sep 2010 00:27:25 +0100
Subject: Re: Iterate through a single iterator from multiple places in a
loop
Python 2.6: We're using the standard lib's cgitb module to
provide diagnostic messages when unexpected exceptions occur.
Unfortunately, this module raises a DeprecationWarning like below
when it is used:
C:\Python26\lib\cgitb.py:245: DeprecationWarning:
BaseException.message has been
ar in source:
output.write( char )
output = output.getvalue()
def time( func ):
timingObject = timeit.Timer( func )
runtime = timingObject.timeit( 10 )
print '%s = %.2f sec' % ( func.__name__, runtime )
time( testListAppend )
time( testStringConcat )
time( test
your name above your script suggestions.
My results (Python 2.7/32-bit on Window 7/64-bit)
testListAppend = 10.95 sec
testStringConcat = 49.49 sec
testStringIO = 14.68 sec
testListAppend2 = 7.42 sec < fastest !!!
testListAppend3 = 8.22 sec
testStringIO2 = 10.91 sec
Thanks for th
r by char and do lots
of string concatenation as we move through our various states. Using
lists for concatenation and Emile's technique of eliminating repeated
attribute lookups, we have significantly improved the performance of our
utilities.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Anyone using M2crypto with Python 2.7? The M2crypto site [1]
seems to indicate that M2crypto should be compatible with all 2.x
versions 2.3 or higher. However there are no user contributed
builds for any release of Python above 2.6. I'm wondering if this
is because M2crypto has problems
Python 2.7 (32-bit/Windows): Is there a way to use
webbrowser.open() to open a web page in the default browser, but
in the background, so that the application making the
webbrowser.open() call remains the active application?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python
We are using Python 2.7 for Windows (32-bit) for a bunch of small
scripts that use simple Tkinter interfaces to prompt for user
input and display information. We're thinking of freezing these
scripts (py2exe or pyinstaller), and we would like to remove some
of the optional/unnecessary files
Is there some sort of documentation regarding the files in
Python's tcl folder? I've been googling this topic without
finding such a source.
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6/2.7 (32-bit) for Windows: When I drag a Tkinter root
window to the left, upper, or right edge of my display ... as
soon as my mouse cursor hits the visible edge of the display ...
as if I'm trying to dock the window on the edge in question ... a
giant phantom Tkinter window po
Jerry,
> It sounds like you are describing the "Aero Snap" feature in Windows 7.
Bingo! You hit the nail and the head.
Thank you very much!
Regards,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
> I much prefer the wx version of the GUI over the tk version of my app.
Check out Python 2.7's Tkinter support for Tile. The enhanced version of
Tkinter that ships with 2.7 supports native OS themes across all
platforms giving you very professional looking user interfaces.
wx has l
Curious if there are any higher level frameworks that attempt to
wrap Tkinter? For example, wxPython is wrapped by the Dabo
framework (http://dabodev.com/) and PythonCard.
Motivation: We've recently moved to Python 2.7 (Windows) and are
very impressed with the new ttk (Tile) support which a
Tkinter is built-in and available on Windows, Mac, and Linux. If you're
using Python 2.7 or 3.1 you can take advantage of Tkinter's ttk (Tile)
support for platform native user interfaces.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Grant,
>> Tkinter is built-in and available on Windows, Mac, and Linux. If you're
>> using Python 2.7 or 3.1 you can take advantage of Tkinter's ttk (Tile)
>> support for platform native user interfaces.
> You get a native UI using the correct theme even on Li
://www.dreamincode.net/forums/topic/135050-tkinter-part-3-dialogs/
Tkinter, Part 4 - Basic Event Bindings
http://www.dreamincode.net/forums/topic/137447-tkinter-part-4-basic-event-bindings/
...
Excellent Tkinter documentation
List of Python Tkinter documentation
http://wiki.python.org/moin/TkInter
Overview
l.python.org/mailman/listinfo/python-list
Anyone have any experience using Python Tkinter/ttk applications
with Citrix or WTS (Windows Terminal Services)?
Any concerns, gotchas, or workarounds we should be aware of?
I googled this topic [1], [2] and came up with nothing. No news
is good news ... but just checking to make sure.
Thanks
r method I tried to execute, eg. edit_undo.
For bonus points: Is there a way to query a Tkinter Text widget
to determine if there are undo or redo actions available to
apply?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
updatedb('postgres')
18
19 if __name__ == "__main__":
20 main()
-----
--
https://mail.python.org/mailman/listinfo/python-list
Le 05/04/2017 à 20:14, Ray Cote a écrit :
Hello:
Python 3.6 crashing when trying to print from the environment.
$ python
Python 3.6.1 (default, Mar 22 2017, 15:53:21)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credi
stgres"
exit()
That's not doing what you think it is.
Hint: What is ('sqlite postgres')?
?
dbtype is a string, and the check works perfectly. No typos make it
past the guard.
except that it would be True for dbtype = 'lite post' or dbtype = 'stgr'
Marko Rauhamaa wrote:
id() is actually an ideal return value of __hash__(). The only criterion
is that the returned number should be different if the __eq__() is
False. That is definitely true for id().
$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type
Marko Rauhamaa wrote:
Python :
Marko Rauhamaa wrote:
id() is actually an ideal return value of __hash__(). The only criterion
is that the returned number should be different if the __eq__() is
False. That is definitely true for id().
$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08
Marko Rauhamaa wrote:
Python :
Marko Rauhamaa wrote:
Python :
Marko Rauhamaa wrote:
id() is actually an ideal return value of __hash__(). The only criterion
is that the returned number should be different if the __eq__() is
False. That is definitely true for id().
$ python
Python 2.7.13
Marko Rauhamaa wrote:
Python :
Marko Rauhamaa wrote:
I didn't disagree with any of these statements about __hash__, but only
your statement about id and __eq__:
id() is actually an ideal return value of __hash__(). The only
criterion is that the returned number should be different i
Hi folks,
1st time poster – apologies if I’m breaking any protocols…
We were told that this would be a good alias to announce this on: a few Python
& OSS enthusiasts and Microsoft have created a plug-in for Visual Studio that
enables Python <-> C/C++ debugging. You may find this
topic/python-excel/Thso62fdiSk
is that still the current intention?
if so, is there any other way to tell how many digits excel would round to
when displaying a floating point number? that's my only reason for needing
formatting_info=True.
cheers,
raf
--
http://mail.python.org/mailma
p manually saving xlsx files they
receive as xls before importing them. :-(
maybe i need to investigate some perl modules or pyuno instead.
perl's Spreadsheet::XSLX module handles formats. it gets the
date formats a bit wrong but it's workaroundable.
cheers,
raf
--
http://mail.python.org/mailman/listinfo/python-list
s,
raf
--
http://mail.python.org/mailman/listinfo/python-list
.txt']:
if fnmatch.fnmatch(fname,pat):
fullname = os.path.join(path,fname)
# put all the text into f and read and replace...
f = open(fullname).read()
result = find_and_remove(f, r"This is a test comment")
print result
--
http://mail.python.org/mailman/listinfo/python-list
I don't know if this has been remedied in a more recent version than
I've got on my box (Debian Stable), but it seems like it should work
out of the box:
Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits
it much easier to uninstall the package
i know that both of these are things that the python community
does not yet seem to find useful but everyone else seems to.
for instance, if i just install the new versions of these packages
on windows, it will replace the python-specific files that were
a
Chris Withers wrote:
> On 22/02/2012 00:37, python-ex...@raf.org wrote:
> >was good for previous versions. two reasons that spring to mind
> >immediately are:
> >
> > - it makes it much easier to tell what version is installed
> > - it makes it much easier to un
how do i merge two seqs alernative;
("xyz", "7890")
output: x7y8z90
any help would be appreciated..
--
http://mail.python.org/mailman/listinfo/python-list
Can any one help? I am looking for a Senior Python Developer - Linux,
AppScript, Adobe Illustrator - Bradford, Yorkshire - £45,000
Our marketing and design client is looking to recruit an experienced
Python developer for a senior position within their expanding
organisation. Working
skontaktowac w kazdej chwili, jesli macie
jakiekolwiek dodatkowe pytania dotyczace tej pozycji.
Nasz e-mail: maksymil...@toppolandjobs.com,Najcieplej pozdrawiamy,
Maksymilian Skrzypinski
Menadzer personelu
WUG Inc
--
http://mail.python.org/mailman/listinfo/python-list
rse for obj in data[`results']) KeyError: `results'
__
I was expecting an html with the transcript. So why did I get the errors
above?
python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
_
Speech to text conversion is not a pure Python solution. It must be
based
on some kind of "external service". From the details you have provided,
it looks like some web service.
Yes, you are right. It's based on IBM Watson's web/cloud service.
On Mon, Sep 18, 2017 at 1:11 AM, Paul wrote:
On 18 September 2017 at 09:03, pizza python wrote:
> Your error occurs because what the "external service" has
delivered
> it not what "speech-to-text" has expected. More precisely,
&
501 - 600 of 5280 matches
Mail list logo