Re: chained attrgetter

2006-10-26 Thread Brian Beck
return obj I'll raise you one: def cattrgetter(attr): return lambda obj: reduce(getattr, attr.split('.'), obj) py> class A: pass py> a = A py> a.b = A py> a.b.c = "Hey!" py> cattrgetter('b.c')(a) 'Hey!' -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: chained attrgetter

2006-10-26 Thread Brian Beck
ument to reduce(), using operator.attrgetter just makes the definition more complicated (see my other post). -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing Hidden Character in Python

2006-10-27 Thread Brian Mills
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Thursday 26 October 2006 16:43, Wijaya Edward wrote: > > How can we print out the hidden character like > > "\n", "\r" etc in Python? > > If it's meant to evidentiate then you

idle with ipython

2006-11-02 Thread Brian Blais
h. thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: emacs shell hangs on W32 with python

2006-11-02 Thread Brian Elmegaard
[EMAIL PROTECTED] writes: > Is there any way to run python through emacs or xemacs without having > it hang or is shell support broken? Doing it from eshell gives the same problem :-( -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html Rugbyklubben

setting up wxPython on a Mac

2006-11-03 Thread Brian Blais
know Macs all that well, but is there something similar? Thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: setting up wxPython on a Mac

2006-11-03 Thread Brian Blais
Kevin Walzer wrote: > Brian Blais wrote: >> Hello, >> >> I have a wxPython program that I would like to give to a friend of mine >> who has a Mac. Is there a resource out there that can tell me what >> steps I need to follow to do this? >> > Install Py

python to NQC converter?

2006-05-31 Thread Brian Blais
thinking that 90% of it could be done by converting indentation to {}, cdef int X to int X declarations at the top, and other simple text-replace features. Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http

Re: New to Python: Do we have the concept of Hash in Python?

2006-06-01 Thread Brian Quinlan
default because they are not portable across database implementations. That being said, you can get them easily, if you want. Look at the "description" attribute of your cursor instance. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Sampling a population

2006-06-02 Thread Brian Quinlan
This is less a Python question and more a optimization/probability question. Imaging that you have a list of objects and there frequency in a population e.g. lst = [(a, 0.01), (b, 0.05), (c, 0.50), (d, 0.30), (e, 0.04), (f, 0.10)] and you want to drawn n items from that list (duplicates allowed

Re: Sampling a population

2006-06-02 Thread Brian Quinlan
so), then this > might be an attractive option. > > [1] http://www.jstatsoft.org/v11/i03/v11i03.pdf > Thanks a lot for the numpy implementation and for the literature reference! I'll try to figure out how little precision I need in my sampling. Cheers, Brian -- http://

Vancouver Python Workshop: New Keynoter

2006-06-06 Thread Brian Quinlan
orials for beginning programmers * advanced lectures for Python experts * case studies of Python in action * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or con

Vancouver Python Workshop - Talk submission reminder

2006-06-13 Thread Brian Quinlan
, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportuni

Possible inaccuracy in Python 2.4 when using profiler calibration

2006-06-15 Thread Brian Quinlan
takes less time than is accounted for in the bias measurement (which was generated by measuring the call time of a Python function). So the bias computation doesn't make sense in Python 2.4. What do y'all think? Is this a well known fact? Should I construct a test to see if C function call overhead is actually less than Python function call overhead? Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Vancouver Python Workshop - Talk submission deadline

2006-06-15 Thread Brian Quinlan
ction * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to lear

Vancouver Python Conference: T-Shirt design contest

2006-06-21 Thread Brian Quinlan
anpyz.org/conference/tshirt_contest.html BTW, you don't have to attend the conference to participate in the T-Shirt design. But you should attend the conference anyway, because it is going to be great. For information on the workshop, see: http://www.vanpyz.org/conference/ Cheers, Brian -- http:

Re: VPW: T-Shirt design contest

2006-06-22 Thread Brian Quinlan
rable lives bowing down in subservience to that sadistic little C++ compiler. Choose your future. Choose Python. I think that it might be a bit long to put on a T-Shirt but it is definitely cool :-) Still collecting ideas at: http://www.vanpyz.org/conference/tshirt_contest.html Cheers, Brian --

VPW: Talk schedule available

2006-06-26 Thread Brian Quinlan
, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportuni

replace a method in class: how?

2006-06-26 Thread Brian Blais
thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-27 Thread Brian Blais
Thanks for all who replied to this question about replacing a method. I feel a little sheepish for not having caught that I have to replace it in the class, not the instance, but I have found a very similar problem trying to replace a method using a function defined in pyrex. I post all of

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Brian Blais
Greg Ewing wrote: > Brian Blais wrote: >> I have found a very similar problem trying to replace a method using a >> function defined in pyrex. > > > What *should* work is to define the method inside a > class in Pyrex (plain class, not extension type) and >

VPW: early registration deadline

2006-06-28 Thread Brian Quinlan
vents * informative keynote speakers More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportunity to

VPW: early registration deadline today!

2006-06-30 Thread Brian Quinlan
ynote speakers More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportunity to visit one of the

Re: Newbie programmer question: How do parsers work?(Python examples?)

2006-08-25 Thread Brian Mills
(including newline characters), are usually best read with something like split([seperator]), which will return an array of each element in the string you give it. Example: >>> str='Brian,student,California,555-0127' >>> tokens = str.split(',') >>>

[ANN] geopy: a Geocoding Toolbox for Python

2006-09-07 Thread Brian Beck
$ svn co svn://exogen.case.edu/geopy/trunk geopy-trunk $ cd geopy-trunk/ $ sudo python setup.py install ...or use easy_install: $ sudo easy_install svn://exogen.case.edu/geopy/trunk Questions, comments, and bug reports can be directed to: [EMAIL PROTECTED] -- Brian Beck Adventurer of the First Or

Re: [ANN] geopy: a Geocoding Toolbox for Python

2006-09-09 Thread Brian Beck
Brian Beck wrote: > I'm happy to announce the first (alpha) release of geopy, a geocoding > toolbox for Python: http://exogen.case.edu/projects/geopy/ For anyone interested, there is now a mailing list on Google Groups: http://groups.google.com/group/geopy geopy also now supports

Re: Behaviour of classes (tired of writing too much)

2006-09-11 Thread Brian Quinlan
ay"? Which of these are considered usage: >>> a = Foo() # obviously >>> b = a # ? >>> a.__gt__(5) # apparently >>> a.__gt__# ? Anyway, look into __getattr__ Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python provide "Struct" data structure?

2006-09-22 Thread Brian Blais
Daniel Mark wrote: > > 1> Does Python provide such Struct in this standard libary. > Python has "4.3 struct -- Interpret strings as packed binary data", but > it looks like different > from what I really want to get. I like the following version: class Struct(dict): def __getattr__(self,na

Re: A critique of cgi.escape

2006-09-25 Thread Brian Quinlan
"just some guy" and people don't have a lot of incentive to convince you of anything. I have no opinion on the actual debate though. Just trying to help with the social analysis :-) Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

ANN: dmath 0.9 - Math routines for the Decimal type

2006-09-25 Thread Brian Beck
imal as D, getcontext >>> getcontext().prec = 50 >>> asin(D(1)) Decimal("1.5707963267948966192313216916397514420985846996876") >>> golden_ratio() Decimal("1.6180339887498948482045868343656381177203091798058") -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: dmath 0.9 - Math routines for the Decimal type

2006-09-25 Thread Brian Beck
Brian Beck wrote: > What is dmath? > == > dmath provides the standard math routines for Python's arbitrary-precision > Decimal type. These include acos, asin, atan, atan2, ceil, cos, cosh, > degrees, e, exp, floor, golden_ratio, hypot, log, log10, pi, pow, radian

Re: ANN: dmath 0.9 - Math routines for the Decimal type

2006-09-25 Thread Brian Beck
he rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies provided they keep the license text with the library. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: >> o cgi.escape is not meant for serious web application development, > > What is it meant for then? Why should the library ever implement > anything in a half-assed way unsuitable for serious application

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> A summary of this pointless argument: > > Your summary seems pretty reasonable, but please note that later on, > the thread was not about cgi.escape escaping (or not) quote > characters (a

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
about surprising behavior is not reasonable o it doesn't even make sense for an escape function to exist in the cgi module, so it should only be used by old applications for compatibility reasons Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
7;s system (yeah, we lifted some ideas from Django): test.html - {foo | escape} test.py --- t = Template("test.html") t['foo'] = 'Brian -> "Hi!"' assert str(t) == 'Brian -> "Hi"' So how would you test our template sys

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> Well, there are dozens (hundreds?) of templating systems for Python. > > I know, I wrote one of them ;-) > >> t = Template("test.html") >> t['foo'] = 'Bri

Re: A critique of cgi.escape

2006-09-27 Thread Brian Quinlan
ly, I wasn't kidding. I was basing this belief on greping through the Python standard library where only the quote=None form is ever used. It also matches my experience. But I don't have a large enough sample to make any claim either way. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-11-17 Thread Brian Blais
-colons at the ends of the Matlab lines, and all of your arrays will display and scroll like crazy on your screen. :) thanks all for making such a great set of tools! Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: > 4) [] and {} always create a new object every time they're evaluated. Not quite. The empty tuple is cached: >>> a = () >>> b = () >>> a is b True Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: > Brian Quinlan wrote: > >>> 4) [] and {} always create a new object every time they're evaluated. >> Not quite. The empty tuple is cached: >> >> >>> a = () >> >>> b = () >> >>> a is b >&g

Re: About alternatives to Matlab

2006-11-25 Thread Brian Blais
Phil Schmidt wrote: > > I'd love to use Python, but I'm not comfortable with the hardware side > of that. I'm certain that most, if not all data acquisition hardware > comes with DLL drivers, which I could interface with using ctypes. I'm > concerned though about spending more time messing around

Re: Sorting Multidimesional array(newbie)

2006-12-11 Thread Brian Mills
There's another (IMHO more readable) way to do it if you can afford defining a short little "compare" function, and telling .sort() to use that instead of its default: >>> def myListCmp(lst1, lst2): ... if lst1[0] < lst2[0]: return -1 ... if lst2[0] > lst2[0]: return 1 ... return 0 ... >>> a

Re: Sorting Multidimesional array(newbie)

2006-12-14 Thread Brian Mills
Fredrik Lundh wrote: > Brian Mills wrote: > > > There's another (IMHO more readable) way to do it if you can afford > > defining a short little "compare" function, and telling .sort() > > to use that instead of its default: > > > >>>&

automatically grading small programming assignments

2006-12-14 Thread Brian Blais
ow do others who teach Python handle this? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: automatically grading small programming assignments

2006-12-14 Thread Brian Blais
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > Then on your PC you can >> run a script that loads each of such programs, and runs a good series >> of tests, to test their quality... > What happens if someone-- perhaps not even someone in the class-- does > some version of os.system('rm -Rf /

Re: automatically grading small programming assignments

2006-12-14 Thread Brian Blais
Paddy wrote: > It might turn out to be a poor substitute for the personal touch, > especially If they are just starting to program. Oh, I didn't mean it to completely replace me grading things, but I think it would be useful if there were a lot of little assignments that could be done automatica

Re: automatically grading small programming assignments

2006-12-15 Thread Brian Blais
Dan Bishop wrote: > On Dec 14, 8:36 pm, Brian Blais <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> [EMAIL PROTECTED] wrote: >>> Then on your PC you can >>>> run a script that loads each of such programs, and runs a good series >>>&g

Re: find login name of user?

2006-12-31 Thread Brian Beck
Martin P. Hellwig wrote: > Speaking of that, is there any reason why there isn't any syntactic > sugar that gives the illusion of platform neutral fetching of the user > name? getpass.getuser() might come the closest: http://docs.python.org/lib/module-getpass.html -- Brian Beck

Re: More Efficient fnmatch.fnmatch for multiple patterns?

2007-01-08 Thread Brian Beck
r p in patterns: > if fnmatch.fnmatch(some_file_name, p): > return True I don't see anything in the fnmatch and glob modules... but I didn't look very hard because what the heck is wrong with the four line solution you have? Looks fine to me. -- Brian Beck Adventurer of the

numeric expression from string?

2006-02-04 Thread Brian Blais
lead to bad security problems (not that it's a big deal in my app, but still...) string.atof won't do the job. Is there a preferred way of doing this? thanks, Brian Blais -- - [EMAIL PROTECTED]

Numeric and matlab

2006-02-05 Thread Brian Blais
Numeric.arange(1,11,1) idx=Numeric.nonzeros(a) a=a[idx] % doesn't work and what about meshgrid? Do I use the fromfunction() in some way? Is there a resource that goes through comparisons like this? thanks, Brian Blais -- - [EMAIL PROTECTED]

Re: Numeric and matlab

2006-02-06 Thread Brian Blais
Robert Kern wrote: > A better place to ask would be [EMAIL PROTECTED] . By the > way, Numeric has undergone a rewrite and is now known as numpy. > thanks for the pointer! it is a bit confusing with all of the different numerical modules (Numeric, numpy, scipy, ScientificPython, numarray, etc...

Re: numeric expression from string?

2006-02-06 Thread Brian Blais
Steven D'Aprano wrote: > > It is good to be cautious. Big thumbs up. But what exactly are you worried > about? Do you think your users might enter something Evil and break their > own system? I'd suggest that's not your problem, and besides, it is hard > to think of anything they could do with eva

Re: Numeric and matlab

2006-02-06 Thread Brian Blais
Bas wrote: > I am also considering a switch from Matlab to NumPy/SciPy at some > point. > > Note that in the last version of Matlab (7?) you don't have to use > 'find', but you now can 'conditional arrays' as an index, so instead > of > idx=find(a>5); > a(idx)=6; > you can do: > cond=a>5; >

critique my code, please

2006-02-06 Thread Brian Blais
ng on context. There is a dialog class which allows you to edit/change the values, and a wrapper function of the form: new_params <== wrapper(old_params) which calls the dialog, and returns the updated params instance. thanks, Bri

RE: What editor shall I use?

2006-02-08 Thread McCann, Brian
I use it on XPvisit http://www.vim.org/download.php , and scroll down to the Windows section. --Brian > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Lad > Sent: Wednesday, February 08, 2006 10:08 > To: python-list@python

jump into the interpreter in a script

2006-02-08 Thread Brian Blais
u exit the interpreter, the script continues from where it left off. Is this possible in python? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailma

calculating on matrix indices

2006-02-16 Thread Brian Blais
Hello, In my attempt to learn python, migrating from matlab, I have the following problem. Here is what I want to do, (with the wrong syntax): from numpy import * t=arange(0,20,.1) x=zeros(len(t),'f') idx=(t>5) tau=5 x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError) #

Re: calculating on matrix indices

2006-02-16 Thread Brian Blais
Colin J. Williams wrote: > Brian Blais wrote: >> In my attempt to learn python, migrating from matlab, I have the >> following problem. Here is what I want to do, (with the wrong syntax): >> >> from numpy import * >> >> t=arange(0,20,.1

Re: calculating on matrix indices

2006-02-17 Thread Brian Blais
Robert Kern wrote: > The traceback tells you exactly what's wrong: > > In [7]: x[idx] = exp(-t[idx]/tau) > --- > exceptions.TypeError Traceback (most recent > call > last) > yes, I saw that,

strange error I can't figure out...

2006-02-18 Thread Brian Blais
Hello, I have an odd kind of Heisenbug in what looks like a pretty simple program. The program is a progress bar code I got at the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639 (including the code below) If you uncomment the one print statement I added in t

Re: strange error I can't figure out...

2006-02-18 Thread Brian Blais
John Zenger wrote: > It works fine for me. You must be having an indentation problem. > > Also, get rid of the comma at the end of that last print statement. > > Brian Blais wrote: >> Hello, >> >> I have an odd kind of Heisenbug in what looks like a pretty simpl

Re: strange error I can't figure out...

2006-02-18 Thread Brian Beck
John Zenger wrote: > Also, get rid of the comma at the end of that last print statement. This would break the progress bar functionality I think, which is meant to update a single line. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

algorithm, optimization, or other problem?

2006-02-21 Thread Brian Blais
lse anyone needs to know, I'll post it. I put the main script, and a dohebb.pyx code below. thanks! Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais # Main scrip

execfile error exception line number?

2006-02-23 Thread Brian Blais
an I get the line number in "somefile.py" where the error occurs? When I do the above, I get the line number in the script which calls execfile instead. thanks, Brian Blais -- - [EMAIL PROTECTED]

execfile time out?

2006-02-23 Thread Brian Blais
t has an infinite loop, I don't want to freeze at that point. If it helps, this part of the code is already running in a thread, so I guess I could time-out the thread rather than the execfile. Is there an easy way to do that? thanks, Brian Blai

sort one list using the values from another list

2006-02-26 Thread Brian Blais
;this','hello','there','that'] The sort method on lists does in-place sorting. Is there a way to do what I want here? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-04 Thread Brian Blais
sturlamolden wrote: > > Typically a scientist need to: > > 1. do a lot of experiments > > 2. analyse the data from experiments > > 3. run a simulation now and then > unless you are a theorist! in that case, I would order this list backwards. > > 1. Time is money. Time is the only thing th

Re: Python advocacy in scientific computation

2006-03-05 Thread Brian Blais
Robert Kern wrote: > > That said, we have an excellent array object far superior to Matlab's. > > http://numeric.scipy.org/ > I'd like to ask, being new to python, in which ways is this array object far superior to Matlab's? (I'm not being sarcastic, I really would like to know!) I've hear

empty lists vs empty generators

2005-05-02 Thread Brian Roberts
there a way that handles both lists and generators, so I don't have to worry about which one I've got? Thanks, Brian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice needed on __del__

2005-05-10 Thread Brian Quinlan
> in some later release or future plans. __del__ is not currently gauranteed to do anything. Currently it does something. Depending on that something is a bad idea. Could you explain your problem in more detail - maybe we'll have some suggestions. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Announce: Python for .NET 1.0 RC1 released

2005-05-10 Thread Brian Lloyd
Hi all - I'm happy to announce the release of Python for .NET 1.0 RC1. You can download it from: http://www.zope.org/Members/Brian/PythonNet Highlights of this release: - Implemented a workaround for the fact that exceptions cannot be new-style classes in the CPython interp

Interactive shell for demonstration purposes

2005-05-11 Thread Brian Quinlan
mited number of selectable fonts, it doesn't work terribly well. I've seen presentations using some sort of PyGame implemented shell. Does anyone have an information on that? Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Interactive shell for demonstration purposes

2005-05-11 Thread Brian Quinlan
; I've > given a few presentations using ipython on win32 and it worked alright > - but I suppose the projector quality is a factor here... I'll get by but I was hoping for something better. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Interactive shell for demonstration purposes

2005-05-12 Thread Brian Quinlan
properties > from the system icon, or get there by Alt-Space P etc. That's not bad. There are two caveats: 1. you have to set the width to 72 characters (instead of 80) at 1024x768 with 24 point fonts 2. you can't run in full-screen mode Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning Date As String ?

2005-05-14 Thread Brian Beck
ple: date.today().strftime("%B %d, %Y") -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: converting a set into a sorted list

2005-05-14 Thread Brian Beck
ect way to do >> so? Or must I >> >> list = [] >> >> for item in set1: >>list.append(item) >> >> list.sort() So, for this example, just do: sorted(set1) -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: appending key-value pairs to a dict

2005-05-20 Thread Brian Beck
: d = {} for filename in files: d[sha_func(filename)] = filename Or like so: d = dict([(sha_func(filename), filename) for filename in files]) -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Intellisense and the psychology of typing

2005-05-27 Thread Brian Beck
Well, there are two distinct features of IntelliSense as you know it. One is auto-completion and the other is contextual help. Auto-completion is included almost all beefy Python IDE's. Contextual help is included even in IDLE, where if you begin typing a function call, its docstring pops up arou

Re: Pressing A Webpage Button

2005-06-01 Thread Brian Beck
Elliot Temple wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no luck. Check out mechanize: http://wwwsearch.sourceforge.net/mechanize/ -- Brian Beck Adventurer of the First Order

Announce: Python for .NET 1.0 RC2 released

2005-06-05 Thread Brian Lloyd
Hi all - I'm happy to announce the release of Python for .NET 1.0 RC2. You can download it from: http://www.zope.org/Members/Brian/PythonNet Highlights of this release: - Changed some uses of Finalize as a static method name that confused the Mono compiler and people readin

Saving/retrieving user preferences

2005-06-08 Thread Brian Wallis
This may be a FAQ,but I cannot find it. I want to save user preferences, window sizes, recently opened file names, etc for a python application and I am looking for a package that does this in a way that is portable across unix/linux and windows (and mac would be nice as well). Is there a 'stand

Re: Saving/retrieving user preferences

2005-06-08 Thread Brian Wallis
/linux and windows (and mac would be nice as well). Is there a 'standard' package for doing this in python? thanks, -- brian... -- http://mail.python.org/mailman/listinfo/python-list

Re: Saving/retrieving user preferences

2005-06-10 Thread Brian Wallis
Brian Wallis wrote: > I want to save user preferences, window sizes, recently opened file names, > etc for a python application and I am looking for a package that does this > in a way that is portable across unix/linux and windows (and mac would be > nice as well). Thank you all for

pickling problem

2007-06-07 Thread Brian Blais
dict, and take out all of the non-pickleable objects? I could replace them with something else (a tag of some sort, for me to reconstruct things later). thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.

database design help

2007-06-23 Thread Brian Blais
equence field? Am I thinking about this correctly? Is there a resource I can read that goes through any of this? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a Python app with Mozilla

2007-06-30 Thread Brian Quinlan
XUL and JavaScript. The editor is Scintilla (C++). ../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc ... ... 126392 456858 4949602 total This doesn't include the python code in the Python libraries themselves. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: good matlab interface

2007-07-02 Thread Brian Blais
On Jun 30, 2007, at 2:31 AM, felix seltzer wrote: > Does any one know of a good matlab interface? > I would just use scipy or numpy, but i also need to use > the matlab neural network functions. I have tried PyMat, but am > having > a hard time getting it to install correctly. > What problems

python and COM

2007-04-27 Thread Brian Blais
led". I have no idea how to get this to point to a python function, so I can make the AdxList.OnUpdate call python code. Is there a tutorial somewhere about this stuff, or is there a proper place to ask such questions? thanks, Brian Blais -- --

Organizing code - import question

2007-05-03 Thread Brian Blais
ying the code from Common into the other two directories, and making a link to the Part1 directory in the Part2 so I can import it. There must be a better way, yes? thanks, Brian Blais -- - [

Re: Organizing code - import question

2007-05-03 Thread Brian Blais
Carlos Hanson wrote: > It looks like you need __init__.py in MyPackage. Then you can import > starting with MyPackage. For example, you might use one of the > following: > > import MyPackage > from MyPackage.Common import * > etc > that means that MyPackage must be in the sys path too?

Cherrypy setup questions

2007-05-22 Thread Brian Blais
for port 8080, or is there only one, and the two apps share it? Are there any examples that show such a setup? I didn't see a CherryPy mailing list, so I'm posting here, but if there is somewhere else better I'd be glad to know!

Re: Cherrypy setup questions

2007-05-23 Thread Brian Blais
fumanchu wrote: > On May 22, 6:38 pm, Brian Blais <[EMAIL PROTECTED]> wrote: >> I'd like to start trying out some cherrypy apps, but I've >> been having some setup problems. I think I need some >> bone-head simple example to clear my understanding. :) &

Re: Cherrypy setup questions

2007-05-23 Thread Brian Blais
fumanchu wrote: > > No, you're not missing anything; my fault. I wasn't very awake when I > wrote that, I guess. Don't include the hostname, just write: > > sn = '/~myusername/apps' > cherrypy.quickstart(Root(), sn, config) > yay! Thanks, that works perfectly.

Re: Python and GUI

2007-05-24 Thread Brian Blais
rward, practical, and pythonic solution out there. Do others think like me here? thanks, Brian Blais -- - [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Tix not properly installed on OS X?

2007-07-24 Thread Brian Blais
rections seems a bit daunting, and I don't want to mess up something that is already there. Can someone help me? thanks, Brian Blais -- Brian Blais [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: Tix not properly installed on OS X?

2007-07-24 Thread Brian Blais
nough to have the headers from the source of tcl? I just don't want to break something that is already there. thanks! bb -- Brian Blais [EMAIL PROTECTED] http://web.bryant.edu/~bblais -- http://mail.python.org/mailman/listinfo/python-list

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Brian Jones
efer not to have to learn a framework. Also, I just want to point out that in my discussions with other people who consider themselves primarily Python coders, there are plenty of them who still turn to PHP for web development. I got into Python for systems programming (sysadmin tasks and network pro

Re: Compile python with Mingw

2007-07-28 Thread Brian Elmegaard
stall". > And you will get a python built with mingw. It would be nice if this was the situation. I just tested without success. Do you say that the instructions in e.g. the first three hits on http://www.google.com/search?q=python+mingw are no longer relevant? -- Brian (remove the

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