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
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.
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
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:
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
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
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 :
> >
> &
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
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
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
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
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
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,
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
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
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 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
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.
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:
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)
>
>
>
>
('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
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
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
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
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
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
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,
--
_
)
= 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
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
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
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
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
32 matches
Mail list logo