Re: Readlines() into an array Programming Software Development by jlm699 …def parseline(input,start,stop): my_numbers = [] for line in input.readlines(): if ":" in line: line = line[start:stop]…def parseline(input,start,stop): my_numbers = [] for line in input.readlines(): if ":" in line: line = line[start:stop] … Readlines() into an array Programming Software Development by Linky … wrote: def parseline(input,start,stop): for line in input.readlines(): if ":" in line: line = line[start:stop] print…. I'm just stumped. Anyone know how to take the readlines() blob and split it up into an array? -Link i used read() and readlines() but format is not the same ?? Programming Software Development by moroccanplaya is there a way to keep the format of a html source code for example when you view a source code of a website, is there anyway to keep the same structure, i have tried using read() readlines() i tried saving the source code then opening it up in my program and still failed to keep the same format, is there anyway around this problem ?? Re: Readlines() into an array Programming Software Development by Linky That works quite well and thank you. I didn't realize that it was already in an array (the "[") at the beggining and end of the string should have tipped me off! I will definately enable Code Tags in all future threads and tell Crimson to stop tabbing and start 4-spacing. -Regards, Link Re: Beginner Help to readlines and writelines Programming Software Development by neely615 … a list f = open( '*.txt', "r" ) data_list = f.readlines() f.close() # remove list items, x>1569 and x… help...i want to call a f'n that returns a string... Programming Software Development by callie_360 …; <PageTag `Disclaimers'>"] class readLines: lineNumber = 0 #initializing line number line …lines = theFile.readlines() readLines = readLines(line,lines,lineNumber) testLine = readLines isPageValid = isPageValid(testLine,validPages) #_____readLines_____________ def readLines(line,lines,… Re: Array to .txt file Programming Software Development by Jennifer84 …Name1 = textBox3->Text; System::String ^ Name2 = ReadLines[0]; String^ path = "c:\\MyTest.txt"…->Lines->Length; count++) { File.WriteLine(ReadLines[count]); } [/code] [QUOTE=Jennifer84;535766]I …= textBox3->Text; System::String ^ Name2 = ReadLines[0]; StreamWriter File = gcnew FileStream("C:\\Sample.… Can't use fileHandle.readline()? and input into class? Programming Software Development by franziss … line[9:15].strip() print eigenval for line in fileHandle.readlines(): if (line[0:5].strip() == '****'): break vecCount2 =…= open (fileNmaVec, 'r') eigenvecList = [] for line in fileHandle.readlines(): if (line[0:5].strip() == '****'): eigenvecList.append('****') #indicate a… Re: help...i want to call a f'n that returns a string... Programming Software Development by woooee And apparently a variable as well readLines = readLines(line,lines,lineNumber) isPageValid = isPageValid(testLine,validPages) Try this instead[… First Python project. Command line show database. Programming Software Development by John A. …quot;, "r+") for line in data_file.readlines(): data_list = line.split("|") for arg in…"r+") total_entries = 0 for line in data_file.readlines(): data_list = line.split("|") print data_list[0]… Re: Quick C++ Random Access..I think question Programming Software Development by Crucial …file.getline(input, SIZE); } file.close(); } int readLines(fstream &file) { const int SIZE = 81; …endl; return 0; } int uselessLines = totalLines-10; int readLines = totalLines- uselessLines; cout << "useless:… Array to .txt file Programming Software Development by Jennifer84 …textBox3. [code] array<System::String^>^ ReadLines = gcnew array<System::String^> ( textBox2…->Lines->Length ); ReadLines = textBox2->Lines; System::String ^ Name1 = textBox3…->Text; System::String ^ Name2 = ReadLines[0]; StreamWriter File = gcnew FileStream("C:\\Sample.txt… Comparing two files line by line Programming Software Development by chavanak …splitter): fhandle_6 =open (i, "r") from_pd = fhandle_6.readlines() from_pd = map(string.strip,from_pd) fhandle_6.close() fhandle_13 = open(s…[0]+".cr", 'r') fhandle_13_l = fhandle_13.readlines() fhandle_13_l = map(string.strip, fhandle_13_l) fhandle_13.close() fopen_7=open (i… Macro, need help Programming Software Development by ffs82defxp …;) randomEntry1 = random.choice(WordList.readlines()) randomEntry2 = random.choice(WordList.readlines()) randomEntry3 = random.choice(WordList.readlines()) randomEntry4 = random.choice(WordList.readlines()) WordList.close() startLink() def… create functions in python Programming Software Development by sofia85 …', 'r') newfile=('file_name1', 'w') for lines in f.readlines(): if 'number' in lines: do some stuff and save…w') for lines in f2.readlines(): f3=open('filename3', 'r') for data in f3.readlines(): if lines.split('\t')[0]…in program 2 newfile=('value_file','w') for lines in f5.readlines(): f6= open('filename6', 'r') for data in 'filename6… Re: create functions in python Programming Software Development by sofia85 …", "r") for lines in f.readlines(): if ('a_name=' in lines) and ('a_nr' in…quot;, "r") for lines in f2.readlines(): if a_nr in lines: return lines def fcn3… rows and n cols for data in f3.readlines(): if f2[1] in data: return that… Re: create functions in python Programming Software Development by Gribouillis …quot;, "r") for lines in f.readlines(): if ('a_name=' in lines) and ('a_nr' in…;, "r") for lines in f2.readlines(): if a_nr in lines: return lines def fcn3…rows and n cols for data in f3.readlines(): if f2[1] in data: return … Re: For loops acting weird Programming Software Development by woooee …over again, so after the first pass, g.readlines() does nothing. Instead, I think it is…() loop. [CODE] for line in f.readlines(): for ln in g.readlines(): # #---------- replace with g_data=open(self.dcmdir…+"/DOPEN/extlib.ded",'r').readlines() f_data=open(self.dcmdir+"/DOPEN/dwnext.… Re: create functions in python Programming Software Development by woooee … 1 newfile=('file_name2', 'w') f3_data=open(filename3. 'r').readlines() for lines in f2.readlines(): # f3=open('filename3', 'r') for data in f3_data…('\t')[0] in datat: write to new_file # f3.close() ## open + readlines on one line does this for you f2.close() new_file… Re: create functions in python Programming Software Development by woooee You would use readlines() to read the file into a list, process the list … return res3 """ #test_data = open(filename1, 'r').readlines() ## simulate open and readlines test_data = [ '1\n', '2\n', '3\n', '4… Re: Get recurring top 3 Programming Software Development by Decode098 … open("Students.txt",'r') raw = fob.readlines() name = raw_input("Student Name: ") grade…sort(self): read = open('students.txt','a+') readlines = read.readlines() if readlines == []: print 'No Student Record' else: … Re: Get recurring top 3 Programming Software Development by Decode098 … open("Students.txt",'r') raw = fob.readlines() name = raw_input("Student Name: ") grade…sort(self): read = open('students.txt','a+') readlines = read.readlines() if readlines == []: print 'No Student Record' else: … I cant find what is wrong in this code Programming Software Development by Jennifer84 …quot;") { array<System::String^>^ ReadLines = gcnew array<System::String^> ( …textBox1->Lines->Length ); ReadLines = textBox1->Lines; std::string Line1;… textBox1->Lines->Length; count++) { MarshalString(ReadLines[count], Line1); Line2 = Line1.c_str(); std::transform(… Problem with array of pointers Programming Software Development by brimble2010 …" char *strings[50]; void readLines(void); void printLines(void); int main() { readLines(); printLines(); return 0; } void readLines(void) { FILE *inputFilePtr; inputFilePtr = fopen… Re: Problem with array of pointers Programming Software Development by brimble2010 …> #include <string.h> char *strings[50]; void readLines(void); void sortLines(void); void swapLines(int j, int k…); void printLines(void); int main() { readLines(); sortLines(); printLines(); return 0; } void readLines(void) { FILE *inputFilePtr; inputFilePtr = fopen("bubble… Re: Why do I get different values for the same variable? Programming Software Development by Gribouillis …position is at the beginning of the file, but after readlines(), the position is at the end of the file.…f.tell() # get the current position >>> f.readlines() # read the whole file >>> f.seek(beginning…the beginning >>> f.readlines() # should produce the same result as the first readlines() [/code] in principle, seek … Re: I can't run my script..Assignment for class. Programming Software Development by pythonnewbie1 …Enter a name")) except: def _init_(names): any_listnames=(NAMES.readlines.sort()) any_listnames.writelines(NAMES.title()) NAMESfile=open("NAMES.txt… a name")) except: def _init_(names): any_listnames=(NAMES.readlines.sort()) any_listnames.writelines(NAMES.title()) NAMESfile=open("NAMES.txt… python cgi Programming Software Development by iliketacos … def getpostcount(): f=open('C:/commentlog.txt', 'r') a=f.readlines() f.close() i=0 for line in a: if line… def getposts(): f=open('C:/commentlog.txt', 'r') a=f.readlines() f.close() b=parseposts(a) return b def postit(): a… Re: python cgi Programming Software Development by iliketacos … def getpostcount(): f=open('C:/commentlog.txt', 'r') a=f.readlines() f.close() i=0 for line in a: if line… def getposts(): f=open('C:/commentlog.txt', 'r') a=f.readlines() f.close() b=parseposts(a) return b def postit(): a… urllib2 problem Programming Software Development by leegeorg07 …(i) permlist.append(str(url.urlopen(temp).readlines()[88])) textlist.append(str(url.urlopen(temp).readlines()[77])) for i in permlist: i…, in <module> permlist.append(str(url.urlopen(temp).readlines()[88])) File "C:\Python26\lib\urllib2.py", line…