This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!

itsbinsha sha

Greenhorn
+ Follow
since Oct 28, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by itsbinsha sha

I am trying to implement a GUI app for graph plotting which should show graph as slideshow so that data can be visualized clearly for the users. Currently whole content of the file is read and plotted as a single figure,but I show to split the figure and show as slideshow ie first i want to plot first n set of data then next set likewise i wish  to plot till the end of the file.
I have text file contains data as:



What I have tried is:


Please help to fix this. I will be thankful,if anyone help me out there.
2 weeks ago
My input is
RFEQ1
 6.1
 5.1
 8.1
 2.1
RDAMP1
 6.1
 6.2
 4.2
 3.1

What I have tried is:

import re

fileName=input("Enter Input File Name: ")
f1=open(fileName,'r')
OutName=input("Enter Output File Name: ")
f4=open(OutName,"w")

class Calculate:
pFreqCount=0
pFreqFlag=0
def freqCal(self,string,freq):
       if (obj.pFreqCount <=3):
           print(string)
           val = float(string)
           res = val + freq
           string =str(res)+"\n"
           self.write(string)

       else:
           obj.write(string)
           obj.pFreqCount = 0
           obj.pFreqFlag = 0
       obj.pFreqCount += 1
def write(self,string):
       f4.write(string)
       
for line in f1.readlines():    
   string=line
   if re.match(r'PFREQ1', string):
       obj.write(string)
       obj.pFreqFlag = 1
   elif obj.pFreqFlag == 1:
       obj.freqCal(string,float(a[30][0]))

   elif re.match(r'RDAMP1', string):
       print(string)
   
   
   else:
       f4.write(string)


Here RDAMP1 is not printing after string search in file. Please help to solve this.Please help me with a code.






4 months ago
My input string from a file is

My required output should be

But Now my input is same as output .The last two zeroes under ANG string to be replaced as 100.0 and 0.3 respectively.Please help me to get the required output.

What I have tried:
4 months ago