225 Posted Topics

Member Avatar for rahul8590

It can be just me, but it seems something is wrong! Can you explain a little further. You want to know the words that exist in the two files, is that it? Or do you want to count the ocurrences in each file?

Member Avatar for ultimatebuster
0
262
Member Avatar for personx1212

I believe it's a simple path problem, since they are common on win. Try to create a shortcut for the application, setting the 'start in' option to that folder.

Member Avatar for snippsat
0
156
Member Avatar for richman_tck

[URL="http://www.daniweb.com/forums/thread88479.html"]Look here![/URL] A little search helps. ;) Happy coding!

Member Avatar for richman_tck
0
432
Member Avatar for Tcll

[URL="http://docs.python.org/library/stdtypes.html?highlight=partition#str.partition"]Partition![/URL]

Member Avatar for Tcll
0
104
Member Avatar for darknessamman

Can you try this? [CODE]body = {'user': user, 'pswd': passo, 'submit.x': '39', 'submit.y': '7'}[/CODE]

Member Avatar for darknessamman
0
135
Member Avatar for pendo19

This should give you some insight! [CODE]import csv for row in csv.reader(open('timeline1.csv', 'r')): match = None for item in row: if item.find('.ie/') != -1: match = True if match: print 'Highlighted ->>', row else: print row[/CODE] I'm not a tk programmer, but: [CODE]def searchfilt(self): f = open("timeline1.csv", "r") reader = …

Member Avatar for TrustyTony
0
242
Member Avatar for kametolearn

[CODE]f = open('filename.rc') old_rc = f.readlines() f.close() host = 'PARTYHOST' new_ip = '127.0.0.1' f = open('filename.rc', 'w') for i in range(len(old_rc)): if old_rc[i].find(host) != -1: f.write('%s %s\n' % (host, new_ip)) #You should check the newline else: f.write(old_rc[i]) f.close()[/CODE]

Member Avatar for Beat_Slayer
0
360
Member Avatar for pythonbegin
Member Avatar for gishi

[URL="http://www.linuxjournal.com/content/convert-spreadsheets-csv-files-python-and-pyuno-part-2"]Some insights[/URL], and [URL="http://gis.utah.gov/code-python/python-convert-ms-excel-to-csv"]some more[/URL]! Hope it helps! Happy coding!

Member Avatar for gishi
0
623
Member Avatar for LRNPHP

Like this? [CODE]if(empty($veh_img) AND empty($disk_img)){ $galpic="image.gif"; }else{ $galpic="$disk_img"; }[/CODE]

Member Avatar for LRNPHP
0
124
Member Avatar for abcdr

[CODE]def squareEach(nums): squares=[] for number in nums: squares += [number * number] return squares[/CODE]

Member Avatar for TrustyTony
0
451
Member Avatar for idane

[CODE]if(!strcmp($row['dtFirstContactSt'], '0000-00-00') AND !strcmp($row['dtMarketingSt'], '0000-00-00')) { echo "<td width='156'>" . "&nbsp </td>"; } else { echo "<td bgcolor=FF0000 width='156'>" .$row['dtFirstContactSt']. "</td>"; }[/CODE]

Member Avatar for idane
0
884
Member Avatar for bpatt22
Member Avatar for acrocephalus
Member Avatar for acrocephalus
0
130
Member Avatar for Tommymac501

Have you tried like this? [CODE]r = csv.reader(open('v20100515.csv', 'rb'))[/CODE] EDIT: Sorry i began the reply and went eat some sandwich, finnished when I came, and there were already all this ones posted, but I didn't saw them.

Member Avatar for Tommymac501
0
2K
Member Avatar for kate2mba

[CODE]from random import randint color = (randint(0, 255), randint(0, 255), randint(0, 255))[/CODE]

Member Avatar for Beat_Slayer
0
114
Member Avatar for java_programmer

Maybe like this. [CODE]str1 = "Hello Monty Python!" str2 = str1.replace('M', 'Spam') str3 = str2.replace('P', 'Spam') def print_str(str1, str2, str3): print(str1) print(str2) print(str3) print_str()[/CODE] or [CODE]str1 = "Hello Monty Python!" str2 = str1.replace('M', 'Spam') str3 = str2.replace('P', 'Spam') print('%s\n%s\n%s' % (str1, str2, str3))[/CODE]

Member Avatar for TrustyTony
0
363
Member Avatar for acrocephalus

You can do a select first to see if it exits, and delete thereafter if exists, or give error message if it doesn't.

Member Avatar for gunbuster363
0
118
Member Avatar for wolfeater017

I guess it is [CODE]windowSurface.blit(pi, 25, 25) or windowSurface.blit(pi, (25, 25))[/CODE] but i never used pygame.

Member Avatar for vegaseat
0
2K
Member Avatar for basgen

You need to find a way to simulate a pressed key. I have a key simulator somewhere. I'll search and say something when I get home.

Member Avatar for basgen
0
117
Member Avatar for gunbuster363

The concept is the same as in this [URL="http://www.daniweb.com/code/snippet278635.html"]Tech B snippet[/URL]. Give it a try, Happy coding.

Member Avatar for gunbuster363
0
682
Member Avatar for SoulMazer

Can you show, or at lest say wich type of server you implemented? You can use the sockets as files, passing and reading from them the coordinates.

Member Avatar for ultimatebuster
0
140
Member Avatar for wolfeater017

[QUOTE]Assuming you have a script called hello.py which you want to turn into an executable, this can be accomplished by this command: cxfreeze hello.py --target-dir dist[/QUOTE] [URL="http://cx-freeze.sourceforge.net/cx_Freeze.html"]Source[/URL] You must run the cx_freeze script to modify your script, you don't include or import cx_freeze on your scripts. The info you misunderstood, …

Member Avatar for wolfeater017
0
1K
Member Avatar for matto.g1456

Do a litle search on the forum, theres a lot of CSV search and modify examples. Write a tryout, and post the results, with input files and desired output. Happy coding

Member Avatar for TrustyTony
-1
127
Member Avatar for gunbuster363
Member Avatar for gunbuster363
0
110
Member Avatar for wolfeater017

The working file, is the file wich you are processing. The one that you create or open, and read or write to it.

Member Avatar for vegaseat
0
138
Member Avatar for ganeshredcobra

Just take the break out, and it will read all lines, indicating all errored ones.

Member Avatar for TrustyTony
0
149
Member Avatar for NewbieXcellence

Have you tried withou using the ie.PollWhileBusy() calls? Every example I saw doesn't use it, like the example in the module documentation: [CODE] import IEC ie = IEC.IEController() # Creates a new IE Window ie.Navigate('http://www.google.com/') # Navigate to a website. html = ie.GetDocumentHTML() # Get the HTML [/CODE] and it …

Member Avatar for NewbieXcellence
0
337
Member Avatar for wolfeater017
Member Avatar for Beat_Slayer
0
200
Member Avatar for acrocephalus

Something like this can do it also: [CODE]overwrite = None print w.fill('WIP will create Backup, Resized and Watermarked folders to store the original, resized and watermarked pictures. It will overwrite them if they already exists. Are you sure you want to continue (y/n)?') While overwrite.lower() != 'n' and overwrite.lower() != …

Member Avatar for TrustyTony
0
141
Member Avatar for acrocephalus

You can if you calculate the factor of the resize, and use it to calculate the other dimension. I think thats the only solution.

Member Avatar for Beat_Slayer
0
11K
Member Avatar for acrocephalus

This checks if the path exists, and if don't it creates it. [URL="http://docs.python.org/library/os.path.html"]More info.[/URL] [CODE]if not os.path.exists('Backup'): os.mkdir('Backup') [/CODE]

Member Avatar for acrocephalus
0
402
Member Avatar for MrAlshahawy

It's like this, theres no python module for that, but you can write one using the Symbian C++ SDK API Plug-in package for S60 3rd Edition, Feature Pack 2 wich includes the Phone Client USSD API.

Member Avatar for Beat_Slayer
0
641
Member Avatar for echellwig
Member Avatar for ultimatebuster
0
198
Member Avatar for Dan08

About the cycle. [CODE]countries = open('languages/country.lang', 'r').readlines() for i in range (0, len(countries): vars()['A%s' % i + 1] = countries[i][/CODE]

Member Avatar for TrustyTony
0
185
Member Avatar for personx1212

You can create semaphores and work with locks. To me, if you tried all those possibilities. I think you just messing something.

Member Avatar for Beat_Slayer
0
207
Member Avatar for pancakelove

Can you explain what you mean with [QUOTE]I'm trying to do pretty much the same thing[/QUOTE] It's exactly the same code? Is it some adjusted version? Where is it? Can you post a logfile example? More info please. Happy coding!! :D

Member Avatar for woooee
0
96
Member Avatar for TrustyTony
Member Avatar for Carolus89

You should take a look at the [URL="http://docs.python.org/library/sys.html"]sys[/URL] module.

Member Avatar for Beat_Slayer
0
59
Member Avatar for vlady

Because of this line: [CODE]bin=2[/CODE] it should be something like: [CODE]bin_n = bin(2) r = bin_n ** n_input[/CODE]

Member Avatar for TrustyTony
0
173
Member Avatar for vello
Member Avatar for Tommymac501

I don't know much about OOP. But shouldn't it be like that. And about the replace, can you post the error message??? [CODE]import csv class MyDialect(csv.excel): self.lineterminator = "\n" # here csv.register_dialect("myDialect", MyDialect) cr = csv.reader(open("data.csv","rb"), dialect = "myDialect") cw = csv.writer(open("clean_data.csv", "wb")) crlf = '\r\n' for row in cr: …

Member Avatar for TrustyTony
0
11K
Member Avatar for funfullson
Member Avatar for WildBamaBoy

and wheres the code of that part where you type a folder name to see it's contents.

Member Avatar for WildBamaBoy
0
113
Member Avatar for parijat24

And how are those clusters. I see that you want to search for the value on the fisrt column of the first file, I just don't know what would be a valid match on the second one. A cluster that doesn't have some values, tat has some values uin some …

Member Avatar for Beat_Slayer
0
92
Member Avatar for Member 785010

you can search for the modules in the file search. It seems like a path problem.

Member Avatar for Beat_Slayer
0
148
Member Avatar for prashanth s j

Lazy simple mode. [CODE]f_in = open('output.txt').readlines() for line in f_in: if 'Currently active records' in line: _, _, _, active_records = line.split(' ') print active_records[/CODE]

Member Avatar for Beat_Slayer
0
104
Member Avatar for modalgvr
Member Avatar for TrustyTony
0
178
Member Avatar for kosco

Like this. [CODE]f_in = open('problem.txt').readlines() f_out = open('code_solution.txt', 'w') for line in f_in: filtered = [] data = line.rstrip('\n') [filtered.append(x) for x in data.split(' ')] count, numb1, numb2, name, letter = [x for x in filtered if x != ''] print count, numb1, numb2, name, letter # not needed for …

Member Avatar for vukman
0
286
Member Avatar for echellwig

Try this. You had unneeded brackets. [CODE]for i in range(int(P)): for j in range(int(A)): float(popdata[i][j])[/CODE]

Member Avatar for echellwig
0
576

The End.