Re: why it append one more letter after decode?

2017-10-30 Thread ROGER GRAYDON CHRISTMAN
On Sun, Oct 29, 2017 11:06 PM, Ho Yeung Lee wrote: > if run these function to decode in python interactive console, >it can decode correct, > >but when run with a big project, it append a letter Y > > >On Monday, October 30, 2017 at 9:48:36 AM UTC+8, Ho Yeung Lee wrote: >> def leftrotate(l, n):

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
i fixed by replace("","\\") On Monday, October 30, 2017 at 11:16:02 AM UTC+8, Igor Korot wrote: > Hi, > > On Sun, Oct 29, 2017 at 10:03 PM, Ho Yeung Lee wrote: > > i discover when > > it > > decode("\\",1,2) > > in interactive console > > is [ > > > > but decode in

Re: why it append one more letter after decode?

2017-10-29 Thread Igor Korot
Hi, On Sun, Oct 29, 2017 at 10:03 PM, Ho Yeung Lee wrote: > i discover when > it > decode("\\",1,2) > in interactive console > is [ > > but decode in big project > it see as > decode(r"\\",1,2) > [[ > > it double Those 2 lines are different. Thank you. > > On Monday,

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
it seems that it read csv file from "\\" to "" On Monday, October 30, 2017 at 11:03:57 AM UTC+8, Ho Yeung Lee wrote: > i discover when > it > decode("\\",1,2) > in interactive console > is [ > > but decode in big project > it see as > decode(r"\\",1,2) > [[ > > it double > > On Monday,

Re: why it append one more letter after decode?

2017-10-29 Thread Igor Korot
Hi, On Sun, Oct 29, 2017 at 8:50 PM, Ho Yeung Lee wrote: > > if run these function to decode in python interactive console, > it can decode correct, You probably changed the code somewhere... You just need to debug it and see what is happening... Thank you. > > but when

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
i discover when it decode("\\",1,2) in interactive console is [ but decode in big project it see as decode(r"\\",1,2) [[ it double On Monday, October 30, 2017 at 9:51:01 AM UTC+8, Ho Yeung Lee wrote: > if run these function to decode in python interactive console, > it can decode correct, >

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
if run these function to decode in python interactive console, it can decode correct, but when run with a big project, it append a letter Y On Monday, October 30, 2017 at 9:48:36 AM UTC+8, Ho Yeung Lee wrote: > def leftrotate(l, n): > return l[n:] + l[:n] > > def rightrotate(l, n): >

why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
def leftrotate(l, n): return l[n:] + l[:n] def rightrotate(l, n): return l[-n:] + l[:-n] def encode(s, k, kk): l = [ord(i) for i in s] return leftrotate(''.join([chr(i + k) for i in l]), kk) def decode(s, k, kk): l = [ord(i) for i in rightrotate(s, kk)] return