Read utf-8 file

2013-03-18 Thread moonhkt
File have China Made 中國 製 http://www.fileformat.info/info/unicode/char/4e2d/index.htm UTF-16 (hex)0x4E2D (4e2d) UTF-8 (hex) 0xE4 0xB8 0xAD (e4b8ad) Read by od -cx utf_a.text 000 中 ** ** 國 ** ** 製 ** ** \n e4b8ade59c8be8a3bd0a 012 Read by py

Re: Split string data have ","

2013-01-29 Thread moonhkt
On Jan 30, 1:08 am, Chris Rebert wrote: > On Jan 29, 2013 9:05 AM, "moonhkt" wrote: > > > > > > > > > > > > > Hi All > > > Python 2.6.2 on AIX 5.3 > > How to using split o > > > >>> y = '"abc.

Split string data have ","

2013-01-29 Thread moonhkt
Hi All Python 2.6.2 on AIX 5.3 How to using split o >>> y = '"abc.p,zip.p",a,b' >>> print y "abc.p,zip.p",a,b >>> >>> k= y.split(",") >>> print k[0] "abc.p >>> Need Result, First element is abc.p,zip.p -- http://mail.python.org/mailman/listinfo/python-list

create object base on text file

2013-01-25 Thread moonhkt
"] have batch4, batch5 moonhkt -- http://mail.python.org/mailman/listinfo/python-list

Re: Increase value in hash table

2013-01-23 Thread moonhkt
      printque[val] = 1 >                  else: >                     printque[val] = printque[val] + 1 > > On Wed, Jan 23, 2013 at 6:12 PM, Oscar Benjamin > > > > > > > > > > wrote: > > On 23 January 2013 07:26, moonhkt wrote: > >

Re: Increase value in hash table

2013-01-23 Thread moonhkt
On Jan 23, 3:34 pm, Chris Rebert wrote: > On Jan 22, 2013 11:31 PM, "moonhkt" wrote: > > > > > > > > > > > > > Hi Al > > > I have Data file have below > > > Data file > > V1 > > V2 > > V3 > > V4 > &

Increase value in hash table

2013-01-22 Thread moonhkt
Hi Al I have Data file have below Data file V1 V2 V3 V4 V4 V3 How to using count number of data ? Output V1 = 1 V2 = 1 V3 =2 V4 = 2 # Global Veriable printque = {} in def have below printque[val] = printque[val] + 1 I have below error File "xprintlogchk.py", line 78, in chklog print

Re: About UNIX shell trap, any relative function in Python ?

2012-12-15 Thread moonhkt
On 12月16日, 上午12時05分, Chris Angelico wrote: > On Sun, Dec 16, 2012 at 3:04 AM, Chris Angelico wrote: > > On Sun, Dec 16, 2012 at 2:34 AM, moonhkt wrote: > > >> Hi All > > >> Machine : AIX 5.3 > >> Python : 2.6.2 > > > Yep! Check out the '

About UNIX shell trap, any relative function in Python ?

2012-12-15 Thread moonhkt
Hi All Machine : AIX 5.3 Python : 2.6.2 In UNIX have, trap to run defined CLEAN_UP function. When HUP INT KILL STOP TERM will run CLEAN_UP function. trap 'echo "\n\nProcessing Clean up"; CLEAN_UP; exit' HUP INT KILL STOP TERM Any relative function in Python

About open file for Read

2012-12-10 Thread moonhkt
Hi All I am new in Python. When using open and then for line in f . Does it read all the data into f object ? or read line by line ? f=open(file, 'r') for line in f: if userstring in line: print "file: " + os.path.join(root,file) brea

Re: using smtp sent large file upto 60MB

2012-12-10 Thread moonhkt
On 12月5日, 下午11時01分, Michael Torrie wrote: > On 12/04/2012 05:54 PM, moonhkt wrote: > > > Our SMTP can send file more than 60MB. But our notes server can > > configured 100MB,30MB or 10MB. My notes Mail box can receive 100MB. > > > In UNIX, by below command send  smtp m

How to list a file which already created a 2 mins ago

2012-12-06 Thread moonhkt
Hi All AIX.5.3 Python 2.6.2 File ftp to Machine A, need to rename then send to Machine B. How to list a file which already created a 2 mins ago ? If file aging more than 2 mins. I want to rename file to other file name. moonhkt -- http://mail.python.org/mailman/listinfo/python-list

Re: using smtp sent large file upto 60MB

2012-12-04 Thread moonhkt
On 12月5日, 下午1時34分, Chris Angelico wrote: > On Wed, Dec 5, 2012 at 11:54 AM, moonhkt wrote: > > I am prepare change UNIX script to Python. smtp and ftp are my first > > tasks. > > > But, when using standard unix command mail and uuencode without this > > issue. >

Re: using smtp sent large file upto 60MB

2012-12-04 Thread moonhkt
ncode without this issue. Our SMTP can send file more than 60MB. But our notes server can configured 100MB,30MB or 10MB. My notes Mail box can receive 100MB. In UNIX, by below command send smtp mail. uuencode $xfn $xfn | mail -s "$SUBJECT" $NAME moonhkt -- http://mail.python.org/mailman/listinfo/python-list

Re: using smtp sent large file upto 60MB

2012-12-04 Thread moonhkt
On Dec 4, 6:07 pm, Chris Angelico wrote: > On Tue, Dec 4, 2012 at 7:15 PM, moonhkt wrote: > > How to using python send file uptp 60MB ? > > Step one: Don't. SMTP is almost never the best choice for sending huge > files around. > > There are plenty of other ways to sh

using smtp sent large file upto 60MB

2012-12-04 Thread moonhkt
Hi All How to using python send file uptp 60MB ? s = smtplib.SMTP("localhost") #~~ s.set_debuglevel(1) s.sendmail(from_addr, to_addr,m.as_string()) s.quit For 13MB file have below error s.sendmail(from_addr, to_addr,m.as_string()) File "/opt/freeware/lib/python2.6/email/message.py", line

Re: skip Trackback error for ftp checking

2012-11-12 Thread moonhkt
On Nov 10, 2:50 pm, Steven D'Aprano wrote: > On Fri, 09 Nov 2012 20:51:47 -0800, moonhkt wrote: > > HI All > > > How to skip Trackback warning/error when input ftp address is not > > correct or reject ? > > The same way you would skip any other error when

skip Trackback error for ftp checking

2012-11-09 Thread moonhkt
HI All How to skip Trackback warning/error when input ftp address is not correct or reject ? AIX 5.3 from ftplib import FTP import ftplib import sys from optparse import OptionParser parser = OptionParser() parser.add_option("-a","--remote_host_address", dest="remote_host_address", help="R

how to build Object for List data

2012-10-08 Thread moonhkt
Program2,1,3,4 # Add F1 and F3 value to F4 ... 50 Seq validation 1 Program3,1,3,4 # max(F1,F3) to F4 .. n How to using python to Read the text file, Build the data as object class ? moonhkt -- http://mail.python.org/mailman/listinfo/python-list

newbie question About O'Reilly "Python for Unix and Linux System Administration" ftp Mirror question

2012-09-16 Thread moonhkt
Hi All O'Reilly Book ISBN 978-986-6840-36-4. python --version Python 2.6.2 on AIX 5.3 Using this python to get files in ftp server. I got below error. What is the error meaning and how to fix ? ftp_mirror.py Traceback (most recent call last): File "/xx../shell/ftpmirror.py", line 80, in