On Sun, Nov 11, 2018 at 12:19:36PM +0530, Asad wrote:
> Hi All ,
>
> If I am loading a logfile what should I use from the option 1,2,3
Depends what you want to do. I assume that the log file is formatted
into lines of text, so you probably want to iterate over each line.
with
On 10/11/2018 18:10, Avi Gross wrote:
> WARNING to any that care:
>
> As the following letter is a repeat request without any hint they read the
> earlier comments here, I did a little searching and see very much the same
> request on another forum asking how to do this in MATLAB:
The OP has
On 11/11/2018 09:40, Steven D'Aprano wrote:
>> f3 = open ( r"/a/b/c/d/test/test_2814__2018_10_05_12_12_45/logA.log", 'r' )
>
> Don't use raw strings r"..." for pathnames.
Umm, Why not?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
On 11/11/2018 06:49, Asad wrote:
> Hi All ,
>
> If I am loading a logfile what should I use from the option 1,2,3
>
> f3 = open ( r"/a/b/c/d/test/test_2814__2018_10_05_12_12_45/logA.log", 'r' )
>
> 1) should only iterate over f3
This is best for processing line by line which is the
Hi All ,
If I am loading a logfile what should I use from the option 1,2,3
f3 = open ( r"/a/b/c/d/test/test_2814__2018_10_05_12_12_45/logA.log", 'r' )
1) should only iterate over f3
2) st = f3.read()
Should iterate over st
3) st1 = f3.readlines()
Should iterate over st1
How are
On 11/11/2018 10:04, Asad wrote:
> 1) and I want to extract the start time , error number and end
> time from this logfile so in this case what should I use I guess option 1 :
>
> with open(filename, 'r') as f:
> for line in f:
> process(line)
Yes, that woyuld be the best
After my earlier message (snipped out for space savings) focused on choosing
among various methods to retain a buffer of recent lines from a file, I
realized that for many, the best method is simply to import a solution others
have created, often in the form of an object. Many of the methods I
tokenAmount = input( "How many tokens would you like to buy or cash in?: ")
print (tokenAmount)
def buy ():
if tokenAmount <= 400:
buy = tokenAmount * .2099
print( " You would like to spend $"+(buy) + "on" + (tokenAmount) +
"tokens.")
elif tokenAmount > "400" <=
Peter,
Appreciated. I wrote something like this in another message before reading
yours. Indeed one of the things I found was the deque class in the
collections module.
But I was not immediately clear on whether that would be directly
applicable. Their maximum sounded like if you exceeded it,
On Sun, Nov 11, 2018 at 03:00:00PM -0800, Stealth Fleet wrote:
[...]
> tokenAmount works but the buy and cashIn are not being ran why?
You define the function, but never call it. Functions aren't called
automatically.
py> def example():
... print("calling example")
...
py>
py> # nothing is
Alan and others have answered the questions posed and what I am asking now
is to look at the function he proposed to keep track of the last five lines.
There is nothing wrong with it but I wonder what alternatives people would
prefer. His code is made for exactly 5 lines to be buffered and is
Avi Gross wrote:
> Alan and others have answered the questions posed and what I am asking now
> is to look at the function he proposed to keep track of the last five
> lines.
>
> There is nothing wrong with it but I wonder what alternatives people would
> prefer. His code is made for exactly 5
12 matches
Mail list logo