Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Brian Sabbey
005 04:45 pm, Brian Sabbey wrote: Here is a pre-PEP for what I call "suite-based keyword arguments". The mechanism described here is intended to act as a complement to thunks. Please let me know what you think. Kind of cool. If we had full lambdas aka as anonymous defs (def foo(...) wi

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Brian Sabbey
Leif K-Brooks wrote: Brian Sabbey wrote: Thunk statements contain a new keyword, 'do', as in the example below. The body of the thunk is the suite in the 'do' statement; it gets passed to the function appearing next to 'do'. The thunk gets inserted as the f

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Brian Sabbey
ould replace 'if' with your own version (not that you would want to): def my_if(thunk, val): if val: thunk() do my_if(a): # same as "if a:" assert a (replacing "else" wouldn't be possible without allowing multiple thunks.) Or you could create your own 'for' (again, NTYWWT): def my_for(thunk, vals): for i in vals: thunk(i) do i in my_for(range(10)): print i -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Brian Sabbey
7;return' is ok. Inside thunks I still think 'return' would be confusing. I don't think one can replace thunks with suite-based keywords. The thunk evaluates in the same frame as the function in which it was defined. This frame is accessible: Hm ? You mean like a function closure, or that local variables defined inside the thunk will be visible to the caller ? This might change a lot of things and it becomes like a continuation, are you going to recode stackless ? I meant that a thunk is not like a function closure. Variables defined in the thunk won't be visible to the caller of the thunk (except through tk_frame), but they will be visible to the function surrounding the thunk. I made an initial implementation, and it didn't require anything like stackless. -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Brian Sabbey
you're getting at with decorators and anonymous functions, but there are a couple of things that, to me, make it worth coming up with a whole new syntax. First, I don't like how one does not get the thunk inserted automatically into the argument list of the decorator, as I described above. Also, I don't like how the return value of the decorator cannot be captured (and is already used for another purpose). The fact that decorators require one more line of code is also a little bothersome. Decorators weren't intended to be used this way, so it seems somewhat hacky to do so. Why not a new syntax? -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Suite-Based Keywords

2005-04-17 Thread Brian Sabbey
arguments. Example: class C(object): x = property(**): doc = "I'm the 'x' property." def fget(self): return self.__x def fset(self, value): self.__x = value def fdel(self): del self.__x -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-17 Thread Brian Sabbey
Ron_Adam wrote: On Sat, 16 Apr 2005 17:25:00 -0700, Brian Sabbey Yes, much of what thunks do can also be done by passing a function argument. But thunks are different because they share the surrounding function's namespace (which inner functions do not), and because they can be defined in a

Re: pre-PEP: Suite-Based Keywords

2005-04-17 Thread Brian Sabbey
Brian Sabbey wrote: Does anyone know if the 'where' keyword is only for readability (or does it disambiguate the syntax in some situations)? I think I prefer leaving it off. To answer my own question, I see by reading the where threads that using the 'where' keyword a

Re: pre-PEP: Simple Thunks

2005-04-17 Thread Brian Sabbey
heses, which is also not pretty. It's getting too Lisp-like for my tastes. -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-17 Thread Brian Sabbey
re-binding 'p', significantly more lines. Moreover, class 'Pickled' won't be as readable as the 'pickled_file' function above since 'load' and 'dump' are separate methods that share data through 'self'. The motivation for thunks is similar to the motivation for generators-- yes, a class could be used instead, but in many cases it's more work than should be necessary. -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-18 Thread Brian Sabbey
t it encapsulates the data object better. It is also reusable and extendable. This class isn't reusable in the case that one wants to pickle something other than an array. Every type of object that one would wish to pickle would require its own class. Also, this implementation behaves diff

Re: Python documentation moronicities (continued)

2005-04-26 Thread Brian Quinlan
I think that there are some nice ideas in the new version e.g. "Regex functions" is a nicer title than "Module contents", examples, caveats. But there are some organizational problems and the actual writting is a bit weak. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Which IDE is recommended?

2005-04-27 Thread Brian Beck
pable. The autocompletion is very generic though, it'll happily complete any word you've typed before. The auto-indentation isn't nearly as spot-on as WingIDE's * I hate PythonWin or whatever it's called. Dunno what more to say -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

TKinter and Python Sync. Problems

2005-04-27 Thread Brian Kazian
I am currently having trouble running a piece of code I have written. My main code is called new.py, and when I run it, it pops up the TKinter root window as specified. However, if I try perform a function that uses an imported module, the code crashes, giving me this error: Exception in Tki

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
ter, such as dedenting after a 'return' statement. * The Problems view finds 52 errors in a file with 0. * Run As doesn't dump me into an interactive shell. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Oh yeah, and what's with not being able to configure the code completion key sequence. How about *no* key sequence? That's the way every other IDE I've used does it. This is more like semi-automatic code completion. -- Brian Beck Adventurer of the First Order -- http://mail.pyt

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Brian Beck wrote: >>What version? PyDev has increased in maturity quite a bit lately. I realize 0.9.3 is the latest release, but the installation fails through the Eclipse updater: Unable to complete action for feature "PyDev for Eclipse" due to errors. Unable to create fi

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Brian Beck wrote: > I realize 0.9.3 is the latest release, but the installation fails > through the Eclipse updater: > > Unable to complete action for feature "PyDev for Eclipse" due to errors. > Unable to create file > "/opt/eclipse-extensions-3/eclipse/plu

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
or other modules in the standard library. But calls to standard library modules only occur maybe twice in any of my big scripts... the problem is I've been trying code completion with third-party modules and local classes, which still doesn't work. -- Brian Beck Adventurer of the Firs

Re: pyqt and Eric 3

2005-04-28 Thread Brian Elmegaard
[EMAIL PROTECTED] writes: > http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml Which, afaics, unfortunately requires either that you have msvc or that you compile python and every addon with mingw :-( -- Brian (remove the sport for mail) http://www.et.dtu.dk/st

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
izing that it's in the local scope now. So it's fine all the modules fine, just placing them wrong in the auto-complete search tree, or however it works. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

adding values from a csv column and getting the mean. beginner help

2013-12-11 Thread brian cleere
I know the problem is with the for loop but don't know how to fix. Any help with explanation would be appreciated. #!/bin/env python import csv import sys if len(sys.argv) < 3: print('Please specify a filename and column number: {} [csvfile] [column]'.format(sys.argv[0])) sys.exit(1) f

@property simultaneous setter and getter

2013-12-21 Thread Brian Bruggeman
Is this something that would be pep-able? https://gist.github.com/brianbruggeman/8061774 Thanks in advance. -- https://mail.python.org/mailman/listinfo/python-list

Problem Running tkinter gui Code

2015-12-27 Thread brian . moreira
Hi there. I trying to run a simple code that opens a Tkinter window with text in it, on my windows 8 machine using Python 3.4.3 I used to ge: “ImportError: no tkinter module exists” But now it opens a windows Wizard screen that prompts me to Modify, Repair, or Uninstall Python. I have tried

Converting py files to .exe and .dmg

2015-12-28 Thread Brian Simms
Hi there, I have done a lot of looking around online to find out how to convert Python files to .exe and .dmg files, but I am confused. Could someone provide pointers/advice as to how I can turn a Python file into a Windows .exe and Mac .dmg file. Thanks for any help. -- https://mail.python.

Re: Converting py files to .exe and .dmg

2015-12-31 Thread Brian Simms
On Tuesday, 29 December 2015 01:09:30 UTC+9, Adam M wrote: > On Monday, December 28, 2015 at 10:35:41 AM UTC-5, Brian Simms wrote: > > Hi there, > > > > I have done a lot of looking around online to find out how to convert > > Python files to .exe and .dmg file

Delegation in Python

2015-01-24 Thread Brian Gladman
) -- which doesn't work. Any advice on how to do this would be much appreciated. Brian -- https://mail.python.org/mailman/listinfo/python-list

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
On 24/01/2015 23:22, Chris Angelico wrote: > class RF(Fraction): > def is_integer(self): >return self.numerator % self.denominator == 0 Thanks for your help on this. I must admit that nowhere in a lot of searching did I find that delegation is achieved by doing nothing!

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
> True Thanks Gary. As Chris says, the method he suggests is problematic since anything delegated returns a Fraction, not an RF. Patching Fraction looks nicer to use even if it is frowned on. Brian -- https://mail.python.org/mailman/listinfo/python-list

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
On 24/01/2015 23:47, Gary Herron wrote: > On 01/24/2015 03:38 PM, Brian Gladman wrote: >> On 24/01/2015 23:22, Chris Angelico wrote: >>> class RF(Fraction): >>> def is_integer(self): >>> return self.numerator % self.denominator == 0 >> Thanks

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
On 24/01/2015 23:43, Chris Angelico wrote: > On Sun, Jan 25, 2015 at 10:38 AM, Brian Gladman wrote: >> On 24/01/2015 23:22, Chris Angelico wrote: >>> class RF(Fraction): >>> def is_integer(self): >>>return self.numerator % self.denominator == 0 &g

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
On 25/01/2015 01:31, Terry Reedy wrote: > On 1/24/2015 5:57 PM, Brian Gladman wrote: >> I would appreciate advice on how to set up delgation in Python. >> >> I am continuously implementing a function to test whether a Python >> Fraction is an integer > > Sinc

Re: Delegation in Python

2015-01-24 Thread Brian Gladman
On 25/01/2015 00:28, Chris Angelico wrote: > On Sun, Jan 25, 2015 at 11:18 AM, Brian Gladman wrote: >> Is there a way of doing delegation rather than sub-classing? >> >> That is, can I create a class (say RF) that passes some of its methods >> to Fraction for implement

Salutations Python List!

2014-03-10 Thread Brian Murphy
http://lalimitada.com/templates/beez/bbcnews.php?awvq1600afttah Brian Murphy bam...@gmail.com Don't quit now, we might just as well lock the door and throw away th

Re: PyPi Module Removal

2013-09-03 Thread Brian Rak
Thanks! Wasn't really sure where I should have reported that. On 9/3/2013 4:56 PM, Skip Montanaro wrote: I don't really have any way to contact the author of the module. Is there any way to have this deleted/renamed? Not directly, but I opened a ticked in the PyPI bug tracker. Skip -- https

PyPi Module Removal

2013-09-03 Thread Brian Rak
I was trying to install wxPython earlier today. Not RTFMing, I tried 'easy_install wx', which ended up installing this strange module: https://pypi.python.org/pypi/wx Looking at the download stats, it seems to be confusing ~1000 users a month, while not providing any significant functionality

Re: PyPi Module Removal

2013-09-03 Thread Brian Rak
On 9/3/2013 10:49 PM, Skip Montanaro wrote: > Ah, Unix users. Who else would imagine that the way to install something > called "wxPython" was to use "install wx"? I'm not a wxPython user, but it seems the package/module you import in your programs is "wx". Not an unreasonable guess at the P

Re: find all multiplicands and multipliers for a number

2015-04-12 Thread Brian Gladman
On 11/04/2015 03:04, Steven D'Aprano wrote: > It may be a bit slow for very large numbers. On my computer, this takes 20 > seconds: > > py> pyprimes.factors.factorise(2**111+1) > [3, 3, 1777, 3331, 17539, 25781083, 107775231312019L] > > > but that is the nature of factorising large numbers. >

Re: find all multiplicands and multipliers for a number

2015-04-12 Thread Brian Gladman
, I have a more complex version but the simple one works well enough in this context and finds very large primes that would otherwise stall the code. Thanks for taking a look. Brian -- https://mail.python.org/mailman/listinfo/python-list

Re: find all multiplicands and multipliers for a number

2015-04-12 Thread Brian Gladman
On 12/04/2015 18:20, Paul Rubin wrote: > Steven D'Aprano writes: >> Um, "simple sieve"? You're using Miller-Rabin to check for candidate >> prime factors. I don't think that counts as a simple sieve :-) > > How does Miller-Rabin help? It has to cost more than trial division. As we factor the nu

Re: a more precise distance algorithm

2015-05-27 Thread Brian Blais
On Mon, May 25, 2015 at 11:11 PM, Steven D'Aprano wrote: > > Let's compare three methods. > > def naive(a, b): > return math.sqrt(a**2 + b**2) > > def alternate(a, b): > a, b = min(a, b), max(a, b) > if a == 0: return b > if b == 0: return a > return a * math.sqrt(1 + b**2 /

Re: what windows compiler for python 3.5?

2015-07-24 Thread Brian Gladman
On 24/07/2015 12:04, Chris Angelico wrote: > On Fri, Jul 24, 2015 at 8:53 PM, Robin Becker wrote: >> yes I build extensions for reportlab. Unfortunately, despite our MSDN >> subscription to the Visual Studio stuff we have no access to the Visual >> Studio Version 2015. Last one in my downloads is

Re: [RELEASED] Python 3.5.0rc3 is now available

2015-09-08 Thread Brian Gladman
On 08/09/2015 02:35, Larry Hastings wrote: > > > On behalf of the Python development community and the Python 3.5 release > team, I'm relieved to announce the availability of Python 3.5.0rc3, also > known as Python 3.5.0 Release Candidate 3. > > The next release of Python 3.5 will be Python 3.5.

Re: Cryptographically strong random numbers

2015-10-16 Thread Brian Gladman
On 16/10/2015 17:25, Steven D'Aprano wrote: > Hello folks, [snip detail] > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, end): > return a random integer in the closed interval start...end > (including

Re: 3 Suggestions to Make Python Easier For Children

2014-08-05 Thread Brian Blais
On Sat, Aug 2, 2014 at 2:45 AM, Mark Summerfield wrote: > Last week I spent a couple of days teaching two children (10 and 13 -- too > big an age gap!) how to do some turtle graphics with Python. Neither had > programmed Python before -- one is a Minecraft ace and the other had done > Scratch.

Re: Installing 2.6 on Win 7

2011-09-09 Thread Brian Curtin
On Fri, Sep 9, 2011 at 15:04, ray wrote: > > I have not found binaries for this install.  The page > http://www.python.org/download/windows/ > takes me to > http://www.python.org/download/releases/ > which goes to > http://www.python.org/download/releases/2.6.7/ > Here are Gzip and Bzip tar balls.

Re: Python bug in Windows 8--report now, or later?

2011-09-19 Thread Brian Curtin
On Sat, Sep 17, 2011 at 13:01, Kevin Walzer wrote: > I have been testing my Python application on the just-released developer > preview of Windows 8 and have noted an error: the application does not > create an app folder in the user's "application data" directory. This causes > the app to crash o

Re: pyWin build 216

2011-09-23 Thread Brian Curtin
On Fri, Sep 23, 2011 at 09:25, python wrote: > I have used pyWin for several years now with out issue.   I recently > installed build 216 for python 2.7 on windows XP pro.   The program > crashes every time I exit a wxPython program and has crashed a few > other times.  I does not seem that pyWin

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 15:54, Wanderer wrote: > How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says > > "Python 2.6.6 has been replaced by a newer security-fix only source > release of Python. Please download Python 2.6.7 instead." > > But there is no windows installer on the 2.6

PyCon 2012 Proposals Due October 12

2011-09-27 Thread Brian Curtin
...@python.org Brian Curtin - Publicity Coordinator - br...@python.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 16:32, Wanderer wrote: > I think it is strange to release a security update but not really expect > people > to use it. We expect that people who need 2.6 but won't move to 2.7, and at the same time are vulnerable to the security issue(s), would be able to compile Python

Re: Installing Python 2.6.7 on Windows

2011-09-29 Thread Brian Curtin
On Wed, Sep 28, 2011 at 19:10, Nobody wrote: > On Wed, 28 Sep 2011 15:21:25 -0700, Ned Deily wrote: > > > No, it was a deliberate decision. After a release is in security-fix > > mode only, we don't build Windows or Mac OS X installers for them. > > But you continue to offer the installers for t

Re: L.A. user group?

2011-10-06 Thread Brian Curtin
On Thu, Oct 6, 2011 at 12:24, Miki Tebeka wrote: > Greetings, > > Is there an L.A. Python user group out there? http://socal-piggies.org might work for you. They recently had a meeting in Santa Monica, and I believe many of the members are LA based. -- http://mail.python.org/mailman/listinfo/pyt

Re: How do I get curses to work in Python 3.2 on win-64?

2011-10-17 Thread Brian Curtin
On Sun, Oct 16, 2011 at 11:16, Jan Sundström wrote: > On 16 Okt, 06:59, Christoph Gohlke wrote: >> On Oct 15, 1:13 pm, Jan Sundström wrote: >> >> >> >> `import curses` should work. What exactly is the error message? Does >> `import curses` work outside your program/program directory? >> >> The c

Re: C API: Making a context manager

2011-10-31 Thread Brian Curtin
On Mon, Oct 31, 2011 at 13:34, Chris Kaynor wrote: > I am currently rewritting a class using the Python C API to improve > performance of it, however I have not been able to find any > documentation about how to make a context manager using the C API. > > The code I am working to produce is the fo

Re: Does anyone use Python Tools for visual studio?

2011-11-01 Thread Brian Curtin
On Tue, Nov 1, 2011 at 11:57, Wei wrote: > I got several buggy things going on. > First, the view of class tree stops expanding after creating more than > two classes. > Second, after 800 lines of code the classes and methods can't be > folded. (meaning the + sign is gone) > P.S. there is no warni

Re: Install Python on Windows without Start Menu icons?

2011-12-05 Thread Brian Curtin
On Fri, Dec 2, 2011 at 12:34, snorble wrote: > Is it possible to automate the Python installation on Windows using > the MSI file so it does not add a Start Menu folder? I would like to > push out Python to all of my office workstations, but I'd like for it > to be relatively silent from the user

Re: PyCon US 2012 sprints

2011-12-18 Thread Brian Curtin
g on. You might hear something like this: "Hi I'm Brian and I'll be hosting a sprint on foo project. We're going to be working on x, y, and z functionality using a lot of a, b, and c libraries. Come check it out of you're interested. We've got plenty of stuff for first

Re: Getting a patch accepted

2011-12-19 Thread Brian Curtin
On 19-12-11 18:13, Tycho Andersen wrote: > > Hi all, > > A couple months ago I found a bug in a corner of the curses library > (http://bugs.python.org/issue13051) and filed it. Unfortunately, there > was nobody listed to cc on the noisy list, so it probably got lost in > the shuffle. (There is even

Re: the slash & Windows paths

2011-12-19 Thread Brian Curtin
On Mon, Dec 19, 2011 at 16:02, Juan Declet-Barreto < juan.declet-barr...@mesaaz.gov> wrote: > All, > > ** ** > > I have a Windows-style path that I need to modify so Python functions can > find it. For example, the path > “C:\Projects\Population_Pyramids\charts\test.xls” is being interpreted a

Re: how to install lxml in window xp?

2012-01-11 Thread Brian Curtin
On Wed, Jan 11, 2012 at 23:01, Tamer Higazi wrote: > Use Linux! > Specially Gentoo Linux! Not a useful answer. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Brian Curtin
On Thu, Jan 12, 2012 at 22:34, Jason Veldicott wrote: > Hi, > > Long paths in python traceback are contracted with ellipses.  eg: >   TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" > > Is there any way to see the full path? > > Surprisingly, search didn't reveal an answ

PyOhio 2013 Call For Proposals

2013-04-16 Thread Brian Costlow
PyOhio 2013, the annual Python programming conference for Ohio and the surrounding region, is now accepting proposals for scheduled talks, tutorials, and panels. This year's PyOhio will will take place Saturday, July 27th, and Sunday, July 28th, 2013 at the Ohio Union, on the campus of The Ohio St

How to get urllib2 HTTPConnection object, use httplib methods?

2013-04-21 Thread Brian Raymond
I have a httplib based application and in an effort to find a quick way to start leveraging urllib2, including NTLM authentication (via python-ntlm) I am hoping there is a way to utilize an HTTPConnection object opened by urllib2. The goal is to change the initial opener to use urllib2, after t

Re: slice notation as values?

2005-12-10 Thread Brian Beck
the above... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/415500 -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-10 Thread Brian Beck
ymorphic > if (): >obj = D1() > else: >obj = D2() I have no idea what you're trying to do here and how it relates to polymorphism. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Brian Cully
[EMAIL PROTECTED] wrote: > C-programmer learning python : > > Hi, where is condition ? true : false > > someone prefer the if/else statement type: > > Can't you see that the following is much more readable, stupid(well not > the exact word but tone in such a way like words of messy or elegant > et

Re: python coding contest

2005-12-26 Thread Brian Beck
anonymous wrote: > are you importing zlib or bz2 ? I don't think either of these would help in this case. While the length of the compressed string might be significantly shorter than your solution, the resulting string *literal* you decompress will contain a bunch of \-escaped characters, so it

Re: python coding contest

2005-12-26 Thread Brian Beck
> I don't think either of these would help in this case. While the > length of the compressed string might be significantly shorter than > your solution, the resulting string *literal* you decompress will > contain a bunch of \-escaped characters, so it will end up being longer. PS: I'm at 155, d

Efficient mechanism for str.startswith on a set.

2006-01-10 Thread Brian Cole
y tree out of 'strs' but that's a little more work that don't have time to do today. I know there should be something out there if I just ask nicely enough. Thanks ahead of time. -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: [Zope] Applying updates to zope site

2006-01-10 Thread Brian Sullivan
On 1/9/06, Paul Winkler <[EMAIL PROTECTED]> wrote: > On Mon, Jan 09, 2006 at 12:24:57PM -0500, Brian Sullivan wrote: > > I considered Zsyncher a while ago -- the problem there though is that > > there are many things in the two sites that should not be synched -- > >

Extracting results from a large hotshot profile

2006-01-16 Thread Brian Cole
profile is 355 MB large. Is there anything I can do to extract that data? Thanks in advance, Brian Cole -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting results from a large hotshot profile

2006-01-16 Thread Brian Cole
ith installing wxPython and Numeric on my Linux box and see if that makes a difference. Thanks, Brian On 1/16/06, Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > Brian Cole wrote: > ... > > >I did a hotshot profile. To make this profile took > >about a day. However, I

Re: Extracting results from a large hotshot profile

2006-01-16 Thread Brian Cole
TED]> wrote: > Brian Cole wrote: > > >Thanks for the tip. I got the following error message when trying to > >run your profiler. > > > > > ... > > > File "c:\Documents and Settings\coleb2\My > > Documents\software\Python24\Lib\site > >

Re: Restarting scripts

2006-01-16 Thread Brian Cole
If everything dies by a Python exception... if __name__ == '__main__': try: main(sys.argv) except: os.execlp("python", "python", sys.argv) Pretty nasty peice of code, but it works well for restarting your script. -Brian On 1/16/06, Ron Gris

Re: Restarting scripts

2006-01-16 Thread Brian Cole
. Check out the signal module. There's probably other inventive ways to do this. It mostly depends on how your program is written. -Brian Cole On 1/16/06, Ron Griswold <[EMAIL PROTECTED]> wrote: > Thank you Brian. I gave this a shot and found that execlp was not able > to locate ei

Re: check to see if value can be an integer instead of string

2006-01-17 Thread Brian Cole
Python uses "Exceptions" to catch these "Exceptional" situations:http://docs.python.org/tut/node10.html -Brian Cole On 17 Jan 2006 18:51:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > thanks for the reply, but wont python fail out if you try to make an >

Compiling cx_Oracle and LD_LIBRARY_PATH

2006-01-21 Thread Brian Cole
nsion for that matter so that it's not required to set LD_LIBRARY_PATH? Is there a way I can make distutils do this for me? Thanks, Brian Cole -- http://mail.python.org/mailman/listinfo/python-list

packaging programs

2006-07-11 Thread Brian Blais
numpy/matplotlib, is there something which will locally package these modules to distribute with the program? What are the options here? Are there any good docs for this? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais --

Dictionary question

2006-07-18 Thread Brian Elmegaard
Hi I have written the following which works, but I would like to write it less clumsy. I have a dictionary in which I loop through the keys for a dynamic programming algorithm. If a key is present I test if its value is better than the current, if it is not present I just create it. Would it be p

Re: Dictionary question

2006-07-18 Thread Brian Elmegaard
Brian Elmegaard <[EMAIL PROTECTED]> writes: At least it was clumsy to post a wrong example. This shows what = find clumsy. c=1 x=2 l=list() l.append(dict()) l[0][5]=0 l.append(dict()) for a, e in l[-2].iteritems(): # Can this be written better? if a+c in l[-1]: if l

Re: Dictionary question

2006-07-18 Thread Brian Elmegaard
e two dicts in a list??? Can't you give them >names, like rawdatadict and maxdict? It's a dynamic programming problem, so this will contain as many dicts as hours in the year. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html Rugbyklubben Speed

Re: Dictionary question

2006-07-18 Thread Brian Elmegaard
"Justin Azoff" <[EMAIL PROTECTED]> writes: > last[keytotal] = min(last.get(keytotal), valtotal) > comes close to working - it would if you were doing max. Thanks, I think this would help. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.h

Re: Dictionary question

2006-07-18 Thread Brian Elmegaard
"Nick Vatamaniuc" <[EMAIL PROTECTED]> writes: > if l[-1].setdefault(a+c, x+e) l[-1][a+c]=x+e Thanks for the answer. I will try it. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html Rugbyklubben Speed Scandinavian Open 7s Rugby http://www.

Using Visual Slick Edit for Python

2006-07-18 Thread Brian Buderman
Anyone know if there is a way to make slickedit tag the built in modules such as os and sys so that code completion and the like work? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Visual Slick Edit for Python

2006-07-18 Thread Brian Buderman
Thanks very much. That should work nicely. We just upgraded to v11, so I'm not yet familiar with all the changes. The first noticable thing is the UI got a slight enhancement, as it seems to from one version to the next. I've not used it for Python yet (really only C so far), so I unfortunate

Re: Functions, Operators, and Overloading?

2006-07-24 Thread Brian Beck
Is that possible?) No, for the reason above -- there is no magic method associated with ++, which isn't a real Python operator. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

M2Crypto and general HTTPS help needed

2006-07-25 Thread McCann, Brian
ead through the documentation on M2Crypto (which is cryptic itself), and I know I'm still really stupid when it comes to Python, but I figured this would be a more obvious thing to do. Does anyone know how to do this, or suggest another package to use? Thanks! --Brian -*-*-*-*-*-*-*-*-*-*-*-*-

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Brian McFarland
Dumb question... but you're 100% positive your python install is in "C:\Program Files\Python24" and not just "C:\Python24" Right? Also, an alternative approach to being able to run python from the command line is to add it to the path variable in each instance of cmd.exe when it starts up. To

Re: Zipping files/zipfile module

2006-08-01 Thread Brian Beck
archive, but I'm assuming it just involves writing an arcname with a '/' in it (see help(zipfile.ZipFile)). -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Zipping files/zipfile module

2006-08-02 Thread Brian Beck
Yves Lange wrote: > Other solutions: > you can try the rar command line from WinRar but it's not recommended. > This is a very slow manner to compress file. Are you sure? This worked about 4 times faster than the zip command line utility in Linux, compressing the same files...

Re: Nice unicode -> ascii translation?

2006-08-06 Thread Brian Beck
[EMAIL PROTECTED] wrote: > The trick is finding the right . Has someone attempted this > before, or am I stuck writing my own solution? You want ASCII, Dammit: http://www.crummy.com/cgi-bin/msm/map.cgi/ASCII +Dammit -- Brian Beck Adventurer of the First Order -- http://mail.pyth

Re: Drawing a grid on a picture

2006-08-13 Thread Brian Quinlan
here is the link: http://www.pythonware.com/products/pil/ Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Syntax Highlighting Module

2006-08-21 Thread Brian Quinlan
base this upon existing open source code. My > question is there a python module or examples on how to write a code > editor which supports modulated syntax highlighting? Google: SilverCity Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode "table of character" implementation in python

2006-08-22 Thread Brian Beck
e for how to use it: http://www.amk.ca/python/howto/unicode I'm not sure if it has built-in support for finding which language block a character is in, but a table like this might help you: http://www.unicode.org/Public/UNIDATA/Blocks.txt -- Brian Beck Adventurer of the First Order -- htt

ANN: geopy 0.93 - Geocoding Toolbox for Python

2006-10-08 Thread Brian Beck
502: 38.89875, -77.03768 py> from geopy import distance py> _, a = us.geocode('10900 Euclid Ave, Cleveland, OH 44106') py> _, b = us.geocode('1600 Pennsylvania Ave, Washington, DC') py> distance.distance(a, b).miles 301.35526872700962 py> from geopy import util py>

Re: Convert StringIO to string

2006-10-16 Thread Brian Quinlan
.write("hello world\n") >>>> s.seek(0) >>>> s.read() > 'hello world\n' Or, instead of seak/read, just do >>> s.getvalue() Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

advice for web-based image annotation

2006-10-19 Thread Brian Blais
verse to learning the database end, but I don't want to climb that hill unless I feel there is a significant benefit. I don't have admin rights on the server, if that makes a difference. Any suggestions would be greatly appreciated! thanks,

Re: advice for web-based image annotation

2006-10-20 Thread Brian Blais
Paul Rubin wrote: > Brian Blais <[EMAIL PROTECTED]> writes: >> I want to set up a system where I can have my family members write >> comments about a number of pictures, as part of a family tree project. >> ...Any suggestions would be greatly appreciated! > > How

Re: Dealing with multiple sets

2006-10-25 Thread Brian Beck
et.union, sets) - reduce(set.intersection, sets) set([1, 2]) -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >