thanks for a super fast reply Chris :)
On Tue, Apr 17, 2012 at 8:06 PM, Chris Angelico wrote:
> On Wed, Apr 18, 2012 at 12:31 AM, Nibin V M wrote:
> > # python test.py
> > File "test.py", line 1
> > with open('/etc/trueuserowners') as res_own_file:
> > ^
> > IndentationError: unexpe
On Wed, Apr 18, 2012 at 12:31 AM, Nibin V M wrote:
> # python test.py
> File "test.py", line 1
> with open('/etc/trueuserowners') as res_own_file:
> ^
> IndentationError: unexpected indent
Make sure your first code line is flush left. Since indentation
indicates block structure (and not
# python test.py
File "test.py", line 1
with open('/etc/trueuserowners') as res_own_file:
^
IndentationError: unexpected indent
[~]# cat test.py
with open('/etc/trueuserowners') as res_own_file:
all_res = set(line.strip().replace(' ', '').split(':')[1] for line in
res_own_file if ':
wow...thanks Karl :)
On Tue, Apr 17, 2012 at 2:20 AM, Karl Knechtel wrote:
>
>
> On Sun, Apr 15, 2012 at 5:51 AM, Chris Angelico wrote:
>
>>
>> (You may also want to consider using the 'with' statement to guarantee
>> a timely closing of the file. Outside the scope of this mail though.)
>>
>> I
On Sun, Apr 15, 2012 at 5:51 AM, Chris Angelico wrote:
>
> (You may also want to consider using the 'with' statement to guarantee
> a timely closing of the file. Outside the scope of this mail though.)
>
> I think this list is just to collect unique entries, yes? If so, a set
> may be more to you
Thank you Chris :) ..I will check it...
On Sun, Apr 15, 2012 at 3:21 PM, Chris Angelico wrote:
> On Sun, Apr 15, 2012 at 7:15 PM, Nibin V M wrote:
> > res_own_file = open('/bah')
> > res_own_list = res_own_file.readline()
> > res_tot_list=[]
> > while res_own_list:
> > res_own_list=res_own_li
On Sun, Apr 15, 2012 at 7:15 PM, Nibin V M wrote:
> res_own_file = open('/bah')
> res_own_list = res_own_file.readline()
> res_tot_list=[]
> while res_own_list:
> res_own_list=res_own_list.strip()
> res_own_list=res_own_list.replace(' ', '')
> res_name=res_own_list.split(':')
> if res_name