enhanced map function

2011-03-11 Thread Patrick
is a constant at the first point, then it feeds constant value to all other iterable combinations. Any tip is appreciated. -Patrick. def Add (x,y): return x+y def Bmap(function, *args): num = 0 for iter in args[0:]: if num < len(iter):

Calling C++ Modules in Python

2011-03-11 Thread Patrick
pers again?). SWIG (It works by taking the declarations found in C/C++ header and using them to generate the wrapper code that scripting languages need to access the underlying C/C++ code). Thanks -Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ Modules in Python

2011-03-11 Thread Patrick
ers. Correct me if I am wrong. Cheers, -Patrick. On Mar 11, 4:32 pm, Sophie Sperner wrote: > Hi Patrick, > > I'm using SWIG in my project. C++ code is wrapped and can be used in > python as custom module. > You should create a swig module.i file to describe headers upon which &

Re: enhanced map function

2011-03-17 Thread Patrick
],4]; b = [1, [2, 3], 4,5] shortest: a will be adjusted to [1, [3, 4],4] b will be adjusted to [1, [2, 3],4] longest: a will be adjusted to [1, 2,[3, 4],4,4] b will be adjusted to [1, 1,[2, 3],4,5] As I said previously, the enhance_map function will only handle limited "unma

calculating download speed from .pcap file

2013-10-11 Thread patrick
hi, im looking for a way to calculate download speed for a http connection inside my .pcap file. but doing even a simple read with dpkt doesnt really work. import pcap, dpkt import socket pcapReader = dpkt.pcap.Reader(file("http-download.pcap")) for ts, data in pcapReader: print ts, len(d

Pickle virtual machines implemented in other languages?

2013-10-29 Thread Patrick
Hi Everyone I was just wondering if anyone had tried to implement a pickle virtual machine in another language? I was thinking that it might make for a nice little form of cross language IPC within a trusted environment. -- https://mail.python.org/mailman/listinfo/python-list

jack audio connection kit

2007-09-25 Thread patrick
hello everyone, is there a way to make python output audio in jack: http://jackaudio.org/ jack is the best audio solution for linux, mac and lately windows. i found 1 project called pyjack, but the author remove the software from his website. that would be neat! pat -- http://mail.python.

stopping a while True: with the keyboard

2007-09-25 Thread patrick
hi all, i am looking for a way to break a while True: when pressing "s" on my keyboard. how can i do this? pat -- http://mail.python.org/mailman/listinfo/python-list

Re: stopping a while True: with the keyboard

2007-09-25 Thread patrick
i don't want to quit my program only get out from a while True: also i want to use only 1 key like s. pat Benjamin wrote: > On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > >> hi all, >> >> i am looking for a way to break a while True: when pressi

Re: jack audio connection kit

2007-09-25 Thread patrick
found the perfect solution (for linux at least) : gstreamer! http://pygstdocs.berlios.de/ pat -- http://mail.python.org/mailman/listinfo/python-list

call for collaboration (python / freesound)

2007-09-30 Thread patrick
hi, i have an idea, who doesn't have? the technologies required: gtk+ glade gobject Queue threading gstreamer (GNonLin) config here's the result of my week-end trying to understand how it's working: http://www.workinprogress.ca/pd/freesound.png the idea is to make a

scraping with urllib2

2010-01-26 Thread Patrick
I'm trying to scrape the attached link for the price listed $99.99: http://bananarepublic.gap.com/browse/product.do?cid=41559&vid=1&pid=692392 I can see the price if I view the source(I even turned off java and javascript), but when I use urllib2, the price doesn't show up. Is there another libra

[JOB] Look for a Full Time Plone Developer

2013-06-06 Thread Patrick Waldo
Hi All, Please take a look at a new job opportunity for Python/Plone developers. Patrick Waldo, Project Manager Decernis <http://decernis.com/> *Job Description: Full Time Python/Plone Developer* We are looking for a highly motivated and self-reliant developer to work on systems buil

Upgrading Python with NumPy, SciPy and Mayavi in a Rocks 6.0 cluster

2013-01-13 Thread Patrick Haley
Hi, We are looking for some guidance in installing an upgraded Python on our cluster. Our cluster was installed with Rocks 6.0, is running CentOs 6.2, and has python-2.6.6, gcc-4.4.6. We would like to install an upgraded version of Python along with the following modules NumPy Scipy (which w

ctypes and twain_32.dll

2011-04-30 Thread Patrick Vrijlandt
f sending any arguments. Also, contrary to the .NET example, I cannot express that the DLL entrypoint has ordinal 1. Of course, I may be totally wrong! I'm hoping for your suggestions! TIA, Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes and twain_32.dll

2011-05-02 Thread Patrick Vrijlandt
ives a different response if it cannot find the requested DLL. Patrick -- http://mail.python.org/mailman/listinfo/python-list

Dealing with name clashes in pypi

2011-05-22 Thread Patrick Sabin
project under a different name in pypi than the actual project name? -- Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with name clashes in pypi

2011-05-23 Thread Patrick Sabin
On 2011-05-22 23:23, Terry Reedy wrote: On 5/22/2011 2:34 PM, Patrick Sabin wrote: I wanted to register my project (epdb) in pypi. Unfortunately there already exists a project with the same name. It is not possible for me to change the name of the project, because I used it in multiple writings

Compiling Python for iOS 11

2017-09-24 Thread Patrick Stinson
Has anyone successfully compiled python for iOS 11? I tried with 3.5.2 and 3.6.2 and got the following errors: turin:Python-3.6.2 patrick$ make Makefile:9845: warning: overriding commands for target `.obj/_pickle.o' Makefile:8855: warning: ignoring old commands for target `.obj/_pic

choice of web-framework

2017-10-22 Thread Patrick Vrijlandt
tive. Finally, for a new project, I would not like to be confined to Python 2.7. What are your ideas? Thanks in advance, -- Patrick -- https://mail.python.org/mailman/listinfo/python-list

Re: choice of web-framework

2017-10-22 Thread Patrick Vrijlandt
a provision for mistakes. The idea is much like the "revert" option that MoinMoin and other wikis provide. --Patrick -- https://mail.python.org/mailman/listinfo/python-list

Python/New/Learn

2022-05-04 Thread Patrick 0511
Hello, I'm completely new here and don't know anything about python. Can someone tell me how best to start? So what things should I learn first? -- https://mail.python.org/mailman/listinfo/python-list

pygame.midi input/output not working

2022-12-21 Thread Patrick EGLOFF
stop execution : my_input = pygame.midi.Input(MidiDeviceIn) midi_out = pygame.midi.Output(MidiDeviceOut) Does someone have a suggestion? Thanks, -- Patrick Egloff email : pegl...@gmail.com Web page : http://www.egloff.eu -- https://mail.python.org/mailman/listinfo/python-list

Fwd: pygame.midi input/output not working

2022-12-21 Thread Patrick EGLOFF
s for making my day ! Patrick Le mer. 21 déc. 2022 à 23:27, Thomas Passin a écrit : > On 12/21/2022 4:32 PM, Patrick EGLOFF wrote: > > HI, > > Some time ago I wrote a small software using pygame.midi > > It worked just fine with Win10/ python 3.9 / SDL 2.0.14 / pygame 2.0.1

Pyserial problem

2022-12-22 Thread Patrick EGLOFF
works without any flow control, and CTS + DTR high. I checked with MINITERM, that the flow control and control lines have the same state. I'm a bit surprised and stucked. Can someone help ? Thanks, -- Patrick Egloff email : pegl...@gmail.com Web page : http://www.egloff.eu -- https://mail.

Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Patrick Sheehan
t;...I have been at this for 4 days now at least three hours each day...Any information or help you can provide would be greatly appreciated. Additionally, I do have PyCharm installed (As you can tell, I am a beginner), is PyCharm the same thing as Python? Thank you in advance! Respectfu

Building manylinux wheels & auditwheel

2016-10-21 Thread Patrick Young
4/ld-linux-x86-64.so.2 (0x5619467b3000) Any help would be greatly appreciated! I'm experiencing the same thing across the board with other builds I've been trying to manylinuxize. Thanks! -Patrick -- https://mail.python.org/mailman/listinfo/python-list

Re: Work between multiple processes

2017-01-06 Thread Patrick Zhou
t; work process to terminate so to return. > > > > > > either (1) or (2) doesn't work out well. Please suggest. Global system > > queue? > > > > Thanks, > > Patrick. > > > > > Is it a requirement that the workdf process is also

Re: Work between multiple processes

2017-01-10 Thread Patrick Zhou
Hi Irmen, I have successfully got it to work with both side as python but so far having trouble with pyrolite.jar which is downloaded from https://mvnrepository.com/artifact/net.razorvine/pyrolite/4.4 Having simple codes as: public static void main(String[] args) { //System.out.pr

Building on windows and installing to prefix

2018-10-24 Thread Patrick Stinson
Hello! I am having trouble finding out how to build python from source and then install it to a path prefix, as you can on unix. I have looked at the options in “PCBuild\build.bat -h” and in readme.txt, and on google, but no dice. I have VS 2017. Thanks! -Patrick -- https://mail.python.org

Relative import cannot find .so submodule?

2020-01-11 Thread Patrick Stinson
/__init__.py gives the following error: Traceback (most recent call last): File "main.py", line 6, in from pkmidicron import MainWindow, util, ports File "/Users/patrick/dev/pkmidicron/pkmidicron/__init__.py", line 1, in from .mainwindow import * File "/Use

Equivalent of "make install" for Python on windows?

2020-07-10 Thread Patrick Stinson
always had the feeling that the distribution doesn’t really work correctly. Cheers, -Patrick -- https://mail.python.org/mailman/listinfo/python-list

Re: Equivalent of "make install" for Python on windows?

2020-07-10 Thread Patrick Stinson
started to think I was missing something. Cheers, -Patrick > On Jul 10, 2020, at 8:01 AM, Patrick Stinson wrote: > > Building python from source on windows is straightforward enough with > PCBuild/build.bat. But it seems as though the resulting distribution that > runs from these

Re: Python's garbage collection was Re: Python reliability

2005-10-14 Thread Patrick Down
Paul Rubin wrote: > I haven't been keeping up with this stuff in recent years so I have a > worse concern. I don't know whether it's founded or not. Basically > in the past decade or so, memory has gotten 100x larger and cpu's have > gotten 100x faster, but memory is less than 10x faster once yo

Re: newbie question concerning formatted output

2005-11-29 Thread Patrick Down
>>> a = [str(i) for i in range(0,17)] >>> for i in range(0,len(a),3): ... print " ".join(a[i:i+3]) ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -- http://mail.python.org/mailman/listinfo/python-list

Does a function like isset() exist in Python?

2005-06-22 Thread Patrick Fitzsimmons
Hi, I'm sure I should know this, but I can't find it in the manual. Is there a function in Python like the function in PHP isset()? It should take a variable name and return True or False depending on whether the variable is initialized. Thanks for any help, Patrick -- http://mail.

Re: PEP 304 - is anyone really interested?

2005-06-22 Thread Patrick Maupin
Skip Montanaro wrote: > I wrote PEP 304, "Controlling Generation of Bytecode Files": ... > If someone out there is interested in this functionality > and would benefit more from its incorporation into the > core, I'd be happy to hand it off to you. I am quite interested in this PEP. What, exactl

Re: PEP 304 - is anyone really interested?

2005-06-23 Thread Patrick Maupin
Thomas Heller wrote: > Although I was not interested originally, I think that's > a use case I also have. Optional config files, which > should not be compiled to .pyc or .pyo. Only removing > the .py file doesn't have the expected effect > if a .pyc and/or .pyo if is left. I also think that i

Re: PEP 304 - is anyone really interested?

2005-06-24 Thread Patrick Maupin
John Roth wrote: > I'd like to suggest a different mechanism, at least for packages > (top level scripts don't generate .pyc files anyway.) Put a system > variable in the __init__.py file. Something like __obj__ = path > would do nicely. Then when Python created the __init__.pyc file, > it woul

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Patrick Maupin
Jarek Zgoda wrote: > Why want you to read an XML document "by hand"? It's a "machine related" > data chunk. > I see this attitude all the time, and frankly I don't understand it. Please explain why XML is in ASCII/unicode instead of binary. Is it because it is easier for a machine to parse? No,

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Patrick Maupin
Dennis Bieber wrote: > Off hand, I'd consider the non-binary nature to be because the > internet protocols are mostly designed for text, not binary. A document at http://www.w3.org/TR/REC-xml/ lists "the design goals for XML". One of the listed goals is "XML documents should be human-legible and

Bad Math

2005-07-01 Thread Patrick Rutkowski
I started reading a python book today, one example was: >>> 4 / (2.0 + 3) 0.8 My input/output was: >>> 4 (2.0 + 3) 0.80004 Something smells fishy here... whats up? --python 2.4.1 -- http://mail.python.org/mailman/listinfo/python-list

Re: $6 into $1000ands this actually works!

2005-07-01 Thread Patrick Maupin
Thomas wrote: > TURN $6 INTO $15,000 IN ONLY 30 DAYS...HERES HOW! > $ REMEMBER, IT IS 100% LEGAL! DON'T PASS THIS UP! and I thought this was about some new currency/decimal module implementation which remembers units and does the conversion correctly... -- http://mail.python.org/mailman/li

Re: Bad Math

2005-07-02 Thread Patrick Rutkowski
On 7/2/05, Brian van den Broek <[EMAIL PROTECTED]> wrote: > Patrick Rutkowski said unto the world upon 02/07/2005 00:12: > > That's... annoying, to say the least. And my number 4/5 was a rational > > number too; I can understand how when doing 1/3 things can get funky

HTML Conventions

2005-07-04 Thread Patrick Rutkowski
I couldn't help but make an even better list in reference to this thread: http://mail.python.org/pipermail/python-list/2005-July/288678.html Type Convention Example funtion action_with_underscores find_all vari

Re: Trapping user logins in python ( post #1)

2005-07-04 Thread Patrick Rutkowski
On Monday 04 July 2005 13:49, Jeff Epler wrote: > I don't know of a portable way for an inetd-style daemon to "listen" for > user logins. > > On some systems (including RedHat/Fedora and debian), you may be able to > use PAM to do this. (pam modules don't just perform authentication, > they can ta

Re: Good starterbook for learning Python?

2005-07-05 Thread Patrick Rutkowski
On Tuesday 05 July 2005 11:32, Lennart wrote: > Hi everybody, > > Can someone advice me with the following issue: i want to learn python in > my summer vacation (i try to ...:-) So, a good start is buying a good book. > But wich? There are many ... > > I'm living in the Netherlands and I prefer a b

how to imput usernames and passwords??

2005-07-25 Thread Patrick Thorstenson
this information automatically so these update scripts can run at night.  Is there a way I can have Python tell Oracle what the username and password is? Thanks for your help in advance.     Patrick Thorstenson GIS Specialist Montezuma County (970) 564-9298 ext 4169 [EMAIL PROTECTED

deleting a file and looping

2005-07-25 Thread Patrick Thorstenson
I can delete a folder OK using os.remove as long as its empty. I am having difficulty deleting the same folder when there are files in it. I have tried os.removedirs and shutil.rmtree as well but no luck. What am I missing?       Patrick Thorstenson GIS Specialist Montezuma County

trying to access Oracle

2005-07-27 Thread Patrick Thorstenson
###HERE IS WHERE I DON’T KNOW WHAT TO DO###     ..below is the path to temp_ownership.. ASR_JOIN = (connection, "Database Connections\\ASR_Temp_GIS.odc\\ASR.TEMP_OWNERSHIPGIS")     gp.MakeTableView_management (ASR_JOIN)

Re: Moinmoin config

2005-08-17 Thread Patrick Down
Mark wrote: > Hi, > > I have Moinmoin 1.3.4 installed and working on Linux RHEL3.0. However, > all screen elements are lined up on the left hand side. How can I get > it displayed like the wiki at: Well, this is probably a better question for the moin lists but I have seen this behavior before.

Re: Possible improvement to slice opperations.

2005-09-04 Thread Patrick Maupin
> After considering several alternatives and trying out a few ideas with a > modified list object Bengt Richter posted, (Thank You), I think I've > found a way to make slice operation (especially far end indexing) > symmetrical and more consistent. I don't know that it makes it more consistent.

Re: Possible improvement to slice opperations.

2005-09-05 Thread Patrick Maupin
> No one has yet explained the reasoning (vs the mechanics) of the > returned value of the following. > > L = range(10) > L[3::-1] > > So far every attempt to explain it has either quoted the documents which > don't address that particular case, or assumed I'm misunderstanding > something,

Re: Possible improvement to slice opperations.

2005-09-05 Thread Patrick Maupin
I previously wrote (in response to a query from Ron Adam): > In any case, you asked for a rationale. I'll give you mine: > > >>> L = range(10) > >>> L[3:len(L):-1] == [L[i] for i in range(3,len(L),-1)] > True > >>> After eating supper, I just realized that I could probably make my point a bit c

Re: Possible improvement to slice opperations.

2005-09-06 Thread Patrick Maupin
Ron Adam wrote: >> This should never fail with an assertion error. You will note that it >> shows that, for non-negative start and end values, slicing behavior is >> _exactly_ like extended range behavior. > Yes, and it passes for negative start and end values as well. Umm, no: .>> for stride

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Patrick Maupin
Sybren Stuvel wrote: > A programming language should not be ambiguous. The choice > between importing a module and calling a function should not > depend on the availability of a (local) variable. Yeah, this behavior would be as ambiguous as if we had a system-defined search-path for modules, whe

Re: global variables shared across modules

2005-09-09 Thread Patrick Maupin
MackS wrote: > print "inside fun(): " + global_var ... > How can I get the changed value to "persist" in such a way that it > isn't reset when control leaves fun()? Why is it even reset in the > first place? After all, the module has already been imported (and the > initialization of global_va

fdups: calling for beta testers

2005-02-25 Thread Patrick Useldinger
Hi all, I am looking for beta-testers for fdups. fdups is a program to detect duplicate files on locally mounted filesystems. Files are considered equal if their content is identical, regardless of their filename. Also, fdups ignores symbolic links and is able to detect and ignore hardlinks, whe

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
John Machin wrote: (1) It's actually .bz2, not .bz (2) Why annoy people with the not-widely-known bzip2 format just to save a few % of a 12KB file?? (3) Typing that on Windows command line doesn't produce a useful result (4) Haven't you heard of distutils? (1) Typo, thanks for pointing it out (2)(3

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
John Machin wrote: Yes. Moreover, "WinZip", the most popular archive-handler, doesn't grok bzip2. I've added a zip file. It was made in Linux with the zip command-line tool, the man pages say it's compatible with the Windows zip tools. I have also added .py extentions to the 2 programs. I did how

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
Serge Orlov wrote: Or use exemaker, which IMHO is the best way to handle this problem. Looks good, but I do not use Windows. -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: fdups: calling for beta testers

2005-02-27 Thread Patrick Useldinger
John Machin wrote: I've tested it intensively "Famous Last Words" :-) ;-) (1) Manic s/w producing lots of files all the same size: the Borland C[++] compiler produces a debug symbol file (.tds) that's always 384KB; I have 144 of these on my HD, rarely more than 1 in the same directory. Not sure wha

os.stat('')[stat.ST_INO] on Windows

2005-02-27 Thread Patrick Useldinger
What does the above yield on Windows? Are inodes supported on Windows NTFS, FAT, FAT32? -- http://mail.python.org/mailman/listinfo/python-list

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Patrick Useldinger
John Leslie wrote: Or does anyone have a python script which takes a standard unix command as an argument and runs the pyton/windows equivalent on windows? There's not always an equivalent command. -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Patrick Useldinger
Grant Edwards wrote: If you install cygwin there almost always is. If you install cygwin there's no need for what the OP describes. -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: Indexing strings

2005-03-04 Thread Patrick Useldinger
Fred wrote: I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to find the index o

Re: Indexing strings

2005-03-05 Thread Patrick Useldinger
Fred wrote: That was exactely what I was searching for. I needed a program, that chopped up a string into its words and then saves them into a list. I think I got this done... There's a function for that: text.split(). You should really have a look at the Python docs. Also, http://diveintopython.o

Re: enum question

2005-03-05 Thread Patrick Useldinger
M.N.A.Smadi wrote: does python support a C-like enum statement where one can define a variable with prespesified range of values? thanks m.smadi >>> BLUE, RED, GREEN = 1,5,8 >>> BLUE 1 >>> RED 5 >>> GREEN 8 -- http://mail.python.org/mailman/listinfo/python-list

Re: function with a state

2005-03-06 Thread Patrick Useldinger
Xah Lee wrote: globe=0; def myFun(): globe=globe+1 return globe The short answer is to use the global statement: globe=0 def myFun(): global globe globe=globe+1 return globe more elegant is: globe=0 globe=myfun(globe) def myFun(var): return var+1 and still more elegant is using classes

Re: function with a state

2005-03-06 Thread Patrick Useldinger
Kent Johnson wrote: globe=0 globe=myfun(globe) def myFun(var): return var+1 This mystifies me. What is myfun()? What is var intended to be? myfun is an error ;-) should be myFun, of course. var is parameter of function myFun. If you call myFun with variable globe, all references to var will be

Re: Python docs [was: function with a state]

2005-03-10 Thread Patrick Useldinger
You don't understand the "global" statement in Python, but you do understand Software industry in general? Smart... -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread Patrick Useldinger
I wrote something similar, have a look at http://www.homepages.lu/pu/fdups.html. -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: On POSIX filesystems, one has also to avoid comparing files having same (st_dev, st_inum), because you know that they are the same file. I then have a bug here - I consider all files with the same inode equal, but according to what you say I need to consider the

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: That's fast and good. Nice to hear. A minor nit-pick: `fdups.py -r .` does nothing (at least on Linux). I'll look into that. Have you found any way to test if two files on NTFS are hard linked without opening them first to get a file handle? No. And even then, I wo

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: The relevant parts from this last page: st_dev <-> dwVolumeSerialNumber st_ino <-> (nFileIndexHigh, nFileIndexLow) I see. But if I am not mistaken, that would mean that I (1) had to detect NTFS volumes (2) use non-standard libraries to find these information (like

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
David Eppstein wrote: You need do no comparisons between files. Just use a sufficiently strong hash algorithm (SHA-256 maybe?) and compare the hashes. That's not very efficient. IMO, it only makes sense in network-based operations such as rsync. -pu -- http://mail.python.org/mailman/listinfo/py

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: A minor nit-pick: `fdups.py -r .` does nothing (at least on Linux). Changed. -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
David Eppstein wrote: Well, but the spec didn't say efficiency was the primary criterion, it said minimizing the number of comparisons was. That's exactly what my program does. More seriously, the best I can think of that doesn't use a strong slow hash would be to group files by (file size, cheap

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
John Machin wrote: Just look at the efficiency of processing N files of the same size S, where they differ after d bytes: [If they don't differ, d = S] PU: O(Nd) reading time, O(Nd) data comparison time [Actually (N-1)d which is important for small N and large d]. Hashing method: O(NS) reading time

Re: Adapting code to multiple platforms

2005-03-12 Thread Patrick Useldinger
Jeffrey Barish wrote: I have a small program that I would like to run on multiple platforms (at least linux and windows). My program calls helper programs that are different depending on the platform. I think I figured out a way to structure my program, but I'm wondering whether my solution is go

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
Scott David Daniels wrote: comparisons. Using hashes, three file reads and three comparisons of hash values. Without hashes, six file reads; you must read both files to do a file comparison, so three comparisons is six files. That's provided you compare always 2 files at a time. I compar

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
François Pinard wrote: Identical hashes for different files? The probability of this happening should be extremely small, or else, your hash function is not a good one. We're talking about md5, sha1 or similar. They are all known not to be 100% perfect. I agree it's a rare case, but still, why se

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread Patrick Useldinger
grumfish wrote: connection = MySQLdb.connect(host="localhost", user="root", passwd="pw", db="japanese") cursor = connection.cursor() cursor.execute("INSERT INTO edict (kanji, kana, meaning) VALUES (%s, %s, %s)", ("a", "b", "c") ) connection.close() Just a guess "in the dark" (I don't use MySQL):

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
John Machin wrote: Maybe I was wrong: lawyers are noted for irritating precision. You meant to say in your own defence: "If there are *any* number (n >= 2) of identical hashes, you'd still need to *RE*-read and *compare* ...". Right, that is what I meant. 2. As others have explained, with a decent

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
John Machin wrote: Oh yeah, "the computer said so, it must be correct". Even with your algorithm, I would be investigating cases where files were duplicates but there was nothing in the names or paths that suggested how that might have come about. Of course, but it's good to know that the computer

Re: a program to delete duplicate files

2005-03-13 Thread Patrick Useldinger
John Machin wrote: Test: !for k in range(1000): !open('foo' + str(k), 'w') I ran that and watched it open 2 million files and going strong ... until I figured that files are closed by Python immediately because there's no reference to them ;-) Here's my code: #!/usr/bin/env python import os

Re: a program to delete duplicate files

2005-03-14 Thread Patrick Useldinger
David Eppstein wrote: When I've been talking about hashes, I've been assuming very strong cryptographic hashes, good enough that you can trust equal results to really be equal without having to verify by a comparison. I am not an expert in this field. All I know is that MD5 and SHA1 can create c

Re: a program to delete duplicate files

2005-03-14 Thread Patrick Useldinger
David Eppstein wrote: The hard part is verifying that the files that look like duplicates really are duplicates. To do so, for a group of m files that appear to be the same, requires 2(m-1) reads through the whole files if you use a comparison based method, or m reads if you use a strong hashin

Re: How to create an object instance from a string??

2005-03-19 Thread Patrick Useldinger
Tian wrote: I have a string: classname = "Dog" It's easier without strings: >>> classname = Dog >>> classname().bark() Arf!!! >>> -- http://mail.python.org/mailman/listinfo/python-list

[ann] fdups 0.15

2005-03-20 Thread Patrick Useldinger
I am happy to announce version 0.15 of fdups. Changes in this version: - ability to limit the number of file handles used Download = To download, go to: http://www.homepages.lu/pu/fdups.html What is fdups? == fdups is a Python program to detect duplicate

request for book-recommendation

2004-12-10 Thread patrick c.d.
hi, does here anyone of ya geeks know a book teaching you how to handle gtk, web-dev with mysql-db-connection and scripting under gnu/linux with phyton? i'm german (hhaarr) but due to my efficiency-course in english (shool) i want to learn english by learning phyton ;-) thx.. -- http://mail.pyt

Re: how to add a string to the beginning of a large binary file?

2005-03-27 Thread Patrick Useldinger
could ildg wrote: I want to add a string such as "I love you" to the beginning of a binary file, How to? and how to delete the string if I want to get the original file? You shouldn't use Python to write a virus :-) -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: numbering variables

2005-03-28 Thread Patrick Useldinger
remi wrote: Hello, I have got a list like : mylist = ['item 1', 'item 2','item n'] and I would like to store the string 'item1' in a variable called s_1, 'item2' in s_2,...,'item i' in 's_i',... The lenght of mylist is finite ;-) Any ideas ? Thanks a lot. Rémi. Use a dictionary: variable['s_1

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Patrick Useldinger
cjl wrote: Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I'm not looking for automated tools, just trying to gather opinions on which language is easier to understand / rewrite as python. Depends

Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Patrick Useldinger
[EMAIL PROTECTED] wrote: Patrick Useldinger wrote: Depends on what language you know best. But Java is certainly easier to read than C++. There's certainly some irony in those last two sentences. However, I agree with the former. It depends on which you know better, the style of thos

Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Patrick Useldinger
cjl wrote: I've found a third open source implementation in pascal (delphi), and was wondering how well that would translate to python? Being old enough to have programmed in UCSD Pascal on an Apple ][ (with a language card, of course), I'd say: go for Pascal! ;-) -- http://mail.python.org/mailma

http://zephyrfalcon.org/labs/wax.html

2005-04-04 Thread patrick vergain
http://zephyrfalcon.org/labs/wax.html Wax :: Email :: Download area This page is a stub. Over time, I hope to collect more Wax resources here. NOTE: Wax currently works (or is supposed to work) with wxPython 2.5.2.7 or 2.5.2.8. That is the version I am currently using. Newer versions might or mi

Re: Fast plotting?

2005-04-28 Thread Patrick Ellis
William Park <[EMAIL PROTECTED]> typed: > Russell E. Owen <[EMAIL PROTECTED]> wrote: >> Can anyone recommend a fast cross-platform plotting package for 2-D >> plots? >> >> Our situation: >> We are driving an instrument that outputs data at 20Hz. Control is >> via an existing Tkinter application (wh

Re: Fast plotting?

2005-04-29 Thread Patrick Ellis
[EMAIL PROTECTED] <[EMAIL PROTECTED]> typed: > Are you sure about these numbers? Most monitors refresh at 70-80Hz, > so unless you have special display hardware, I'm suspicious of these > numbers doubt . I once had a user post to the matplotlib mailing list > that xplt was refreshing at 1000 Hz.

Pop ups.

2016-03-23 Thread Patrick Rugamba
Hello, This thing is making me run crazy. Am having these pop ups as I try using pycharm saying modify setup, and it is really annoying. I have no clue what is causing it but if it can’t be fixed I’d rather uninstall the programs because I may end up destroying my pc. I hope you guys can help. T

  1   2   3   4   5   6   7   >