Re: [Tutor] emacs and tabs/spaces

2014-12-04 Thread Ben Finney
"André Walker-Loud " writes: > In this case, the “tab” alignment does not make it an integer number > of 4 spaces - so when I try and edit the file on a different machine, > with another editor (TextWrangler) that does actually put all tabs to > 4 spaces, I end up breaking my files often. This i

[Tutor] emacs and tabs/spaces

2014-12-04 Thread André Walker-Loud
Hi All, I haven’t found an answer yet to this question via google or tutor archives. For those of you who use emacs as an editor, I have the following problem. I have edited my .emacs file to have (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t) (

Re: [Tutor] How to split string into separate lines

2014-12-04 Thread Lifeng Lin
would this work? >>> a="fe01b8412756fe02fe01b9416239fe02fe01ba41ad88fe02fe01bb41e8e7fe02fe01bc4112fbfe02fe01bd415794fe02" >>> b=a.replace('fe02fe01','fe02\nfe01').split('\n') >>> for c in b: ... p

Re: [Tutor] How to split string into separate lines

2014-12-04 Thread Alex Kleider
On 2014-12-03 21:36, shweta kaushik wrote: Hi Joel, Yes all lines start with fe01 and ends with fe02. Might this problem not be more easily solved using the re module? import re pat_obj = re.compile(r'fe01[0-9a-f]+?fe02') my_list = pat_obj.findall(string2split) I tried few things and able t

Re: [Tutor] How to split string into separate lines

2014-12-04 Thread shweta kaushik
Hi Joel, Yes all lines start with fe01 and ends with fe02. I tried few things and able to split it as list and then I want to split it into bytes of two like s= fe 01 but when I am taking s[0] then it is giving only f instead of fe. On 04-Dec-2014 3:47 am, "Joel Goldstick" wrote: > On Wed, Dec