Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
any pointers will be appreciated. Thanks, Ritu -- http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
s/if ord(b) 127/if ord(b) 127 or ord(b) 32/ On Tue, 31 Mar 2009 10:19:44 -0700 Josh Dukes josh.du...@microvu.com wrote: There might be another way but off the top of my head: #!/usr/bin/env python def isbin(filename): fd=open(filename,'rb') for b in fd.read(): if ord(b

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
']: print %s is binary: %f, isbin(f) whatever... basically it's what everyone else said, every file is binary so it all depends on your definitiion of binary. On Tue, 31 Mar 2009 10:23:51 -0700 Josh Dukes josh.du...@microvu.com wrote: s/if ord(b) 127/if ord(b) 127 or ord(b) 32/ On Tue

Re: Find duplicates in a list and count them ...

2009-03-26 Thread Josh Dukes
)) ^^^ should have been: l.append(randint(0,9)) Or even: l = [randint(0,9) for x in xrange(8)] -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

iteration without storing a variable

2009-03-25 Thread Josh Dukes
different results? -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: iteration without storing a variable

2009-03-25 Thread Josh Dukes
was more talking about the speed differences between ruby and python. On Wed, 25 Mar 2009 20:13:13 +0100 Stefan Behnel stefan...@behnel.de wrote: Josh Dukes wrote: $ time python -c 'a = A; for r in xrange(10): a += A ' real0m0.109s user0m0.100s sys 0m0.010s Anyone

Re: What way is the best to check an empty list?

2009-03-25 Thread Josh Dukes
://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-03-18 Thread Josh Dukes
VNC style remote control of other seats of the same software so parts can be discussed with ease over the phone etc. It seems like project verse would be really cool to have for this. http://verse.blender.org/ -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-03-17 Thread Josh Dukes
://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-18 Thread Josh Dukes
ages. And i am absolutly only looking to do this in 3D, 2D is boring. So, yes, i have looked at both the applications you offer. Thanks -- http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file character by character

2009-02-17 Thread Josh Dukes
', 'over'] which just finds words. One could also just limit it to letters with re.findall([a-zA-Z], s) as \w is a little more encompassing (letters and underscores) if that's a problem. -tkc -- http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu

Re: Putting asterisks around text

2009-02-17 Thread Josh Dukes
: study(textbook) complete(homework) if want_help: study(http://www.catb.org/~esr/faqs/smart-questions.html;) Just fyi... -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-17 Thread Josh Dukes
want. -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
as the first value is detected*. I'd really expect it to act more like... def has_values(g): for i in g: return True return False So what's going on here? Am I using the wrong function or is this actually just a bug? -- Josh Dukes MicroVu IT Department -- http://mail.python.org

Re: bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
on? -- Josh Dukes MicroVu IT Department#!/usr/bin/env python from datetime import datetime def has_values(g): for i in g: return True return False print creation time start=datetime.now() print len([ x for x in range(1,1) if not [ y for y in range(2,x/2) if not x%y]]),values

Re: bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
ahhh any! ok, yeah, I guess that's what I was looking for. Thanks. On 10 Feb 2009 21:57:56 GMT Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 10 Feb 2009 12:50:02 -0800, Josh Dukes wrote: The thing I don't understand is why a generator that has no iterable values