file extension while saving Python files

2011-11-08 Thread vaira muthu
Team, In Python IDE, while we save the script, it will prompt the save Dialog. If we specify the filename as "Test". Then file will be saved without extension as "Test" and not "Test.py". Is it possible to save the script with .py extension automatically (as Test.py)? Thanks, vairamuthu. -- htt

Re: file extension while saving Python files

2011-11-08 Thread Magnus Lyckå
On 2011-11-08 11:05, vaira muthu wrote: In Python IDE, ... Which Python IDE? There are dozens: http://wiki.python.org/moin/IntegratedDevelopmentEnvironments -- http://mail.python.org/mailman/listinfo/python-list

Re: all() is slow?

2011-11-08 Thread Henrik Faber
On 07.11.2011 23:06, Chris Angelico wrote: > On Tue, Nov 8, 2011 at 8:46 AM, david vierra wrote: >> But, you didn't write an all() function. You wrote a more specialized >> allBoolean() function. I think this comparison is more fair to the >> builtin all(): > > So really, it's not "all() is slow

Re: all() is slow?

2011-11-08 Thread Chris Angelico
On Tue, Nov 8, 2011 at 11:09 PM, Henrik Faber wrote: > On 07.11.2011 23:06, Chris Angelico wrote: >> So really, it's not "all() is slow" but "function calls are slow". >> Maybe it'd be worthwhile making an all-factory: > > PLEASE say you're joking. If I saw code like that on any of our project, >

Re: Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-08 Thread Dave Angel
On 11/08/2011 02:35 AM, Chris Angelico wrote: On Tue, Nov 8, 2011 at 4:09 PM, Lie Ryan wrote: I much prefer the "everything's an object" notion. C's array literals are just as weird (although in C, you can directly dereference a literal character array - "ABCDEFG"[note_idx] will give you a note

Re: ctypes accessing functions with double pointers

2011-11-08 Thread Eleftherios Garyfallidis
Thank you Chris :-) On Mon, Nov 7, 2011 at 11:29 PM, Chris Rebert wrote: > On Mon, Nov 7, 2011 at 2:06 PM, Eleftherios Garyfallidis > wrote: > > Hello, > > > > Is it possible using ctypes to call C functions from a shared object > > containing double pointers e.g. int foo(float **i) and if yes

Help catching error message

2011-11-08 Thread Gnarlodious
What I say is this: def SaveEvents(self,events): try: plistlib.writePlist(events, self.path+'/Data/Events.plist') # None if OK except IOError: return "IOError: [Errno 13] Apache can't write Events.plist file" Note that success returns"None" while failure returns a string. I cat

Re: file extension while saving Python files

2011-11-08 Thread John Gordon
In vaira muthu writes: > Team, > In Python IDE, while we save the script, it will prompt the save > Dialog. If we specify the filename as "Test". Then file will be saved > without extension as "Test" and not "Test.py". Is there a drop-down list selection for specifying the file type? -- Joh

Re: file extension while saving Python files

2011-11-08 Thread mannan
if it is not a python ide then, you have to explicitly specify the extension. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help catching error message

2011-11-08 Thread Jean-Michel Pichavant
Gnarlodious wrote: What I say is this: def SaveEvents(self,events): try: plistlib.writePlist(events, self.path+'/Data/Events.plist') # None if OK except IOError: return "IOError: [Errno 13] Apache can't write Events.plist file" Note that success returns"None" while failure ret

Re: Help catching error message

2011-11-08 Thread Jean-Michel Pichavant
Jean-Michel Pichavant wrote: Gnarlodious wrote: What I say is this: def SaveEvents(self,events): try: plistlib.writePlist(events, self.path+'/Data/Events.plist') # None if OK except IOError: return "IOError: [Errno 13] Apache can't write Events.plist file" Note that success r

Re: file extension while saving Python files

2011-11-08 Thread Ned Deily
In article , vaira muthu wrote: > In Python IDE, while we save the script, it will prompt the save > Dialog. If we specify the filename as "Test". Then file will be saved > without extension as "Test" and not "Test.py". > > Is it possible to save the script with .py extension automatically (as

Re: easy_install doesn't install non-package *.py file

2011-11-08 Thread Terry Reedy
On 11/7/2011 11:32 PM, Makoto Kuwata wrote: I got trouble about easy_install command. My package: README.rst setup.py foobar/ foobar/__init__.py foobar/data/ foobar/data/template.py In the above example, 'foobar/data/template.py' is just a template data file (= not a python m

Re: Line continuation issue\

2011-11-08 Thread Westley Martínez
On Fri, Nov 04, 2011 at 11:10:58AM -0400, Steven Lehar wrote: > Is this the right place to propose language extensions? > > My Python code keeps expanding rightwards, it is difficult to keep it > contained within reasonable limits. But the standard line continuation \ > is positively anti-Pythonic

RE: xml-rpc server on wine

2011-11-08 Thread Prasad, Ramit
>> Hi, I have a XML-RPC server python running on VM Windows (on Linux) >> and a XML-RPC client python on Linux. Server and client have different >> IP address. I'd like migrate server on wine. How can communicate >> server and client? IP address is different or is the same? >> Can you help me? >No

Re: Help catching error message

2011-11-08 Thread Steven D'Aprano
On Tue, 08 Nov 2011 05:20:51 -0800, Gnarlodious wrote: > What I say is this: > > def SaveEvents(self,events): >try: > plistlib.writePlist(events, self.path+'/Data/Events.plist') # > None if OK >except IOError: > return "IOError: [Errno 13] Apache can't write Events.plist > fil

getting command line in python

2011-11-08 Thread MrSmile
Hi people! I am looking for a way to get the command line in the script. Let us say I am in the folder "/tmp" okay! now from /tmp I execute in the console this: python /home/tamer/MyApp/MyScript.py in the app itself, I want to grep the path and the scriptname itself, like: /home/tamer/MyApp is b

Re: getting command line in python

2011-11-08 Thread Irmen de Jong
On 8-11-2011 23:19, MrSmile wrote: Hi people! I am looking for a way to get the command line in the script. Let us say I am in the folder "/tmp" okay! now from /tmp I execute in the console this: python /home/tamer/MyApp/MyScript.py in the app itself, I want to grep the path and the scriptname

Re: getting command line in python

2011-11-08 Thread Chris Rebert
On Tue, Nov 8, 2011 at 2:19 PM, MrSmile wrote: > Hi people! > I am looking for a way to get the command line in the script. > > Let us say I am in the folder "/tmp" okay! > > now from /tmp I execute in the console this: > python /home/tamer/MyApp/MyScript.py > > in the app itself, I want to grep t

Re: getting command line in python

2011-11-08 Thread Cameron Simpson
On 08Nov2011 23:19, MrSmile wrote: | I am looking for a way to get the command line in the script. | | Let us say I am in the folder "/tmp" okay! | | now from /tmp I execute in the console this: | python /home/tamer/MyApp/MyScript.py | | in the app itself, I want to grep the path and the script

Re: getting command line in python

2011-11-08 Thread MrSmile
Thank you all, that was it that I was searching for you. Tamer Am 08.11.2011 23:32, schrieb Cameron Simpson: > On 08Nov2011 23:19, MrSmile wrote: > | I am looking for a way to get the command line in the script. > | > | Let us say I am in the folder "/tmp" okay! > | > | now from /tmp I execut

Re: all() is slow?

2011-11-08 Thread John Posner
On 2:59 PM, Chris Angelico wrote: >>> So really, it's not "all() is slow" but "function calls are slow". >>> Maybe it'd be worthwhile making an all-factory: >> PLEASE say you're joking. If I saw code like that on any of our project, >> this would definitely qualify for a DailyWTF. > For the benefi

Decouplable CMS in python?

2011-11-08 Thread Tim Johnson
:)I'm sure decouplable is a word. If not it should be. I have written my own framework. This has been a work in progress as a consequence of projects that I have done over the last 10 years. I need a CMS that sits "on top of" the framework. One of the starting points that I have considered is find

Re: all() is slow?

2011-11-08 Thread Tim Chase
On 11/08/2011 04:51 PM, John Posner wrote: On 2:59 PM, Chris Angelico wrote: So really, it's not "all() is slow" but "function calls are slow". Maybe it'd be worthwhile making an all-factory: PLEASE say you're joking. If I saw code like that on any of our project, this would definitely qualify

Re: overview on dao

2011-11-08 Thread Simeon Chaos
On Nov 9, 1:52 am, Dennis Lee Bieber wrote: > On Mon, 7 Nov 2011 21:10:59 -0800 (PST), Simeon Chaos > declaimed the following in > gmane.comp.python.general: > > > Dao is a a functional logic solver (similar to lambdaProlog, Curry) > > written in python. The links related to dao are here: > >    

Re: all() is slow?

2011-11-08 Thread Devin Jeanpierre
Clearly what we need is a modern hygienic macro system to avoid this exec mess! defmacro defall(name, cond): def name(lst): for a in lst: if not cond: return False return True invoke defall(all, cond) Only slightly tongue in cheek. We have that st

Re: overview on dao

2011-11-08 Thread MRAB
On 09/11/2011 00:13, Simeon Chaos wrote: On Nov 9, 1:52 am, Dennis Lee Bieber wrote: On Mon, 7 Nov 2011 21:10:59 -0800 (PST), Simeon Chaos declaimed the following in gmane.comp.python.general: Dao is a a functional logic solver (similar to lambdaProlog, Curry) written in python. The links r

Re: all() is slow?

2011-11-08 Thread Chris Angelico
On Wed, Nov 9, 2011 at 11:44 AM, Devin Jeanpierre wrote: > Clearly what we need is a modern hygienic macro system to avoid this exec > mess! > > defmacro defall(name, cond): >    def name(lst): >        for a in lst: >            if not cond: >                return False >        return True #d

Re: all() is slow?

2011-11-08 Thread Chris Rebert
On Tue, Nov 8, 2011 at 5:19 PM, Chris Angelico wrote: > On Wed, Nov 9, 2011 at 11:44 AM, Devin Jeanpierre > wrote: >> Clearly what we need is a modern hygienic macro system to avoid this exec >> mess! >> >> defmacro defall(name, cond): >>    def name(lst): >>        for a in lst: >>            i

Re: Help catching error message

2011-11-08 Thread Gnarlodious
On Nov 8, 3:16 pm, Steven D'Aprano wrote: > content = Data.Dict.SaveEvents(Data.Plist.Events) or content > > This will leave content unchanged if no error is returned, otherwise it > will replace the value. Ah, the 'or' operator does it. Thank you, that is exactly what I was looking for. I should

Re: all() is slow?

2011-11-08 Thread Steven D'Aprano
On Tue, 08 Nov 2011 19:44:18 -0500, Devin Jeanpierre wrote: > We have that stupid exec trick in the Python stdlib. It has to die. > > http://hg.python.org/cpython/file/6bf07db23445/Lib/collections/__init__.py#l240 http://bugs.python.org/issue3974 http://blog.ccpgames.com/kristjan/2011/05/28/nam

Re: Help catching error message

2011-11-08 Thread Steven D'Aprano
On Tue, 08 Nov 2011 17:48:57 -0800, Gnarlodious wrote: > On Nov 8, 3:16 pm, Steven D'Aprano wrote: > >> content = Data.Dict.SaveEvents(Data.Plist.Events) or content >> >> This will leave content unchanged if no error is returned, otherwise it >> will replace the value. > Ah, the 'or' operator doe