Re: Fuzzy Lookups
Gregory Piñero ha scritto: : > If anyone would be kind enough to improve it I'd love to have these > features but I'm swamped this week! > > - MD5 checking for find exact matches regardless of name > - Put each set of duplicates in its own subfolder. Done? http://pyfdupes.sourceforge.net/ Bye, luca -- http://mail.python.org/mailman/listinfo/python-list
Re: Fuzzy Lookups
Gregory Piñero ha scritto: > Wow, that looks excellent. I'll definately try it out. I'm assuming > this is an existing project, e.g. you didn't write it after reading > this thread? Yes it is an existing projects of course ;) Right now I've no time to improve it. I hope that later this summer I will find the time to make file management much easier on the gui side and to split all the different algorithm in external plugins so anyone can add it's own and compare with the other already there. The main goal of my project was primarly the interest for the "similarity search". bye, luca -- http://mail.python.org/mailman/listinfo/python-list
Re: gelato - nvidia and python
On Jun 29, 5:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Did somebody worked with gelato from nvidia and python? > I have some C cod from books nvidia . > This is : > " > GelatoAPI *r = GelatoAPI::CreateRenderer(); > r->Camera ("main"); > ... API calls through r ... > r->Render ("main"); > delete r; // Finished with this renderer > " > the code for python i create is only this : > " > python > Python 2.5.2 (r252:60911, May 28 2008, 08:35:32) > [GCC 4.2.4 (Debian 4.2.4-1)] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> > import gelato > >>> from gelato import * > >>> r=gelato.CreateRenderer > >>> print r > > >>> dir(r) > > ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', > '__getattribute__', '__hash__', '__init__', '__module__', '__name__', > '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', > '__setattr__', '__str__'] > " > And I blocked here... > Thank you . Maybe you should execute the CreateRenderer, like r=gelato.CreateRenderer() dir(r) I don't have gelato but it might work.. -- http://mail.python.org/mailman/listinfo/python-list
pyparsing problem
Hi, I try to parse a file with pyparsing and get this output: ['generic', 'host-01', 'host alias xyz', '10.0.0.1'] - alias: host alias xyz - host_name: ['host-01'] - ip_address: ['10.0.0.1'] - use: ['generic'] generic host-01 host alias xyz 10.0.0.1 ['generic', 'host-01', 'host alias xyz', '10.0.0.1'] finished What I don't understand is why I get the line generic and not generic as there is an associated name in the dump() output. Thank you very much in advance for any clue or help you could provide. The code: - #!/usr/bin/env python from pyparsing import * sample = """ define host{ use generic host_name host-01 alias host alias xyz address 10.0.0.1 } """ # define tokens LBRACE,RBRACE = map(Suppress, '{}') ipAddress = Combine(Word(nums) + ('.' + Word(nums))*3) useTemplate = oneOf('generic user') # define grammar deviceName = Word(alphanums+'-') hostDef = Literal('define').suppress() + Literal('host').suppress() useLine = Suppress('use') + useTemplate + Suppress(SkipTo(lineEnd)) host_nameLine = Suppress('host_name') + deviceName + Suppress(SkipTo (lineEnd)) aliasLine = Suppress('alias') + SkipTo(lineEnd) aliasLine.setParseAction(lambda x: ' '.join(x[0].split())) ip_addressLine = Suppress('address') + ipAddress use = useLine.setResultsName('use') host_name = host_nameLine.setResultsName('host_name') alias = aliasLine.setResultsName('alias') ip_address = ip_addressLine.setResultsName('ip_address') host_stmt = (use + host_name + alias + ip_address) host = hostDef + LBRACE + host_stmt + RBRACE test_file = OneOrMore(host) + stringEnd # test x = test_file.parseString(sample) print x.dump() print print x.asXML('Hosts') print print x.asList() print print 'finished' -- http://mail.python.org/mailman/listinfo/python-list
Re: pyparsing problem
Paul McGuire <[EMAIL PROTECTED]> wrote in news:be7af822-70d7-44fb-96fa- [EMAIL PROTECTED]: > > Looks like this is a bug in asXML(). Note that if I reverse the use > and host_name strings in the input and in your grammar, I get this XML > output: > > > host-01 > generic > host alias xyz > 10.0.0.1 > > > Fortunately, you have provided a nice short test case, which should > allow me to track down the problem. > > Thanks, > -- Paul > You are welcome! And I would like to thank you for this outstanding tool! Thanks, Bernhard -- http://mail.python.org/mailman/listinfo/python-list
Re: Why is there no GUI-tools like this for Windows?
It seems the video is showing glade, which is also available for wx under the name wxglade, I do not know whether it's available for Windows. I think it should work because it itself is written in Python. I personally prefer to code my GUI myself, so I can do looping stuff with it, but that is just me. -- http://mail.python.org/mailman/listinfo/python-list
Connection acception with confirmation
Hi, i'm new in Python and i'm trying to write some server which can confirm connection from client. Here is a part of code: import sys import threading from socket import * class TelGUI(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): s = socket(AF_INET, SOCK_STREAM) s.bind(('',8900)) s.listen(5) while 1: client,addr = s.accept() print addr print "Or u want to accept connection from this host? [y/n]" opt = sys.stdin.read(1) if opt == 'y': #establish else: s.close() #reject def main(): app = TelGUI() app.start() print "Menu" while 1: #some menu operations op = sys.stdin.read(1) if op == 'x': break if __name__ == "__main__": main() maybe someone have some ideas how to block first stdin in main function and get stdin from the thread when here is a new connection? Thanks -- http://mail.python.org/mailman/listinfo/python-list
web crawler in python
I'm currently planning on writing a web crawler in python but have a question as far as how I should design it. My goal is speed and maximum efficient use of the hardware\bandwidth I have available. As of now I have a Dual 2.4ghz xeon box, 4gb ram, 500gb sata and a 20mbps bandwidth cap (for now) . Running FreeBSD. What would be the best way to design the crawler? Using the thread module? Would I be able to max out this connection with the hardware listed above using python threads? Thank you kindly. -- http://mail.python.org/mailman/listinfo/python-list
Re: newbie qns : how do i use xmldiff?
I had to do some fishing around to figure this much out. Hope it helps. from input import * # From the xmldiff directory from fmes import * # From the xmldiff directory from format import *# From the xmldiff directory from StringIO import * # Build your original tree text1 = '123' stream1 = StringIO(text) tree1 = tree_from_stream(stream) # Build your modified tree text2 = '223' stream2 = StringIO(text2) tree2 = tree_from_stream(stream2) # Compare the trees formatter = InternalPrinter() corrector = FmesCorrector(formatter) corrector.process_trees(tree, tree2) ## OUTPUT: ## Instructions for modifying original to modified # [rename, /point[1]/y[1], x] # [insert-after, /point[1]/x[2], # # 2 # # ] # [remove, /point[1]/x[1]] > On Wednesday, February 03, 2010 1:38 AM sWrath swrath wrote: > Hi , > > I am pretty new to python , and reading up on it. > > Basically I am trying to compare xml files . I know difflib have it > but it does not work out as expected. I was looking at xmldiff , > unfortunately I am not able to find documentation how to call it from > python. Anyone knows a link or doc to it as I have been looking high > and low for few days? > > lastly , is there a py (or algorithm) where it behaves exactly like > diff ? Greatly appreciated. > > Thanks > john >> On Wednesday, February 03, 2010 3:34 PM Terry Reedy wrote: >> On 2/3/2010 1:38 AM, sWrath swrath wrote: >> >> When asking such a question, it is good to explain what sort of thing, >> in this case, 'xmldiff' is and where it is is from. Let us assume you >> meant xmldiff from >> >> http://www.logilab.org/859 >> >> It says it is a python tool that can "be used be used as a library or as >> a command line tool." It includes a README file. Have you read that? >> That says "USAGE ... Read the HELP.txt file.". Have you read *that*? >> HELP.txt seems to focus on command line usage. I would start with that. >> To use it as a library (via import ...), you might have to look at the >> source code as I did not see importing covered in my quick look at that >> file. >> >> Terry Jan Reedy >> Submitted via EggHeadCafe - Software Developer Portal of Choice >> FireAndForget Asynchronous Utility Class for SQL Server Inserts and Updates >> http://www.eggheadcafe.com/tutorials/aspnet/7a22d9a4-59fc-40b0-8337-75c76f14fb3b/fireandforget-asynchronous-utility-class-for-sql-server-inserts-and-updates.aspx -- http://mail.python.org/mailman/listinfo/python-list
FOREX : Foreign Exchange Market : FX : Currency Market : Earn Money Quickly.
FOREX : Foreign Exchange Market : FX : Currency Market : Earn Money Quickly. Simple Optimized Tips and Tricks, Basics of FOREX to be a king of FOREX in one day. Check out these exclusive never seen tips for free at http://forex-fx-currencymarket.blogspot.com/2010/02/forex-market-size-and-liquidity-showing.html Contents Overview : FOREX : Market Size and Liquidity Showing Top 10 Currency Traders FOREX : Speculation of Currency FOREX : Instruments Financially including Transactions FOREX : FX Rates Determinants as per Government FOREX : Trading Characteristics and Trading Centers FOREX : Market Participants with Access Levels -- http://mail.python.org/mailman/listinfo/python-list
file write question
I have written a script which: - opens a file - does what it needs to do, periodically writing to the file... for a few hours - then closes the file when it's done So my question is: Would it be better to 'open' and 'close' my file on each write cycle? e.g. def writeStuff(content): myFile = open('aFile.txt', 'a+') myFile.write(content) myFile.close() ... or just leave it till it's done? I don't need to use the file contents until the script is done (although it would be nice... just to check it while it's working), so just curious what people think is the better method. - rd -- http://mail.python.org/mailman/listinfo/python-list
Re: file write question
H - I am not familiar with flush(), will look into it. But an interesting note: I repeatedly and often start long running processes (one running right now: on about it's 14th hour), writing to open files, with few problems (on Mac OS X). Although of course I can't look at the results until the file closes...just have to hope it's right! LOL B - You are right about Sqlite, I'm a big fan (moved over from MySQL a few years ago). But the structure of the data for this project is much better suited to a 'flat file' format. Again, not that I am having problems, just thought I'd raise the topic. BTW PyCON is in Chicago this year (where I am), maybe I'll meet some of you there? RL -- http://mail.python.org/mailman/listinfo/python-list
Webhosting, Domain Name, Data Center Cyprus, Hosting Services
Webhosting – postcy - a leading web hosting company. We offer webhosting, domain name, hosting services, cyprus domain, domain names cyprus at affordable cost. for more details please contact : http://www.postcy.com/ -- http://mail.python.org/mailman/listinfo/python-list