Re: Sanitising arguments to shell commands

2009-08-21 Thread Rick King
shlex doesn't handle unicode input though, so, in general, it's not a good solution. Rick King Southfield MI http://docs.python.org/library/shlex.html module shlex — Simple lexical analysis New in version 1.5.2. "The shlex class makes it easy to write lexical analyzers for

Re: how to use "exec" stmt to get input from user

2009-08-10 Thread Rick King
t how "ShowModal" is spelled in wx right now) with a text box and an Execute button and a Cancel button - if the user hits the Execute button I'd attempt to execute what he'd typed in the box. There are reasons you want to be very careful about this... On Mon, 10 Aug 2009 13:44:17

how to use "exec" stmt to get input from user

2009-08-10 Thread Rick King
so means I have to have a command window. If I add this: self.stdin = self.edt_console_input (where self.edt_console_input is a wxPython text control) it just gets an EOF right away. Is there any way to do what I want to do? This might be better posted on the wxpython list. Thanks fo

py2exe-created exe results in "application failed to initialize"

2009-08-07 Thread Rick King
uot;filetoolGUI.py", other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="FileTool"))], dest_base = "FileTool") setup( options = {"py2exe": {"compressed": 1,"optimize": 2,"ascii": 1,"bundle_files": 1}}, zipfile = None, windows = [FileTool], ) Any help will be greatly appreciated! Rick King Southfield MI USA -- http://mail.python.org/mailman/listinfo/python-list

Re: uniicode and executing a process with subprocess.call, or os.system

2009-07-19 Thread Rick King
Thanks. I looked around for alternatives but didn't find this one. Rick Chris Rebert wrote: On Sat, Jul 18, 2009 at 3:30 PM, Rick King wrote: Hello, I want to copy files using subprocess.call or os.system where the file names are non-ascii, e.g. Serbian(latin), c's and s's w

uniicode and executing a process with subprocess.call, or os.system

2009-07-18 Thread Rick King
;t work. I am very confused about unicode. Can someone point me in the right direction? windows xp sp2 python 2.6.2 unicode Thanks! Rick King Southfield MI -- http://mail.python.org/mailman/listinfo/python-list

Subclassing datetime.date does not seem to work

2008-04-25 Thread Rick King
then this statement: d = date2('12312008') Causes: TypeError: function takes exactly 3 arguments (1 given) Is there something basically wrong with subclassing date? -Rick King -- http://mail.python.org/mailman/listinfo/python-list

Re: annoying dictionary problem, non-existing keys

2008-04-24 Thread Rick King
dict also has 'get' which provides a default if the key isn't defined: a={} print a.get('a','default') default -Rick King southfield MI -- http://mail.python.org/mailman/listinfo/python-list

Re: urgent question, about filesystem-files

2008-04-10 Thread Rick King
Could you first find out if it exists with isfile(..) and then try to open it? If it fails I *think* it would have to be open by another process. -Rick King Southfield MI bvidinli wrote: i started python programming a few months ago. now i need the code to understand if a file already

Re: Pydev shell (was: Re: Stani's python ide 'spe' editor problem)

2008-04-09 Thread Rick King
I guess this is appropriate to the list... the funky things in eclipse that were happening are hard to describe, but first let me say that none of the other ide's had any funky things happening so I don't think it was my code. That said: I'm working on a command line bulk file renaming tool (us

Stani's python ide 'spe' editor problem (again)

2008-04-09 Thread Rick King
In my previous post about spe I didn't mention that my set up is: python 2.4.4 wxpython 2.8.3 thanks. -Rick King -- http://mail.python.org/mailman/listinfo/python-list

Stani's python ide 'spe' editor problem

2008-04-09 Thread Rick King
for larger projects but limited in general. I really like spe and want to continue using it. Stani himself seems pretty unreachable. Does anyone have a clue for me about what the issue is? Is no one else using this great ide? Or is no one else having this problem? Thanks for any help