[Tutor] sftp in python without using pysftp or paramiko

2018-10-20 Thread Asad
hi All , I am looking to create a python script which logs in to the server and copies the fie from ftp to local system .: sftp a...@us.com 2100 password : xxx sftp> cd /to_dir sftp > get file1 sftp >exit Please advice . -- Asad Hasan +91 9

[Tutor] How to print lines within two timestamp

2018-10-26 Thread Asad
Hi , Yes i have the code : import re import datetime from datetime import timedelta Header = "*" f3 = open ( r"D:\QI\logA.txt", 'r' ) string = f3.read () regex = re.compile ( "\n" ) st = regex.sub ( " ", string ) st1 = st.split ( " " ) if re.

[Tutor] How to print lines within two timestamp

2018-10-27 Thread Asad
or body 'help' to > tutor-requ...@python.org > > You can reach the person managing the list at > tutor-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tutor digest..." > Today

[Tutor] (no subject)

2018-10-27 Thread Asad
estamp (Alan Gauld) > 2. Re: Python Help (Alan Gauld) >3. Re: How to print lines within two timestamp (Peter Otten) >4. How to print lines within two timestamp (Asad) > > > > -- Forwarded message -- > From: Alan Gauld > To: tutor@python.org > Cc:

[Tutor] Regex for Filesystem path

2018-11-06 Thread Asad
e directory location as /a/b/c/d/test/123456/789 3) cd /a/b/c/d/test/123456/789 4) look for the latest file in the directory /a/b/c/d/test/123456/789 5) print its content Please advice , -- Asad Hasan +91 9582111698 ___ Tutor maillist - Tuto

Re: [Tutor] Regex for Filesystem path (Asad)

2018-11-07 Thread Asad
e: [Tutor] Regex for Filesystem path > On 06Nov2018 18:10, Alan Gauld wrote: > >On 06/11/2018 13:13, Asad wrote: > > > >> Can you provide some advice and code for the following problem : > > > >The first thing is to go read the documentation for the os.path mod

Re: [Tutor] Regex for Filesystem path (Asad)

2018-11-08 Thread Asad
uld > To: tutor@python.org > Cc: > Bcc: > Date: Wed, 7 Nov 2018 19:21:58 + > Subject: Re: [Tutor] Regex for Filesystem path (Asad) > On 07/11/2018 15:56, Asad wrote: > > Hi All, > > > > I tired seems its not working as required : > > > &

[Tutor] Example for read and readlines()

2018-11-11 Thread Asad
te over st1 How are the above options different it they are not can there be some examples to describe in which situations should we each method . Thanks, -- Asad Hasan +91 9582111698 ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Example for read and readlines()

2018-11-11 Thread Asad
ot visible so can we verify in someway to proof EOL \n is placed in the file . Thanks, > > > > > > -- Forwarded message -- > From: Asad > To: tutor@python.org > Cc: > Bcc: > Date: Sun, 11 Nov 2018 12:19:36 +0530 > Subject: [Tu

Re: [Tutor] Example for read and readlines() (Asad)

2018-11-12 Thread Asad
son managing the list at > tutor-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tutor digest..." > Today's Topics: > >1. Re: Require Python assistance (Alan Gauld) >2. Re: Example f

[Tutor] How to create a html hyperlink for a document

2018-11-12 Thread Asad
module cannot be installed on it . Need some trick to create it . Please advice , Thanks, -- Asad Hasan +91 9582111698 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] how to print lines which contain matching words or strings

2018-11-18 Thread Asad
Hi All , I have a set of words and strings : like : p = [A ,"B is good" ,123456 , "C "] I have a file in which I need to print only the lines which matches the pattern in p thanks, -- Asad Hasan +91 9582111698 ___ Tuto

Re: [Tutor] how to print lines which contain matching words or strings

2018-11-20 Thread Asad
n iterate over the lines in a file to print the lines matching the condition. Please advice , Thanks, Previous email : ====== Asad, As others have already pointed out, your request is far from clear. Ignoring the strange use of words,

[Tutor] Search error code in a logfile and print all lines until the error code

2018-11-29 Thread Asad
riable `--NotebookApp.iopub_data_rate_limit`. Current values: NotebookApp.iopub_data_rate_limit=100.0 (bytes/sec) NotebookApp.rate_limit_window=3.0 (secs) the first for loop will search for the error and provide me the position of the error . I think the logic I am using is correc

[Tutor] sftp using subprocess

2018-12-03 Thread Asad
cess = subprocess.Popen(['sftp', '-b', 'batch.txt', user_host], shell=False) however it gives error even unable to provide password . Please advise. Thank you, -- Asad Hasan +91 9582111698 ___ Tutor maillist - Tutor@pyt

Re: [Tutor] sftp using subprocess

2018-12-04 Thread Asad
eive this because I cannot import pexcept module . Thanks, > > > -- Forwarded message -- > From: David Rock > To: Tutor Python > Cc: > Bcc: > Date: Mon, 3 Dec 2018 18:12:05 -0600 > Subject: Re: [Tutor] sftp using subprocess > > > On Dec 3, 2018

[Tutor] sftp using subprocess

2018-12-04 Thread Asad
Tutor digest..." > Today's Topics: > >1. Re: sftp using subprocess (Alan Gauld) > > > > -- Forwarded message -- > From: Alan Gauld > To: tutor@python.org > Cc: > Bcc: > Date: Tue, 4 Dec 2018 08:41:03 + > Subject: Re: [Tutor] s

[Tutor] unzip and connect to Oracle database

2018-12-07 Thread Asad
t;>> z = ZipFile('file.zip') >>> print z.namelist() [] >>> print z >>> z.extractall() Doesnot unzip the zip file I unable to unzip the file what I am doing wrong ? Also share some code or documentation to connect to Oracle DB and execute sql scripts.

[Tutor] Increase performance of the script

2018-12-09 Thread Asad
Hi All , I have the following code to search for an error and prin the solution . /A/B/file1.log size may vary from 5MB -5 GB f4 = open (r" /A/B/file1.log ", 'r' ) string2=f4.readlines() for i in range(len(string2)): position=i lastposition =position+1 while True:

[Tutor] Increase performance of the script

2018-12-11 Thread Asad
an "Re: Contents of Tutor digest..." > Today's Topics: > >1. Re: Increase performance of the script (Peter Otten) > 2. Re: Increase performance of the script (Steven D'Aprano) >3. Re: Increase performance of the script (Steven D'Aprano) > > > >

[Tutor] Re Module

2018-12-27 Thread Asad
('x', line, re.IGNORECASE) is not None: ===> Gives a wrong match print line Instead if I use : if re.search(x, line, re.IGNORECASE) is not None: then no match occurs print line Please advice where I going wrong or what can be done to make it better . Thanks, -- Asad Hasa

[Tutor] Log file for Nested if-elif

2019-01-02 Thread Asad
Hi All , Need advice on the following piece of code : with open(r"file1.log", 'r') as f: tail = deque(maxlen=8) # the last eight lines script = None for line in f: tail.append(line) if re.search('\?/patch/\d{8}/\d{8}/admin/load.sql',line,re.IGNORECASE): sc

[Tutor] Log file for to search in order

2019-01-11 Thread Asad
e one above other ? Thanks, > > -- Forwarded message -- > From: Asad > To: tutor@python.org > Cc: > Bcc: > Date: Wed, 2 Jan 2019 20:39:53 +0530 > Subject: [Tutor] Log file for Nested if-elif > Hi All , > > Need advice on the following piece of

[Tutor] python - files

2019-01-26 Thread Asad
Hi All , I would like to know how do I make and option file as an argument on command propmnt in python . At present I using : if len(sys.argv) == 3: first = sys.argv[1] second = sys.argv[2] else: print "enter the second argument" It works well for the following comman

Re: [Tutor] python-files

2019-01-27 Thread Asad
gs and parents methods. This is where I get > stuck > > with programming logic. BeautifulSoup does provide find_all method plus > > selectors which I do not want to use for this exercise. As I want to > learn > > how to walk a tree starting at the

[Tutor] Webinterface for python script

2019-01-30 Thread Asad
Hi All , I have created certain python scripts to analyze log files and suggest solution based on logic which I invoke on the command line . I need some information on how to execute these through browser . I am using : python test.py file1 file2 How do I use the browser to upload the

[Tutor] Visual studio Code -Python

2019-02-17 Thread Asad
Hi All , I am using Visual Studio Code for Python . However I was using the debug option F5 i see it list the variables in my program neatly ,I set breakpoints it stops there but I am unable to preview each line of the execution of the code . Thanks, -- _

Re: [Tutor] Visual studio Code -Python

2019-02-23 Thread Asad
) = 2500 therefore I need to press n 2500 time so that the loop completes and goes to another line of code . Any suggestions? how can run the for loop without doing n for 2500 times ? Thanks, On Sun, Feb 17, 2019 at 8:58 PM Mats Wichmann wrote: > On 2/17/19 1:50 AM, Asad wrote: > &g

[Tutor] How to create a structure from a Log file

2019-03-09 Thread Asad
Hi All , I would like to know , how can I approach this problem to create a easy structure from the logfile using python so I can review the logfiles quite efficiently . Please share suggestion tip or already written codes. Thanks, ___ Tuto

Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Asad
Hi All , Please a sample logfile [main] [ 2019-01-21 10:13:14.041 CET ] [AssistantLogHandler.configureLogging:176] Begin tracing.. INFO: Jan 21, 2019 10:13:14 AM oracle.assistants.dbua.driver.UpgradeDriver configureLogging INFO: Loading upgrade driver, DBUA running in mode : NONE DBUA

Re: [Tutor] How to create a structure from a Log file

2019-03-11 Thread Asad
l be sufficient > to guide you > -- Asad Hasan +91 9582111698 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How to store output of Python program in XML

2019-07-13 Thread Asad
Hi All , I written a python script which opens a logfile and searches for error and based or error found it prints a solution to screen , instead I want to print the output of the script in a xml file so that I can add some tags . How can it be done ? Thanks, -- Asad Hasan +91