225 Posted Topics

Member Avatar for Pinchanzee

This simple solution will work for all files on the current dir. [CODE]import os filelist = os.listdir('') for files in filelist: basename, ext = os.path.splitext(files) if ext == '.kml': f_output = open('%s-errors.txt' % basename, 'w') f_output.write('whatever you want') f_output.close()[/CODE] Cheers and Happy coding

Member Avatar for Pinchanzee
0
571
Member Avatar for koveras vehcna
Member Avatar for griswolf
0
256
Member Avatar for JDuch
Member Avatar for dlannetts

I think that definatelly it's a bad version installed. Try to redownload and install the proper ones. Cheers and Happy coding

Member Avatar for dlannetts
0
495
Member Avatar for acrocephalus
Member Avatar for acrocephalus
0
166
Member Avatar for acrocephalus

By your error message it appears that your values are being correctly extracted from the controls,. The problem relys elsewhere I believe.

Member Avatar for griswolf
0
211
Member Avatar for Tarkenfire

Mate, I believe that all you need to do, it's to use my example of timer, and use it to call the function to voice, instead of the threading being the voice function, the thread will calll the object voice after that time. Hope is clear enough. Cheers and Happy …

Member Avatar for Tarkenfire
0
229
Member Avatar for stompper33

If i understood correctly: [CODE]initial_date = '9/14/1990' initial_month, initial_day, initial_year = initial_date.split('/') final_date = '9/17/1990' final_month, final_day, final_year = final_date.split('/') f_in = open('stations_temp.csv').readlines() f_out = open('filtered_stations_temp.csv', 'w') f_out.write(f_in[0]) for i in range(1, len(f_in)): station, date, max_temp, min_temp = f_in[i].split(',') month, day, year = date.split('/') if initial_month <= month <= final_month …

Member Avatar for Beat_Slayer
0
3K
Member Avatar for john125

Some code and a clear explanation of the problem you have would help. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
2K
Member Avatar for Sky Choi

Probably beacuse uou only have 239 lines, and are cycling the variable that use as index to a higher number then the elements of the list. You should count the elements and cycle between that counting. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
228
Member Avatar for acrocephalus

Something like this: [CODE]app = wx.App(redirect=True)[/CODE] and wx does the rest. Cheers and Happy coding.

Member Avatar for TrustyTony
0
866
Member Avatar for lewashby

The 'blit' loads a image object to the window surface. In your example 'blit' loads the 'background' image to the window starting at cordinates 0 in x and 0 in y. [CODE]screen.blit(background, (0, 0))[/CODE] The second 'blit' loads the 'sprite' image to the screen, with a fixed cordinate of 100 …

Member Avatar for lewashby
0
837
Member Avatar for Krstevski

I don't get the previous link. May you take a look here, fell free to ask, or PM with sugestions. [URL="http://www.daniweb.com/code/snippet304075.html"]Texts K-Nearest Neighbor (KNN) using the Euclidean algorithm[/URL]

Member Avatar for Krstevski
0
114
Member Avatar for kadvar
Member Avatar for kadvar
0
139
Member Avatar for parijat24

Seem's easy. Can you post the file? The text pasted on the thread normally does'n keep all the text characteristics. Cheers and Happy coding.

Member Avatar for parijat24
0
135
Member Avatar for emchom

You just need to now how much lotion you need sy square centimeter and apply to that surface. But first, what is suposed that number to do? [CODE]def main(): '''program to determine a persons surface area''' height = float (raw_input ("How tall are you (cms?) ? ")) weight = float …

Member Avatar for Beat_Slayer
0
212
Member Avatar for emchom

Like this maybe. The list and sorting it makes it easy. [CODE]def main(): diverName = raw_input('Enter divers name: ') degreeOfDifficulty = input('Enter degree of difficulty: ') scoreList = [] for scoreCounter in range(1, 8): scoreList.append(input('Enter score %s: ' % scoreCounter)) sortedScores = sorted(scoreList) print '\nhighscore = %s\nlowscore = %s' % …

Member Avatar for Beat_Slayer
0
1K
Member Avatar for student_

It's a typo. Your missing a d here. [CODE]elif option == 2: remove[COLOR="Red"][B]d[/B][/COLOR]Expence = removeExpence(totalBudget) totalBudget = totalBudget + removedExpence printOptions() option = input("What would you like to do? ")[/CODE]

Member Avatar for student_
0
149
Member Avatar for ultimatebuster

[URL="https://www.packtpub.com/expert-python-programming/book"]Expert Python Programming[/URL] [URL="http://www.qtrac.eu/pyqtbook.html"]Rapid GUI Programming with Python and Qt[/URL] My choices would go on this ones. I would choose others if iw was game related or advanced debugging. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
168
Member Avatar for PythonNewbie2
Member Avatar for trakyng

Sorry but all I can say is: You must be kidding! Not a litle effort, just a line question? Cheers and Happy coding

Member Avatar for trakyng
0
86
Member Avatar for ak_barik

[URL="http://www.secdev.org/projects/scapy/doc/installation.html#windows"]You must begin here.[/URL]

Member Avatar for Beat_Slayer
0
449
Member Avatar for flebber

I never went, but with some sample xml and some code effort, you may get someone attracted to the conversation. Cheers and Happy coding.

Member Avatar for Beat_Slayer
0
94
Member Avatar for Beat_Slayer

Aproach to the implementation of K-Nearest Neighbor (KNN) using the Euclidean algorithm. Sample Usage: [CODE]mywork = Words_Works() lit = 'literature.txt' mywork.add_category(lit, 'Literature') # adding files as category comp = 'computers.txt' mywork.add_category(comp, 'Computers') phy = 'physics.txt' mywork.add_category(phy, 'Physics') # saving categories dictionary to file mywork.save_categories() # can be loaded calling load_categories() …

Member Avatar for Beat_Slayer
0
795
Member Avatar for student_

Something like this. [CODE]name = [] ordertotal = [] for i in range(loopController): name.append(raw_input("Who's order")) order = input("How much was the order") ordertotal.append(order + shippingCharge) for i in range(loopController): print name[i], ordertotal[i][/CODE]

Member Avatar for vegaseat
0
291
Member Avatar for nekogda

I don't know if it is this function but this should work. [CODE]from scipy.special import kv[/CODE] Happy coding

Member Avatar for nekogda
0
211
Member Avatar for Tarkenfire

Create function to voice users and run the function using the timer, instead of passing commands to the timer function.

Member Avatar for Tarkenfire
0
216
Member Avatar for pythonbegin

Can you provide a sample file. Your sample doesn't even have the GE. I changed the second BS tag to GE. [CODE]f_in = open('blocks.txt').read() f_out = open('output.csv', 'w') f_out.write('AC\tID\tFA\tOS\tSF\tBS\tGE\n') blocks = [x for x in f_in.split('//') if x] for item in blocks: infos = [x for x in item.split('\n') if …

Member Avatar for pythonbegin
0
1K
Member Avatar for PythonNewbie2

Some search [URL="http://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/"]and...[/URL] Post if you get stuck later. :) Cheers and Happy coding

Member Avatar for Beat_Slayer
0
98
Member Avatar for sandhya1202

Maybe like this? [CODE]import string def RemovePunc(text_input): line = [] i = 0 total_text_input = "" #This part removes the punctuation and converts input text to lowercase new_char_string = "" for char in text_input: if char in string.punctuation: char = " " new_char_string = new_char_string + char line = line …

Member Avatar for Beat_Slayer
0
639
Member Avatar for PythonNewbie2

I use cx_freeze on win32 without minimum problem. Have you tried this? [URL="http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html"]py2app - Create standalone Mac OS X applications with Python[/URL] Happy coding

Member Avatar for Beat_Slayer
0
193
Member Avatar for andrewtrench
Member Avatar for eldeingles

lol How about some search? I've written something easilly adjustable for some user something like one week ago. [URL="http://www.daniweb.com/forums/thread300520.html"]Finding string instance in file - replace bytes after it[/URL]

Member Avatar for TrustyTony
0
323
Member Avatar for sebcbien

With a simple hex editor you can see that the GIMP file headers are completely different. Cheers and happy coding

Member Avatar for sebcbien
0
408
Member Avatar for Tommymac501

[CODE]import os os.system(r'C:\dtexec /f "PACKAGENAME.dtsx"')[/CODE] Cheers and Happy codding

Member Avatar for Beat_Slayer
0
573
Member Avatar for jop-pop

[QUOTE]If the submitted form data contains more than one field with the same name, the object retrieved by form[key] is not a FieldStorage or MiniFieldStorage instance but a list of such instances. Similarly, in this situation, form.getvalue(key) would return a list of strings. If you expect this possibility (when your …

Member Avatar for Beat_Slayer
0
452
Member Avatar for Fearx351

I don't really understand the context but... [CODE]def high_Priority(): ## print'' import shelve file_sizeh = file_size * week_selec db = shelve.open("netback.dat") db['hremspace'] = h_back if h_back > 0: print'There are ',db['hremspace'],' Mb's left in High priority storage' print'after your backup of ',file_sizeh,' Mb's' db['hremspace'] = h_back db['netback'] = back_name db['Highprofile'] …

Member Avatar for Fearx351
0
143
Member Avatar for Musing888
Member Avatar for Simplified

Like this? [CODE]def periodic(): global t print "Tic-Tac" t = threading.Timer(2, periodic) t.start() t = threading.Timer(2, periodic) t.start()[/CODE] Happy coding

Member Avatar for Simplified
0
96
Member Avatar for Ultralisk

Like this? [CODE]totalRows = int(raw_input ("Please enter a number: ")) for currentRow in range(1, totalRows + 1): print '* ' * currentRow print for currentRow in reversed(range(1, totalRows + 1)): print '* ' * currentRow[/CODE]

Member Avatar for Ultralisk
0
118
Member Avatar for Beat_Slayer

ITunes Library Persistent ID Editor. Sample usage: [CODE]fxml = 'iTunes Music Library.xml' # path to xml file fitl = 'iTunes Library.itl' # path to itl file itk = ITunesLibKeys(fxml, fitl) print itk.file_xml # prints path to xml file print itk.file_itl # prints path to itl file print itk.xml_key # prints …

0
1K
Member Avatar for rahul8590
Member Avatar for anurag.kyal

[CODE]import os import signal processname = 'sysproc' for line in os.popen('ps xa'): if processname in line.split()[4]: os.kill(int(line.split()[0]), signal.SIGHUP)[/CODE]

Member Avatar for jcao219
0
159
Member Avatar for deeapk_kapdi

It's like this you must do it on your terminal window like this: [CODE]python /Users/Home/Desktop/Programs/test2.py[/CODE] or just by the scipt name if you add the shebang: [CODE]#!/usr/bin/python[/CODE] to the first line of your script. Happy coding! Cheers

Member Avatar for TrustyTony
0
9K
Member Avatar for jenzilla

And the code? I can't see it. lol :) [CODE]f_score = open ('score.txt') old_score = int(f_score.readlines()[0]) f_score.close() score = 80 print old_score if score > old_score: f_score = open ('score.txt', 'w') f_score.write('%s' % score) f_score.close()[/CODE]

Member Avatar for Beat_Slayer
0
4K
Member Avatar for teddypwns

You must return the value from the recursive function. [CODE]def function(depth): if depth > 0: return function(depth - 1) else: return 10 function(5)[/CODE] EDIT: Sorry, was testing it while it was answered.

Member Avatar for ultimatebuster
0
11K
Member Avatar for PythonNewbie2

I'm sorry but I'm going to redirect you. lol [URL="http://www.xml.com/pub/a/2003/02/12/py-xml.html"]I believe this is the right point to redirect you.[/URL]

Member Avatar for Beat_Slayer
0
186
Member Avatar for newyawk
Member Avatar for woooee
0
179
Member Avatar for gonzigg

Gribouillis said it all. There is no reason for repeating code when it can be reused.

Member Avatar for tbone2sk
0
343
Member Avatar for Musing888

Here it is. [CODE]import warnings def maxgen(fname, worksheet=1,encoding='cp1251'): warnings.filterwarnings('ignore') from pyExcelerator import * warnings.filterwarnings('always')[/CODE] Happy coding...

Member Avatar for Musing888
0
1K

The End.