Re: [Python-ideas] Enhancing Zipapp

2020-01-07 Thread Brett Cannon
n app, the interpreter will check first if the > app-specific > site-packages folder is empty, if not, install the wheels. This provides > package- > freezing ability. The only downside is longer first-run time. > Install the wheels where? You can't do that globally. And you also h

Re: Software to Control RGB Strips

2017-01-13 Thread Brett Salyer
On Friday, January 13, 2017 at 1:07:40 PM UTC-5, Brett Salyer wrote: > Hey all, > > I was debating on getting some RGB light strips for my room. I noticed, from > this tutorial: > > http://popoklopsi.github.io/RaspberryPi-LedStrip/#!/ws2812 > > > there is a WS28

Re: Porting Python Application to a new linux machine

2015-09-03 Thread Brett Kugler
look into a more robust solution like placing your application environment into something like a Docker container. This would require your customer machine to be running Docker, but it makes deployments highly portable as the container will sit on top of just about any Linux flavor and can be entirely self contained. Brett -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-11 Thread Brett Cannon
On Thu Dec 11 2014 at 3:14:42 PM Dan Stromberg wrote: > On Thu, Dec 11, 2014 at 11:35 AM, Mark Roberts wrote: > > I disagree. I know there's a huge focus on The Big Libraries (and > wholesale > > migration is all but impossible without them), but the long tail of > > libraries is still incredibl

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Brett Cannon
On Mon, Sep 9, 2013 at 8:02 AM, Larry Hastings wrote: > > On behalf of the Python development team, I'm chuffed to announce the > second alpha release of Python 3.4. > > This is a preview release, and its use is not recommended for > production settings. > > Python 3.4 includes a range of improve

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Brett Cannon
On Wed, Dec 21, 2011 at 05:57, Jim Fulton wrote: > On Wed, Dec 21, 2011 at 2:15 AM, Chris Withers > wrote: > > Hi All, > > > > What's the general consensus on supporting Python 2.5 nowadays? > > > > Do people still have to use this in commercial environments or is > everyone > > on 2.6+ nowadays

Re: Error when deleting and reimporting subpackages

2011-08-22 Thread Matthew Brett
On Monday, August 22, 2011 12:06:44 PM UTC-7, Stephen Hansen wrote: > On 8/22/11 11:51 AM, Matthew Brett wrote: > > Hi, > > > > I recently ran into this behavior: > > > >>>> import sys > >>>> import apkg.subpkg > >>>> d

Error when deleting and reimporting subpackages

2011-08-22 Thread Matthew Brett
Hi, I recently ran into this behavior: >>> import sys >>> import apkg.subpkg >>> del sys.modules['apkg'] >>> import apkg.subpkg as subpkg Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'subpkg' where 'apkg' and 'subpkg' comprise empty _

Re: [Tutor] Which non SQL Database ?

2010-12-04 Thread Brett Ritter
s a package for older pythons. Berkeley DB is pretty much interchangeable with SQLite in terms of functionality. I much prefer SQLite. If your web application intends to have multiple users interacting with the same data, neither is probably a good fit. -- Brett Ritter / SwiftOne swift...@swift

Re: Subprocess Call works on Windows, but not Ubuntu

2010-11-23 Thread Brett Bowman
Ah, that fixed it. Thank you. On Tue, Nov 23, 2010 at 11:37 AM, Chris Rebert wrote: > On Tue, Nov 23, 2010 at 11:28 AM, Brett Bowman wrote: > > I ran into an interesting problem trying to spawn a subprocess, so I > thought > > I'd ask if the experts could explain it

Subprocess Call works on Windows, but not Ubuntu

2010-11-23 Thread Brett Bowman
I ran into an interesting problem trying to spawn a subprocess, so I thought I'd ask if the experts could explain it to me. I'm spawning a subprocess to run "pdf2txt.py", which is a tool that is distributed with PDFminer to do moderately advanced text-dumps of PDFs. Yet when I run the same code o

Re: Cannot Remove File: Device or resource busy

2010-11-17 Thread Brett Bowman
ov 16, 2010 at 11:25 PM, Dennis Lee Bieber wrote: > On Tue, 16 Nov 2010 17:37:10 -0800, Brett Bowman > declaimed the following in gmane.comp.python.general: > > > > > And then I test the result: > > try: > > pdf_handle = open(outputFile, "rb")

Cannot Remove File: Device or resource busy

2010-11-16 Thread Brett Bowman
age - the standard error message from rm and if I use: cwd = os.getcwd() os.remove(cwd + "\\" + pdfFile) I get "WindowsError: [Error 32]" saying much the same thing. What am I missing? Any suggestions would be appreciated. Details: Python 2.6 Windows XP Sincerely, Brett Bowman -- http://mail.python.org/mailman/listinfo/python-list

Fixing PDF EOF Errors with PyPDF

2010-11-14 Thread Brett Bowman
ully with Adobe Acrobat Reader. Is this code inorrect or is there some other way to correct this error? Or does the code depend on the system? (I'm using Windows XP, but I believe the author was using a *nix) Sincerely, Brett Bowman -- http://mail.python.org/mailman/listinfo/python-list

Re: Copy Protected PDFs and PIL

2010-11-12 Thread Brett Bowman
hich prints the following: 1 2 3 4 5 FATAL PDF disallows copying Any help or suggestions would be appreciated. /b/ On Thu, Nov 11, 2010 at 12:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Brett Bowman
Windows currently, though I also have a Linux box running Ubuntu if need be. On Thu, Nov 11, 2010 at 12:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs > for my company, but a few hundred of them are copy protected. To make >

Copy Protected PDFs and PIL

2010-11-11 Thread Brett Bowman
dies. An automated way to snap a picture of the PDFs would be ideal, but I'd settle for a way to skip over them without crashing my program. Any tips? Brett Bowman Bioinformatics Associate Cibus LLC -- http://mail.python.org/mailman/listinfo/python-list

Re: zlib.decompress fails, zlib.decompressobj succeeds - bug or feature?

2010-05-09 Thread Matthew Brett
Hi, > > Do you mean, that you would then expect the decompressobj method to > > fail as well? > > Yes. > > > But, no, d.flush() returns the empty string after decompressing > > ``data``. > > Hmm, then it's a bug. Can you report it tohttp://bugs.python.org? I will - thanks for your advice, Matthe

Re: zlib.decompress fails, zlib.decompressobj succeeds - bug or feature?

2010-05-09 Thread Matthew Brett
Hi, Thanks for the reply. > > If instead I do this: > > > out = zlib.decompressobj().decompress(data) > > How about: > > d = zlib.decompressobj() > out = d.decompress(data) + d.flush() Do you mean, that you would then expect the decompressobj method to fail as well? But, no, d.flush() returns t

zlib.decompress fails, zlib.decompressobj succeeds - bug or feature?

2010-05-09 Thread Matthew Brett
Hi, I sorry if this is a bad place to ask, but I wanted to find out if the behavior I'm seeing is a bug. I maintain scipy's matlab file readers, and I came across a zlib compressed string that causes a zlib error on decompression, but only with zlib.decompress, not zlib.decompressobj. I saved th

Re: odd mmap behavior

2009-10-21 Thread Brett
On Oct 21, 8:02 am, Carl Banks wrote: > On Oct 20, 5:03 pm, Brett wrote: > > > > > I'm trying to read and write from /dev/mem on a linux system using the > > mmap module. When I run this minimal example: > > --- > > import os

odd mmap behavior

2009-10-20 Thread Brett
I'm trying to read and write from /dev/mem on a linux system using the mmap module. When I run this minimal example: --- import os, mmap MAP_MASK = mmap.PAGESIZE - 1 addr = 0x48088024 f = os.open("/dev/mem", os.O_RDWR | os.O_SYNC) m = mmap.mmap(f, mmap.PAGESIZE, mmap.

Re: expandtabs acts unexpectedly

2009-08-19 Thread Peter Brett
eturned > > Is it a bug or something, please advice. Consider where the 4-space tabstops are relative to those strings: test test testtest ^ ^ ^ So no, it's not a bug. If you just want to replace the tab characters by spaces, use: >>> " test\ttest&quo

Re: Extract the numeric and alphabetic part from an alphanumeric string

2009-08-03 Thread Peter Brett
is this what you wanted to do? >>> p = re.compile(r'^\d+') >>> p.sub('', '123ACTGAAC') 'ACTGAAC' Regards, Peter -- Peter Brett Remote Sensing Research Group Surrey Space Centre -- http://mail.python.org/mailman/listinfo/python-list

Re: Regexp problem

2009-07-30 Thread Peter Brett
xps for quite a while with no great success, I learnt the hard (and best) way, i.e. using them to write something vile and horrible. [*] I commend this path to you also. ;-) Cheers, Peter [*] http://git.gpleda.org/?p=gaf.git;a=blob;f=libgeda/desktop-i18n;h=6fab9b85b -- Peter Brett Remote Sensing Research Group Surrey Space Centre -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp mentality vs. Python mentality

2009-04-25 Thread Brett Hoerner
is even going on here? I, for one, would take Martin's any day of the week. It reads like good pseudocode as much "proper" Python does. Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread Brett Cannon
> - if it is a directory, it checks for .pkg files. If it finds any, > it processes them, extending __path__. > - it *then* checks for __init__.py, taking the first hit anywhere > on __path__ (just like any module import would) Just so people know how this __init__ search cou

Re: Using xreadlines

2009-02-27 Thread Brett Hedges
and it does not seem to work. The files.tell() command seems to give me a number but when I use the files.next() command with xreadlines it does not change the line number the next time I use files.tell(). Thanks, Brett --- On Thu, 2/26/09, bearophileh...@lycos.com wrote: > Fro

Using xreadlines

2009-02-26 Thread Brett Hedges
= "Section 1" for line in f: if Name in line: while x<20 field = files.next() if "2.6" in field: *files.previousline()* break x=x+1 Thanks, Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple parameter unpacking in 3.x

2008-10-07 Thread Brett C.
't want to follow python-dev or python-3000 but still have your opinion be heard. The other way is to subscribe to the PEP news feed (found off of http://www.python.org/dev/peps/) to keep on top of PEPs as practically all language changes have to result in a PEP at some point. And of course the last option is to follow python-dev. =) -Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: What Python looks like

2008-08-05 Thread Brett Ritter
On Aug 4, 3:43 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > A page of Python code looks *clean*,  with not a lot of > punctuation/special symbols and (in particular) no useless lines I am actually going to buck the trend. My first impression of Python was that it was visually hard to parse. When

Re: Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Brett g Porter
Robert Dailey wrote: This is an example of a response I'm looking for: "The self parameter is required because the parser is a bit old and needs to know the exact object you're referencing" This is _not_ an example of what I'm looking for: "Specifying self is a great mysterious thing that we

Re: Module clarification

2008-07-28 Thread Brett Ritter
On Jul 28, 4:54 am, Hussein B <[EMAIL PROTECTED]> wrote: > Hi. > I'm a Java guy and I'm playing around Python these days... > In Java, we organize our classes into packages and then jarring the > packages into JAR files. > What are modules in Python? > What is the equivalent of modules in Java? I'

Re: Simple Path issues

2008-07-26 Thread Brett Ritter
On Jul 26, 2:57 pm, Gary Josack <[EMAIL PROTECTED]> wrote: > sys.path is a list that will tell you where python is looking. You can > append to this in your scripts to have python look in a specific > directory for your own modules. I can, but that is almost certainly not the standard way to devel

Simple Path issues

2008-07-26 Thread Brett Ritter
New to Python, and I have some questions on how to best set up a basic development environment, particular relating to path issues. Note: I am not root on my development box (which is some flavor of BSD) Where should I develop my own modules so as to refer to them in the standard way. I.E. I wan

Re: Python program as daemon?

2008-07-25 Thread Brett g Porter
Johny wrote: Is it possible to run a Python program as daemon? Sure -- see http://code.activestate.com/recipes/66012/ for an example (and some useful stuff in the comments.) -- http://mail.python.org/mailman/listinfo/python-list

New to Python, familiar with Perl - Seeking info sources

2008-07-24 Thread Brett Ritter
After many years happily coding Perl, I'm looking to expand my horizons. [no flames please, I'm pretty aware of Perl's strengths and weaknesses and I'm just here to learn more, not to enter religious debates]. I've gone through some of the online tutorials and I'll be browsing the reference before

Pickling exception object works in 2.4 but not 2.5

2008-06-05 Thread Brett Elliott
In 2.5, this is what I get: Python 2.5.2 (r252:60911, May 7 2008, 15:19:09) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class Foo(Exception): ... member = None ... def __init__(self,member): ... self.member=membe

Re: Python MIDI in 2008

2008-05-06 Thread Brett g Porter
Maciej Bliziński wrote: For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. Some packages don't seem to be really used, for instance po

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Brett Cannon
X 10.5.2 (gcc 4.0.1) for 2.37 I am getting a ton of: sem_post: Bad file descriptor sem_init: Function not implemented sem_trywait: Bad file descriptor -Brett -- http://mail.python.org/mailman/listinfo/python-list

Call for volunteers to help maintain bugs.python.org's issue tracker

2008-02-19 Thread Brett Cannon
ready and those that will in the future! -Brett Cannon Chairman, PSF infrastructure committee -- http://mail.python.org/mailman/listinfo/python-list

Re: Curses and Threading

2008-02-03 Thread Brett . Friermood
multiple threads with curses now I think I will be set. -Brett -- http://mail.python.org/mailman/listinfo/python-list

Announcing the Python core sprint at PyCon 2008

2008-01-29 Thread Brett Cannon
r the sprint by the end of February as an email on what you need to do beforehand will be sent at that time based on the sprint sign-up page. And if you are not attending PyCon, we will most likely have several people in attendance on IRC, thus allowing even people not at PyCon to participate! -

Re: Curses and Threading

2008-01-22 Thread Brett . Friermood
oesn't work. I guess what I'm trying to say is how can I tell the main thread what to do when it doesn't exist in my code? Thanks for the help -Brett -- http://mail.python.org/mailman/listinfo/python-list

Curses and Threading

2008-01-21 Thread Brett . Friermood
).start() finally: curses.nocbreak() stdscr.keypad(0) curses.echo() curses.endwin() I can't figure out why the cursor still shows and why they terminal is screwed up afterward because the finally: should catch any failures and reset the terminal. -Brett -- http://mail.python.org/

Issue tracker migration is complete

2007-08-23 Thread Brett Cannon
mailing list. And if I forgot someone, thanks to them as well. =) -Brett Cannon Chairman, PSF Infrastructure committee -- http://mail.python.org/mailman/listinfo/python-list

Moving Python's tracker to Roundup on Aug 23rd

2007-08-20 Thread Brett Cannon
this gap to be for a few hours. But to minimize issues, please try to avoid using either SourceForge or the new issue tracker on Aug 23rd if you can. -Brett Cannon Chairman, PSF Infrastructure committee -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration over strings

2007-07-31 Thread Brett g Porter
Robert Dailey wrote: > Hi, > > I have the following code: > > str = "C:/somepath/folder/file.txt" > > for char in str: > if char == "\\": > char = "/" > > The above doesn't modify the variable 'str' directly. I'm still pretty > new to Python so if someone could explain to me why th

Secured CPython interpreter in embedded situations

2007-06-20 Thread Brett C.
e a branch. Thanks in advance to anyone who gives the code a whirl. -Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
s.google.com/group/comp.lang.python/browse_thread/thread/a7b9f3c03fb49aa/0e793beec82884f0?lnk=gst&q=size+object&rnum=4#0e793beec82884f0 Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
u mean "how many bytes does this object take in memory" - and I believe the short answer is no. Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: Eureka moments in Python

2007-03-13 Thread Brett g Porter
Dustan wrote: > On Mar 13, 10:05 am, Brett g Porter <[EMAIL PROTECTED]> wrote: >> Steven D'Aprano wrote: >>> I'd be interested in hearing people's stories of Eureka moments in Python, >>> moments where you suddenly realise that some task which see

Re: Eureka moments in Python

2007-03-13 Thread Brett g Porter
Steven D'Aprano wrote: > I'd be interested in hearing people's stories of Eureka moments in Python, > moments where you suddenly realise that some task which seemed like it > would be hard work was easy with Python. Mine was definitely when I was first working with the xmlrpc module, and I was pu

Re: calling a class instance of function

2006-12-20 Thread Brett Hoerner
Brett Hoerner wrote: > Also, in order to call a function without arguments you still need to > use (), so you probably wanted to use pid.original() in your pid.add > call. Sorry, never mind this bit, I misread the line. But you do probably want to change the class test into a func

Re: calling a class instance of function

2006-12-20 Thread Brett Hoerner
nted to use pid.original() in your pid.add call. Brett Hoerner -- http://mail.python.org/mailman/listinfo/python-list

Re: Negative integers and string formating

2006-10-23 Thread Brett Hoerner
Steven D'Aprano wrote: > Are there any string formatting codes that will place a space between the > sign and the number? Not that I know of, why not use the absolute value (after checking if it is negative), In [1]: abs(-1) Out[1]: 1 -- http://mail.python.org/mailman/listinfo/python-list

PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-20 Thread Brett Cannon
f who hosts the tracker).  The administrators and python-dev can then begin working towards deciding what we want from the tracker and its configuration. Once again, thanks to the volunteers for stepping forward to make this happen!-Brett CannonPSF Infrastructure committee chairman -- http://mail.pytho

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread Brett Hoerner
an't use anything but CPython software...? Brett Hoerner -- http://mail.python.org/mailman/listinfo/python-list

Re: why should dict not be callable?

2006-10-17 Thread Brett Hoerner
[EMAIL PROTECTED] wrote: > A couple of times recently I've come across this problem: I have a > large list to sort and I need to the the "key=function" argument to > sort appropriately. But I actually have the key mapping in a big > dictionary. Is this what you mean? I suppose the lambda is an

Re: Ok. This IS homework ...

2006-10-14 Thread Brett Hoerner
spawn wrote: > Actually, they do end. If I > move my "guess" variable outside the outermost loop, then it becomes > infinte. I know, I tried it. Huh? When does "running" ever evaluate to false (therefore breaking either of the loops)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ok. This IS homework ...

2006-10-14 Thread Brett Hoerner
tal = guess + subtotal You keep adding the original input (subtotal) to the most recent guess, and printing "running_total". You never re-assign subtotal or make use of running_total in your deepest loop. Also, you never break out of your deepest loop, why are you using two nested inf

Re: preserving color ouput of a shell command via os.popen()

2006-09-26 Thread Brett Hoerner
t;> f = a.read() >>> f 'bin\nboot\ndev\netc\nhome\nlib\nlost+found\nmedia\nmisc\nmnt\nnet\nopt\nproc\nroot\nsbin\nselinux\nsrv\nsys\ntmp\nusr\nvar\n' >>> See the difference? :) Brett Hoerner -- http://mail.python.org/mailman/listinfo/python-list

Detecting window focus events in PyGTK

2006-08-28 Thread Peter TB Brett
Hi folks, I'm currently trying to work out how to detect when a PyGTK window receives the focus from the window manager -- I assume that it must receive some kind of X event, but I can't work out which signal it generates. Searching around the subject on the web doesn't seem to pull up anything us

Re: do people really complain about significant whitespace?

2006-08-09 Thread Brett g Porter
being consistent). Pushing the scutwork down onto tools is not as good a solution as eliminating the scutwork, especially when it shouldn't be necessary at all... -- // Brett g Porter * [EMAIL PROTECTED] // http://www.bgporter.net/blog -- http://mail.python.org/mailman/listinfo/python-list

Four issue trackers submitted for Infrastructue Committee's tracker search

2006-08-07 Thread Brett Cannon
e who took the time and effort to set up a test tracker to help improve the development of Python.- Brett Cannon  Chairman, PSF Infrastructure Committee -- http://mail.python.org/mailman/listinfo/python-list

Using PyQT and OpenGL

2006-07-26 Thread Peter TB Brett
Hi folks, Although the PyQt documentation indicates that QGLWidget & friends have been ported to Python for the PyQt bindings, I'm not entirely sure what's necessary to make the normal OpenGL/GLUT interface available. Does PyQt work okay with PyOpenGL? Or is a more complicated workaround needed

Re: xmlrpclib and methods declared at runtime

2006-07-26 Thread Brett g Porter
but in cases like this where you don't know in advance what the class will need to handle, it lets your code hide the magic in a way that lets the users of your code forget that there's anything magic going on at all. It just looks like code. -- // Brett g Porter * [EMAIL PROTECTED] // http://www.bgporter.net/blog -- http://mail.python.org/mailman/listinfo/python-list

Re: String handling and the percent operator

2006-07-13 Thread Brett g Porter
Justin Azoff wrote: > Tom Plunket wrote: >> boilerplate = \ >> """ > [big string] >> """ >> >> return boilerplate % ((module,) * 3) >> [deletia...] > Of course.. > stuff = {'lang': 'python', 'page': 'typesseq-strings.html'} print """I should read the %(lang)s documentation at

About a month until PSF call for test trackers closes!

2006-07-06 Thread Brett Cannon
estions or concerns, please email infrastructure at python.org (it is subscription-protected, but your email will be accepted; the subscription page is at http://mail.python.org/mailman/listinfo/infrastructure ).  Thank you to those that have helped so far and those that do in the future.-Brett CannonCha

Request for trackers to evaluate as SF replacement for Python development

2006-06-06 Thread Brett Cannon
frastructure at python.org .- Brett Cannon  Chairman, Python Software Foundation Infrastructure committee -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-web-based templating system

2006-04-28 Thread Brett g Porter
Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > Maybe the built-in string interpolation is sufficient? > > print "Hello %(name)s" % dict(name="Peter Pan") Or in recent pythons, the built-in string templating system (see http://docs.python.org/lib/node109.html) >>> from string import

Re: How to *Search* with google from inside my programme and get the search result?

2006-02-15 Thread Brett g Porter
I V wrote: > Frank Potter wrote: >> Does google supply some webservice to programmers? I did see > > Googling for "google api" gets you to: > > http://www.google.com/apis/ > > It appears to be a SOAP API, which you can access with python, but I > think you'll need a third-party library. Googling

Re: ordered sets operations on lists..

2006-02-12 Thread Brett Cannon
, is difficult thanks to things being so dynamic and thus not easy to guarantee to be correct between compile-time and run-time. -Brett -- http://mail.python.org/mailman/listinfo/python-list

RE: Python-list Digest, Vol 29, Issue 147

2006-02-10 Thread Brett Cohen
nope, we where one short plus mark just pulled out so now we're two short. if you can get ANYONE that would be great? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: 10 February 2006 02:21 To: python-list@python.org Subject: Python-li

Re: question about dictionaries

2006-01-19 Thread Brett Hoerner
tive type, see http://www.voidspace.org.uk/python/odict.html) dict datatypes do not maintain any specific order and aren't really meant to, they're just handy, 'fast' hash lookups. Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

2006-01-19 Thread Brett Hoerner
> 'food' or 'drink' > > 'food' > > > > >>> {'class': 'food' or 'drink'} > > {'class': 'food'} "or" returns the first true element, anything but False or None,

Re: URL 'special character' replacements

2006-01-09 Thread Brett g Porter
'/~connolly/'. unquote_plus(string) Like unquote(), but also replaces plus signs by spaces, as required for unquoting HTML form values. -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Accretion // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching with string and list

2005-12-13 Thread Brett g Porter
BartlebyScrivener wrote: > Even without the marker, can't you do: > > sentence = "the fabric is red" > colors = ["red", "white", "blue"] > > for color in colors: > if (sentence.find(color) > 0): > print color, sentence.find(color) > That depends on whether you're only looking for who

Re: new in programing

2005-12-09 Thread Brett Hoerner
Efrain Marrero wrote: > i want to now how to do this in python > this is java > > > for(int i=1 ; i<=lim ; i++){ > > for(int j=i+1; j<=lim+1; j++){ > > for(int k =j+1; k<=lim+2;k++){ > > for(int l=k+1 ; l<=lim+3;l++){ > >

Re: Mutability of function arguments?

2005-12-07 Thread Brett g Porter
erwise". If you're trying to return multiple values from a function, Python lets you do that >>> def multiFoo(x, y, z): ... return x*2, y*2, z*2 ... >>> x = 1 >>> y = 2 >>> z = 3 >>> x, y, z = multiFoo(x, y, z) >>> x 2 >>> y 4 >>> z 6 >>> -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Repetition is a form of change // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite flavor of Linux? (for python or anything else)

2005-12-04 Thread Brett Hoerner
I have to add another vote for Gentoo. I agree that you just "have less problems" on Gentoo. Updates are from source, but you don't have to update mid-day while working on a project... if you really want the new version of KDE (etc) then start an update and go to sleep, not a big deal. Portage (

Re: Basic about Python class

2005-11-27 Thread Brett Hoerner
Manuel11g wrote: > Hello, > I am a new programmer in Python and a need some help. Where can i get a > basic tutorial about Class. I don't know nothing about Object Oriented > Programming. Can you help me? http://diveintopython.org/object_oriented_framework/index.html -- http://mail.python.org/ma

Re: [Fwd: Re: hex string to hex value]

2005-11-22 Thread Brett g Porter
42) 66 >>> -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Repetition is a form of change // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - How do I import automatically?

2005-11-15 Thread Brett Hoerner
> I have written some functions in a file called btools.py. I would like > to import them automatically when I start up Python shell. Today I must > do it by hand like this > > >>> from btools import * > >>> dir() > ['__builtins__', '__doc__', '__name__', 'func1', 'func2', 'func3'] > >>> > > Is the

Re: How can I package a python script and modules into a single script?

2005-11-03 Thread Brett Hoerner
Would PythonEggs be close? It's basically a zip format with all the Python files inside, it would maintain the structure and not be a single script file, but would be a single .egg file... the end user would just run the script and all would be installed, essentially. http://peak.telecommunity.co

Re: putting an Icon in "My Computer"

2005-11-03 Thread Brett Hoerner
> I've been asked by my boss to put an Icon in WinXP's "My Computer" for > a utility we use around the shop. My tool of choice is of course > Python and therefore what I am using to attempt my given task. I have > no trouble putting Icons in the WinXP Toolbar using Python, but have > totally fail

Re: Python for .NET and IronPython

2005-11-02 Thread Brett Hoerner
earch "IronPython" on microsoft.com Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: Web based applications are possible with wxPython?

2005-10-18 Thread Brett Hoerner
I don't think this is possible, unless I am grossly misunderstanding. For the web, pretty much every "UI" is build with some variation of HTML (XHTML is the new standard) with JavaScript thrown in for fancy GUI-like interfaces. You can't use OS-native widgets in the web browser, no. -- http://m

Re: installer for amd64 build of python?

2005-10-13 Thread Brett Hoerner
SDK...? Seems counter-intuitive if so, but it does mention you can build 32 and 64-bit apps with it, I just assumed they would be uh, for Windows Server. Thanks again, Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: installer for amd64 build of python?

2005-10-13 Thread Brett Hoerner
As an aside to this, are there any freely available C compilers for Windows that can compile 64-bit binaries? I find nothing for Cygwin or MinGW... -- http://mail.python.org/mailman/listinfo/python-list

Re: installer for amd64 build of python?

2005-10-12 Thread Brett Hoerner
> Alternatively, does anyone have experience > of using the visual studio files in the PCBuild > directory under amd64? I don't have an answer for you, but just to clarity for future readers... based on the quote above, I assume you mean a native 64-bit build for Windows, right? You never stated

Re: Newbie needs help. Setting PYTHONDOCS to read HTML.

2005-10-11 Thread Brett Hoerner
That's because the Python docs come zipped up within a folder, for example: python_docs.tar.bz2 has a folder inside it called Python-Docs-2.4.2. You need to have C:\Python24\Python-Docs-2.4.2\ as the value if thats where that folder is, or wherever you unzipped it. I, personally, just took all t

Re: Newbie needs help. Setting PYTHONDOCS to read HTML.

2005-10-10 Thread Brett Hoerner
You can use Python regardless of the docs... of course. Not sure what you mean there. As far as setting an Environment Variable, though: (1) Right-Click My Computer, go to Properties (2) Go to the Advanced tab (3) Click Environment Variables (bottom middle-ish) (4) Under "User Variables" clic

Re: best Pythonic way to do this sort: Python newb

2005-10-09 Thread Brett Hoerner
(sorted is a built-in function in 2.4) def myFunction( data ): """ Take one of your set of 3, grab [2] (the 3rd) and do calcs, return value """ "do some math calculations to data[2]" return "result of calculations" sorted_list = sorted(myList, key=myFunction) List is sorted in the or

Re: change a value to NULL?

2005-10-05 Thread Brett Hoerner
I'm not sure what you mean, really, do you need an official Python "Null" value? Try None? In [6]: myCells = ['Mary', 'Bob', None, 'Joe'] In [7]: for cell in myCells: ...: if cell: ...: print cell ...: else: ...: print "NULL VALUE" ...: Mary Bob NULL VALUE J

Re: How is wxWindows related to Python?

2005-10-01 Thread Brett Hoerner
I guess it is referring to the closely related (maybe even same dev group? I don't know why the wxWindows docs would mention Python unless they specifically support the wxPython project, too.) "wxWindows + Python = wxPython wxPython is a Python extension module that provides a set of bindings fro

Re: Set up Windows environment with python

2005-09-29 Thread Brett Hoerner
I don't have experience with scipting this... but I know that resolution for example is stored in registry, and _that_ is what is loaded when you boot. I think most, if not all, of your changes will be found in the registry (for permenance). Also, have you checked out PyWin32? It's just a big pr

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Brett Hoerner
You get to spend all day in ipython? Can I have your job? -- http://mail.python.org/mailman/listinfo/python-list

Re: number of python users

2005-09-27 Thread Brett Hoerner
RHEL isn't really "big" on Distrowatch because Distrowatch is geared more towards users. RHEL 4.1 is using Python 2.3.4 now, btw. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling python scripts from C# programs

2005-09-22 Thread Brett Hoerner
David Wilson wrote: > http://www.ironpython.com/ It should be noted that they (?) don't seem to update that site anymore, you can find 0.9.1 here: http://workspaces.gotdotnet.com/ironpython There is also Boo, which is Python-like (with some differences) but is a .NET Language itself. I never und

  1   2   >