A very short change that does it in spyderlib/widgets/sourcecode/mixins.py, 
from line 186: 

        def _is_separator(cursor):
            cursor0 = QTextCursor(cursor)
            cursor0.select(QTextCursor.BlockUnderCursor)
-            text = unicode(cursor0.selectedText())
-            return len(text.strip()) == 0 or text.lstrip()[0] == '#'
+           text = unicode(cursor0.selectedText()).lstrip()
+           return text[:2] == '##' or text[:12] == '# <codecell>'

What do you think of it?
S. 

On Saturday, March 2, 2013 9:49:29 PM UTC-5, Sylvain Corlay wrote:

> Hi, 
>
> I think that Mark's proposal is interesting. One could give the choice 
> between delimiters "##" and "# <codecell>" which is the default delimiter 
> when exporting an ipython notebook as a python script. 
>
> Sylvain
>
> On Thursday, December 20, 2012 1:24:09 AM UTC-5, David wrote:
>>
>> If you select the region of code you want to run, then press F9, it will 
>> be executed.
>>
>> I believe this was done in response to previous requests for a cell mode 
>> in spyder, and should be good enough for most purposes. If you really need 
>> cell mode for python code, then consider using the IPython notebook (
>> http://ipython.org/)
>>
>> On Tuesday, 18 December 2012 07:46:47 UTC+11, Mark Dean wrote:
>>>
>>> Dear all,
>>>
>>> Is there any way to get spyder to execute code in blocks marked off by a 
>>> delimiter. For example a double quote ##?
>>>
>>> Thanks a lot,
>>> Mark
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to