[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Billy
New submission from Billy : A new `both()` operator for matching multiple variables to one at the same time. Currently, ```py if a == 1 and b == 1: ... ``` With a `both()` operator, it can be done as follows (concept): ```py if both(a, b) == 1: ... ``` Why? -> With the increas

[issue22107] tempfile module misinterprets access denied error on Windows

2019-04-23 Thread Billy McCulloch
Billy McCulloch added the comment: I stand by the patch file I previously submitted on 2016-05-04. A more detailed analysis / description of my reasoning follows. Change 1 in _get_default_tempdir: A PermissionError is thrown on Windows if you attempt to create a file whose filename matches

Re: any one used moviepy please come in!!! I need help, thanks!

2017-02-23 Thread Billy Earney
imagemagick (ie, convert) has a policy.xml file that stops you from accessing any resource that starts with '@'. type 'identify -list policy' the first line should tell you where your policy.xml file is located. My policy.xml file is lcoated at /etc/ImageMagick-6/policy.xml open that file, and

[issue28274] asyncio does not call exception handler if task stored

2016-09-25 Thread Billy Foster
New submission from Billy Foster: I found a very strange bug in asyncio where whether exception handlers are called depends on whether a task is stored. To illustrate, the following code works as expected, printing out that it made it to the exception handler: import asyncio async def run

Python 3.5 Cross Compile for ARM

2016-05-23 Thread billy . t . west
Hi. Can anyone point me to documentation/instructions for cross compiling Python 3.5? I'm trying to compile Python for an ARM processor. It seems like something broke with cross compilation in 3.5 and a patch was created (https://bugs.python.org/issue22359), but I don't even know where to

[issue22107] tempfile module misinterprets access denied error on Windows

2016-05-03 Thread Billy McCulloch
Billy McCulloch added the comment: I've also run into this bug on Windows. In my case, the tempdir path includes directories on a network share, which I lack write access permissions to. Python tries to generate a *lot* of files, and never figures out it should move on to another directory

Re: pyjs - a compiler from Python to JavaScript

2015-08-12 Thread Billy Earney
Uri, Brython on the other hand, tries to stay true to python (python compatible). As stated before it doesn't compile to stand alone Javascript, but the compile time is usually minimal. Access to Javascript libraries is supported. You really should give it a try.. http://brython.info Billy

Re: pyjs - a compiler from Python to JavaScript

2015-08-10 Thread Billy Earney
Uri, It has been a few years since I have messed with py2js. Have you checked out brython? http://brython.info It supports javascript libraries such as jQuery, raphael.js, etc. Billy On Fri, Aug 7, 2015 at 6:00 AM, Uri Even-Chen u...@speedy.net wrote: To Python developers, Are you

[issue12978] Figure out extended attributes on BSDs

2015-07-20 Thread Billy Foster
Billy Foster added the comment: Is there any chance of getting this finalized? I have been using William Orr's patch as a workaround for months now, but it would be nice to not have to manually apply it each version bump... -- nosy: +billyfoster

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Billy Earney
Freenet seems to come to mind.. :) On Wed, Jun 24, 2015 at 4:24 PM, Grant Edwards invalid@invalid.invalid wrote: On 2015-06-24, Randall Smith rand...@tnr.cc wrote: On 06/24/2015 01:29 PM, Grant Edwards wrote: On 2015-06-24, Randall Smith rand...@tnr.cc wrote: On 06/24/2015 06:36 AM,

a python pitfall

2015-05-14 Thread Billy Earney
) produces: [1, 1] [1, 1, 1, 1] [1, 1, 1, 1, 1, 1] One would expect the following output: [1, 1] [1, 1] [1, 1] Doesn't this valid the zen of python: Explicit is better than implicit. ? Thanks! Billy -- https://mail.python.org/mailman/listinfo/python-list

Re: seek operation in python

2015-04-29 Thread Billy Earney
if your filename is input.cpp, you first line of code should be: file=open(input*.cpp*,r) On Wed, Apr 29, 2015 at 1:26 PM, siva sankari R buddingros...@gmail.com wrote: There is a file named input.cpp(c++ file) that contains some 80 lines of code. --

Re: Python implementations in JavaScript

2015-02-14 Thread Billy Earney
on? For Brython, it depends, on what you want to do. It also hooks into regular javascript libraries (jquery, etc), if you want to access those. The Brython docs cover much of this. Billy On Fri, Feb 13, 2015 at 5:05 PM, Jonathan Hayward j...@jsh.name wrote: What is the relative maturity of different

Re: Future of python on android

2014-12-25 Thread Billy Earney
try kivy, instead of sl4a http://kivy.org/ I believe in the past year or two, the python foundation gave a grant to kivy to add further functionality.. According to wikipedia http://en.wikipedia.org/wiki/Guido_van_Rossum Guido works for dropbox. Billy On Thu, Dec 25, 2014 at 9:31 AM

PySchool.net, kickstarter campaign

2014-12-14 Thread Billy Earney
the technological burdens of hosting programming classes, and help compile resources to help produce lesson plans, etc. Here's the campaign link: https://www.kickstarter.com/projects/2030013583/pyschoolnet-advancing-python-in-the-classroom Feel free to check it out.. :) Billy Earney -- https

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Billy Earney
It looks like the last line (producer_entries...) is not indented at the same extent as the previous line. Maybe this is causing the issue? On Sun, Dec 14, 2014 at 10:15 AM, Simon Evans musicalhack...@yahoo.co.uk wrote: Dear Python programmers, Having input the line of code in text: cd Soup

Re: PySchool.net, kickstarter campaign

2014-12-14 Thread Billy Earney
risk there as well. billy On Sun, Dec 14, 2014 at 5:26 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Dec 15, 2014 at 2:07 AM, Billy Earney billy.ear...@gmail.com wrote: Students can create, edit, load, save, and execute Python scripts directly in the browser. Importantly

Re: PySchool.net, kickstarter campaign

2014-12-14 Thread Billy Earney
Thanks.. I appreciate your contribution! On Sun, Dec 14, 2014 at 5:48 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Dec 15, 2014 at 10:41 AM, Billy Earney billy.ear...@gmail.com wrote: Yes, you are correct. The scripts get compiled to javascript and then executed in the browser

Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Hi Chris, Yep that got me closer. I found that using | sudo python2.7 was a bad command. So I changed over to | python2.7. [root@myserver tmp]# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate -O - | python2.7 --2014-12-01 12:57:07-- https://bootstrap.pypa.io/ez_setup.py

Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Success. Whats happening is that the second wget command is not recognizing the --no-check-certificate. So I went around the problem and installed it manually. wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip --no-check-certificate unzip setuptools-7.0.zip

[issue22699] cross-compilation of Python3.4

2014-10-22 Thread Billy
New submission from Billy: Who knows to cross-compile Python 3.4? -- messages: 229828 nosy: bill9889 priority: normal severity: normal status: open title: cross-compilation of Python3.4 type: resource usage versions: Python 3.4 ___ Python tracker rep

[issue22659] SyntaxError in the configure_ctypes

2014-10-17 Thread Billy
New submission from Billy: Hi all, I have a issue with the cross-compilation, here I let it: File ../src/setup.py, line 1849 exec(f.read(), globals(), fficonfig) SyntaxError: unqualified exec is not allowed in function 'configure_ctypes' it contains a nested function with free variables

[issue22654] issue with PYTHON_FOR_BUILD

2014-10-16 Thread Billy
New submission from Billy: Hi all, I've been cross-compiling Python3.4.1, but I have a issue than is following: _PYTHON_PROJECT_BASE=/home/aphillips/work/leo368-20141008/fs/apps/python-3.4.1/arm _PYTHON_HOST_PLATFORM=linux-arm PYTHONPATH=../src/Lib:../src/Lib/plat-linux -S -m sysconfig

[issue22654] issue with PYTHON_FOR_BUILD

2014-10-16 Thread Billy
Billy added the comment: Yes, I applied a patch in the configure for than it can make the configuration. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22654

[issue22654] issue with PYTHON_FOR_BUILD

2014-10-16 Thread Billy
Billy added the comment: Ned Deil, For my application I need to use Python 3.4.1 and Why do I need to run the ./configure for second time?. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22654

[issue22654] issue with PYTHON_FOR_BUILD

2014-10-16 Thread Billy
Billy added the comment: I added a patch for the resolution of the issue but it didn't work. You can see in my first comment than there is a issue with PYTHONPATH, Do you know why happen that. -- ___ Python tracker rep...@bugs.python.org http

Re: Brython (Python in the browser)

2013-12-27 Thread billy . earney
Awesome.. Wonderful work! -- https://mail.python.org/mailman/listinfo/python-list

Re: Is Python in the browser a dead-end ?

2011-10-28 Thread Billy Earney
I believe that python maybe had missed an opportunity to get in early and be able to take over a large market share from javascript. But that doesn't mean python is dead in the browser, it just means it will have more competition if it wants to replace javascript for Rich Internet Applications.

Re: Java is killing me! (AKA: Java for Pythonheads?)

2011-08-12 Thread Billy Earney
Look into jython. You might be able to run your python code, directly in java. :) http://www.jython.org/ On Fri, Aug 12, 2011 at 12:02 PM, kj no.em...@please.post wrote: *Please* forgive me for asking a Java question in a Python forum. My only excuse for this no-no is that a Python forum

Re: PyWhich

2011-08-05 Thread Billy Mays
On 08/04/2011 10:03 PM, Chris Angelico wrote: On Fri, Aug 5, 2011 at 1:34 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Especially for a tool aimed at programmers (who else would be interested in PyWhich?) The use that first springs to my mind is debugging import paths etc.

PyWhich

2011-08-04 Thread Billy Mays
Hey c.l.p., I wrote a little python script that finds the file that a python module came from. Does anyone see anything wrong with this script? #!/usr/bin/python import sys if __name__ == '__main__': if len(sys.argv) 1: try: m = __import__(sys.argv[1])

Re: where the function has problem? n = 900 is OK , but n = 1000 is ERROR

2011-08-02 Thread Billy Mays
On 08/01/2011 06:06 PM, Steven D'Aprano wrote: Does your definition of fixed mean gives wrong results for n= 4 ? fibo(4) == 3 False Well, I don't know if you're trolling or just dumb: http://en.wikipedia.org/wiki/Fibonacci_number In [2]: for i in range(10): ...: print fibo(i)

Re: where the function has problem? n = 900 is OK , but n = 1000 is ERROR

2011-08-02 Thread Billy Mays
On 08/02/2011 08:45 AM, Alain Ketterlin wrote: produce integers. And it will fail with overflow for big values. If it would make you feel better I can use decimal. Also, perhaps I can name my function billy_fibo(n), which is defined as billy_fibo(n) +error(n) = fibo(n), where error(n) can be

Re: where the function has problem? n = 900 is OK , but n = 1000 is ERROR

2011-08-02 Thread Billy Mays
On 08/02/2011 10:15 AM, Steven D'Aprano wrote: So you say, but I don't believe it. Given fibo, the function you provided earlier, the error increases with N: fibo(82) - fib(82) # fib returns the accurate Fibonacci number 160.0 fibo(182) - fib(182) 2.92786721937918e+23 Hardly arbitrarily

Re: where the function has problem? n = 900 is OK , but n = 1000 is ERROR

2011-08-01 Thread Billy Mays
On 08/01/2011 05:11 AM, jc wrote: # Get Fibonacci Value #Fibonacci(N) = Fibonacci(N-1) + Fibonacci(N-2) # # n = 900 is OK # n = 1000 is ERROR , Why # # What Wrong? # I have fixed the problem for you: def fibo(n): phi = (1+5**.5)/2; iphi = 1-phi; return (phi**n - iphi**n) /

What is xrange?

2011-07-29 Thread Billy Mays
Is xrange not a generator? I know it doesn't return a tuple or list, so what exactly is it? Y doesn't ever complete, but x does. x = (i for i in range(10)) y = xrange(10) print ===X=== while True: for i in x: print i break else: break print ===Y=== while

Re: What's in a name?

2011-07-29 Thread Billy Mays
On 7/29/2011 11:25 PM, Andrew Berg wrote: In case you want to see the code (not complete by a long shot, and they need to be refactored): Module - http://elucidation.hg.sourceforge.net/hgweb/elucidation/elucidation/file/f8da0b15ecca/elucidation.py CLI app -

Re: NoneType and new instances

2011-07-28 Thread Billy Mays
On 07/28/2011 11:39 AM, Ethan Furman wrote: class 'NoneType' Traceback (most recent call last): File stdin, line 3, in module TypeError: cannot create 'NoneType' instances Why is NoneType unable to produce a None instance? I realise that None is a singleton, but so are True and False, and bool

Re: How can I make a program automatically run once per day?

2011-07-27 Thread Billy Mays
On 07/27/2011 08:35 AM, Chris Angelico wrote: On Wed, Jul 27, 2011 at 10:27 PM, Dave Angelda...@ieee.org wrote: As Chris pointed out, you probably aren't getting the script's directory right. After all, how can the scheduler guess where you put it? The obvious answer is to use a full path

Re: Programming Python for Absolute Beginners

2011-07-27 Thread Billy Mays
On 7/27/2011 11:50 PM, harrismh777 wrote: No one cares and don't spam the list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Convolution of different sized arrays

2011-07-26 Thread Billy Mays
On 07/26/2011 08:10 AM, Olenka Subota wrote: If anyone of you can help, please do it.. Thanks! You would probably get a better answer asking on one of the mailing lists here: http://new.scipy.org/mailing-lists.html -- http://mail.python.org/mailman/listinfo/python-list

Re: reading zipfile; problem using raw buffer

2011-07-26 Thread Billy Mays
On 07/26/2011 08:42 AM, Sells, Fred wrote: I'm tring to unzip a buffer that is uploaded to django/python. I can unzip the file in batch mode just fine, but when I get the buffer I get a BadZipfile exception. I wrote this snippet to try to isolate the issue but I don't understand what's going

Re: Only Bytecode, No .py Files

2011-07-26 Thread Billy Mays
On 07/26/2011 11:19 AM, Eldon Ziegler wrote: Is there a way to have the Python processor look only for bytecode files, not .py files? We are seeing huge numbers of Linux audit messages on production system on which only bytecode files are stored. The audit subsystem is recording each open

Re: Pipe in the return statement

2011-07-25 Thread Billy Mays
On 07/25/2011 10:16 AM, Archard Lias wrote: On Jul 25, 2:03 pm, Ian Collinsian-n...@hotmail.com wrote: On 07/26/11 12:00 AM, Archard Lias wrote: Hi, Still I dont get how I am supposed to understand the pipe and its task/ idea/influece on control flow, of: returnstatement|statement ??

Re: Convert '165.0' to int

2011-07-25 Thread Billy Mays
On 07/25/2011 05:48 AM, Steven D'Aprano wrote: But if you're calling a function in both cases: map(int, data) [int(x) for x in data] I am aware the premature optimization is a danger, but its also incorrect to ignore potential performance pitfalls. I would favor a generator expression

Re: Convert '165.0' to int

2011-07-24 Thread Billy Mays
On 7/24/2011 2:27 PM, SigmundV wrote: On Jul 21, 10:31 am, Frank Millmanfr...@chagford.com wrote: Is there a short cut, or must I do this every time (I have lots of them!) ? I know I can write a function to do this, but is there anything built-in? I'd say that we have established that there

Re: Convert '165.0' to int

2011-07-23 Thread Billy Mays
On 7/23/2011 3:42 AM, Chris Angelico wrote: int(s.rstrip('0').rstrip('.')) Also, it will (in?)correct parse strings such as: '16500' to 165. -- Bill -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert '165.0' to int

2011-07-23 Thread Billy Mays
On 7/23/2011 2:28 PM, rantingrick wrote: On Jul 23, 1:53 am, Frank Millmanfr...@chagford.com wrote: -- The problem with that is that it will silently ignore any non-zero digits after the point. Of course int(float(x)) does the same, which I had

Re: Convert '165.0' to int

2011-07-22 Thread Billy Mays
On 07/22/2011 10:21 AM, Grant Edwards wrote: While that may be clear to you, that's because you've made some assumptions. Convert a properly formatted string representation of a floating point number to an integer is not a rigorous definition. What does properly formatted mean? Who says that

Re: Convert '165.0' to int

2011-07-22 Thread Billy Mays
On 07/22/2011 10:58 AM, Grant Edwards wrote: On 2011-07-22, Billy Mays81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com wrote: Properly formatted means that Python would accept the string as an argument to float() without raising an exception. Then you can't assume

Re: Convert '165.0' to int

2011-07-21 Thread Billy Mays
On 07/21/2011 08:46 AM, Web Dreamer wrote: If you do not want to use 'float()' try: int(x.split('.')[0]) This is right. But, the problem is the same as with int(float(x)), the integer number is still not as close as possible as the original float value. I would in fact consider doing

Re: Can someone help please

2011-07-21 Thread Billy Mays
On 07/21/2011 01:02 PM, Gary wrote: Hi Can someone help me with this code below please, For some reason it will not send me the first text file in the directory. I made up an empty file a.txt file with nothing on it and it sends the files i need but would like to fix the code. Thanks total =

Re: Can someone help please

2011-07-21 Thread Billy Mays
On 07/21/2011 01:41 PM, Gary Herron wrote: On 07/21/2011 10:23 AM, Billy Mays wrote: On 07/21/2011 01:02 PM, Gary wrote: Hi Can someone help me with this code below please, For some reason it will not send me the first text file in the directory. I made up an empty file a.txt file with nothing

Re: Convert '165.0' to int

2011-07-21 Thread Billy Mays
On 7/21/2011 10:40 PM, Thomas 'PointedEars' Lahn wrote: Billy Mays wrote: On 07/21/2011 08:46 AM, Web Dreamer wrote: If you do not want to use 'float()' try: int(x.split('.')[0]) This is right. Assuming that the value of `x' is in the proper format, of course. Else you might easily cut

Return and set

2011-07-19 Thread Billy Mays
I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me: def getToken(self): if self.tok: t = self.tok self.tok = None return t # ... Is there a way to trim the 'if' block to reset

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 09:43 AM, Ben Finney wrote: Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes: I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me: Clearly that's because the function name

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 01:00 PM, Micah wrote: That sounds artificially backwards; why not let getToken() reuse peekToken()? def peek(self): if self.tok is None: try: self.tok = self.gen.next() except StopIteration: self.tok = NULL return self.tok

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 01:02 PM, Terry Reedy wrote: You did not answer Ben's question about the allowed values of self.tok and whether you really want to clobber all 'false' values. The proper code depends on that answer. NULL is an enumerated value I have defined above. The idea is for peekToken to

Re: a little parsing challenge ☺

2011-07-19 Thread Billy Mays
On 07/19/2011 01:14 PM, Xah Lee wrote: I added other unicode brackets to your list of brackets, but it seems your code still fail to catch a file that has mismatched curly quotes. (e.g.http://xahlee.org/p/time_machine/tm-ch04.html ) LOL Billy. Xah I suspect its due to the file mode being

Re: Saving changes to path

2011-07-19 Thread Billy Mays
On 07/19/2011 02:24 PM, Chess Club wrote: Hello, I used sys.path.append() to add to the path directory, but the changes made are not saved when I exit the compiler. Is there a way to save it? Thank you. Since python is running in a child process, it only affects its own environment

Re: a little parsing challenge ☺

2011-07-18 Thread Billy Mays
On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot. It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. import sys, os pairs = {'}':'{', ')':'(', ']':'[', '':'', ':', '':''} valid = set( v for pair in pairs.items() for v in pair ) for

Re: a little parsing challenge ☺

2011-07-18 Thread Billy Mays
On 7/18/2011 7:56 PM, Steven D'Aprano wrote: Billy Mays wrote: On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot. It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. Goobers... that would be one of those new-fangled slang terms

Re: Possible File iteration bug

2011-07-15 Thread Billy Mays
On 07/15/2011 04:01 AM, bruno.desthuilli...@gmail.com wrote: On Jul 14, 9:46 pm, Billy Maysno...@nohow.com wrote: I noticed that if a file is being continuously written to, the file generator does not notice it: def getLines(f): lines = [] for line in f: lines.append

Re: Possible File iteration bug

2011-07-15 Thread Billy Mays
On 07/15/2011 08:39 AM, Thomas Rachel wrote: Am 14.07.2011 21:46 schrieb Billy Mays: I noticed that if a file is being continuously written to, the file generator does not notice it: Yes. That's why there were alternative suggestions in your last thread How to write a file generator

Re: Possible File iteration bug

2011-07-15 Thread Billy Mays
On 07/15/2011 10:28 AM, Thomas Rachel wrote: Am 15.07.2011 14:52 schrieb Billy Mays: Also, in the python docs, file.next() mentions there being a performance gain for using the file generator (iterator?) over the readline function. Here, the question is if this performance gain is really

Re: Looking for general advice on complex program

2011-07-15 Thread Billy Mays
On 07/15/2011 03:47 PM, Josh English wrote: I remember reading that file locking doesn't work on network mounted drives (specifically nfs mounts), but you might be able to simply create a 'lock' (mydoc.xml.lock or the like) file for the XML doc in question. If that file exists you could

Re: String formatting - mysql insert

2011-07-14 Thread Billy Mays
On 07/14/2011 11:00 AM, Christian wrote: Hi, I get some problem when i like to set the table name dynamic. I'm appreciate for any help. Christian ### works newcur.execute ( INSERT INTO events (id1,id2) VALUES (%s,%s); , (rs[1],rs[2])) ### works not newcur.execute ( INSERT INTO

Possible File iteration bug

2011-07-14 Thread Billy Mays
I noticed that if a file is being continuously written to, the file generator does not notice it: def getLines(f): lines = [] for line in f: lines.append(line) return lines with open('/var/log/syslog', 'rb') as f: lines = getLines(f) # do some processing with

Re: Possible File iteration bug

2011-07-14 Thread Billy Mays
On 07/14/2011 04:00 PM, Ian Kelly wrote: On Thu, Jul 14, 2011 at 1:46 PM, Billy Maysno...@nohow.com wrote: def getLines(f): lines = [] for line in f: lines.append(line) return lines with open('/var/log/syslog', 'rb') as f: lines = getLines(f) # do some processing

How to write a file generator

2011-07-12 Thread Billy Mays
I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call: def getLines(): with open('/var/log/syslog', 'rb') as f: while True: line = f.readline() if line:

Re: How to write a file generator

2011-07-12 Thread Billy Mays
On 07/12/2011 11:52 AM, Thomas Jollans wrote: On 07/12/2011 04:46 PM, Billy Mays wrote: I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call: def getLines(): with open('/var/log/syslog', 'rb

Re: Why isn't there a good RAD Gui tool for python

2011-07-11 Thread Billy Mays
On 07/11/2011 02:59 PM, Elias Fotinis wrote: On Mon, 11 Jul 2011 20:11:56 +0300, Stefan Behnel stefan...@behnel.de wrote: Just a quick suggestion regarding the way you posed your question. It's usually better to ask if anyone knows a good tool to do a specific job (which you would describe in

Re: Finding duplicated photo

2011-07-08 Thread Billy Mays
On 07/08/2011 07:29 AM, TheSaint wrote: Hello, I came across the problem that Gwenview moves the photo from the camera memory by renaming them, but later I forgot which where moved. Then I tought about a small script in python, but I stumbled upon my ignorance on the way to do that. PIL can

Re: Finding duplicated photo

2011-07-08 Thread Billy Mays
On 07/08/2011 10:14 AM, TheSaint wrote: Billy Mays wrote: It worked surprisingly well even with just the 64bit hash it produces. I'd say that comparing 2 images reduced upto 32x32 bit seems too little to find if one of the 2 portrait has a smile referred to the other. I think it's about

Re: String concatenation vs. string formatting

2011-07-08 Thread Billy Mays
On 07/08/2011 04:18 PM, Andrew Berg wrote: Is it bad practice to use this logger.error(self.preset_file + ' could not be stored - ' + sys.exc_info()[1]) Instead of this? logger.error('{file} could not be stored - {error}'.format(file=self.preset_file, error=sys.exc_info()[1])) Other than

Large number multiplication

2011-07-06 Thread Billy Mays
I was looking through the python source and noticed that long multiplication is done using the Karatsuba method (O(~n^1.5)) rather than using FFTs O(~n log n). I was wondering if there was a reason the Karatsuba method was chosen over the FFT convolution method? -- Bill --

Re: Large number multiplication

2011-07-06 Thread Billy Mays
On 07/06/2011 04:05 PM, Christian Heimes wrote: Am 06.07.2011 21:30, schrieb Billy Mays: I was looking through the python source and noticed that long multiplication is done using the Karatsuba method (O(~n^1.5)) rather than using FFTs O(~n log n). I was wondering if there was a reason

Re: Large number multiplication

2011-07-06 Thread Billy Mays
On 07/06/2011 04:02 PM, Ian Kelly wrote: On Wed, Jul 6, 2011 at 1:30 PM, Billy Maysno...@nohow.com wrote: I was looking through the python source and noticed that long multiplication is done using the Karatsuba method (O(~n^1.5)) rather than using FFTs O(~n log n). I was wondering

Better way to iterate over indices?

2011-06-21 Thread Billy Mays
I have always found that iterating over the indices of a list/tuple is not very clean: for i in range(len(myList)): doStuff(i, myList[i]) I know I could use enumerate: for i, v in enumerate(myList): doStuff(i, myList[i]) ...but that stiff seems clunky. Are there any better ways

Standard Deviation One-liner

2011-06-03 Thread Billy Mays
I'm trying to shorten a one-liner I have for calculating the standard deviation of a list of numbers. I have something so far, but I was wondering if it could be made any shorter (without imports). Here's my function: a=lambda d:(sum((x-1.*sum(d)/len(d))**2 for x in d)/(1.*(len(d)-1)))**.5

Re: Updated blog post on how to use super()

2011-06-01 Thread Billy Mays
On 5/31/2011 10:44 PM, Raymond Hettinger wrote: I've tightened the wording a bit, made much better use of keyword arguments instead of kwds.pop(arg), and added a section on defensive programming (protecting a subclass from inadvertently missing an MRO requirement). Also, there is an entry on

Re: Updated blog post on how to use super()

2011-06-01 Thread Billy Mays
On 6/1/2011 12:42 PM, Ian Kelly wrote: On Wed, Jun 1, 2011 at 7:03 AM, Billy Maysno...@nohow.com wrote: I read this when it was on HN the other day, but I still don't see what is special about super(). It seems (from your post) to just be a stand in for the super class name

Re: in house pypi?

2011-03-24 Thread Billy Earney
Another possible solution, would be to use urlimport http://pypi.python.org/pypi/urlimport/ http://pypi.python.org/pypi/urlimport/if the packages are 100% python (no c, etc), you could create a single repository, serve that via a web server, and users could easy import modules without even

[issue11652] urlib2 returns a pair of integers as the content-length value

2011-03-23 Thread Billy Saelim
New submission from Billy Saelim sae...@gmail.com: urlopen does not always return a single value for 'content-length'. For example: import urllib2 request = 'http://wwwsearch.sourceforge.net/mechanize/src/mechanize-0.1.11.zip' fp = urllib2.urlopen(request) fp.info().dict {'content

looking for new members to join grid of storage nodes using tahoe-lafs which is implemented in python.

2011-02-02 Thread Billy Earney
can subscribe at http://tahoe-lafs.org/cgi-bin/mailman/listinfo/volunteergrid2-l Billy -- http://mail.python.org/mailman/listinfo/python-list

Re: Developing a program to make a family tree.

2011-01-14 Thread Billy Earney
try http://gramps-project.org/, which is created in python.. :) On Fri, Jan 14, 2011 at 1:39 PM, Ata Jafari a.j.romani...@gmail.com wrote: Hi there. I'm trying to develop a program like family tree maker. I have all information, so there is no need to search on the net. This must be

RE: Visual Python programming and decompilers?

2010-03-12 Thread Billy Earney
Ludolph, This reminds me of the orange project which is developed in python. http://www.ailab.si/orange/ It is actually for data mining, but many of the concepts could be used for a more general programming structure. Billy -Original Message- From: python-list-bounces+billy.earney=gmail

RE: checking 'type' programmatically

2009-11-20 Thread Billy Earney
Try looking at the function 'isinstance', so for example if isinstance(obj, str): print object is a string.. elif isinstance(obj, int): print object is an integer.. -Original Message- From: python-list-bounces+billy.earney=gmail@python.org

RE: Web development with Python 3.1

2009-10-27 Thread Billy Earney
I would agree with Alan. Most of the libraries you should use are compatible with the 2.x series.. I still use versions 2.5 and 2.6 for all development. From: python-list-bounces+billy.earney=gmail@python.org [mailto:python-list-bounces+billy.earney=gmail@python.org] On Behalf Of

Python class gotcha with scope?

2009-06-21 Thread billy
I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then it would. class foo: ... r = {} ... def setn(self, n): ... self.r[f] = n ... a = foo() a.setn(4) b = foo() b.r {'f': 4} thanks, billy

Re: Python class gotcha with scope?

2009-06-21 Thread billy
great, thanks for the quick responses :) On Jun 21, 2:41 am, Carl Banks pavlovevide...@gmail.com wrote: On Jun 20, 11:32 pm, billy billy.cha...@gmail.com wrote: I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict

Re: PyGilState_Ensure interrupts python critical sections

2007-11-15 Thread billy . omahony
for any help/suggestions offered! BR, Billy. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

PyGilState_Ensure interrupts python critical sections

2007-11-12 Thread billy . omahony
with other Python releases Maybe someone familiar with the python source code would know for sure? I am using Python 2.4.3 on windows XP. Thanks for any help/suggestions offered! BR, Billy. -- http://mail.python.org/mailman/listinfo/python-list

* * * New eBooks Store * * *

2007-07-17 Thread Billy Bean
Multiple categories including literature, business, home garden, computers internet, and more! Learn how to make money at home, start your own business, try new recipes, etc. Complete resell rights included! http://www.grandgold.net -- http://mail.python.org/mailman/listinfo/python-list