Re: Find the mime type of a file.

2012-01-25 Thread Chris Rebert
on-magic And there's an unrelated pure(?) Python standalone module from A-A-P: http://www.a-a-p.org/exec/ref-filetype.html Tip: google "file type detection python" Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Jobs for developers

2012-01-25 Thread Chris Withers
On 24/01/2012 19:02, Rima Al-Sheikh wrote: Hi There, We are looking to hire talented developers to join different teams.. Please use the job board rather than spamming the mailing list: http://www.python.org/community/jobs/ cheers, Chris -- Simplistix - Content Management, Batch

Re: Current Web URL

2012-01-25 Thread Chris Rebert
o, what if there are multiple browsers or browser windows open? Which URL bar would you want the URL from? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-25 Thread Chris Kaynor
On Wed, Jan 25, 2012 at 3:23 PM, Rick Johnson wrote: > On Jan 25, 3:45 pm, Ian Kelly wrote: > > On Wed, Jan 25, 2012 at 1:14 PM, Rick Johnson > > In all seriousness, the idea that "very" and "somewhat" are somehow > > better in this context than "pretty" just because "pretty" has another > > mean

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-25 Thread Chris Angelico
On Thu, Jan 26, 2012 at 2:01 PM, Rick Johnson wrote: > I believe we'll just have to "agree to disagree" on the issue of > pretty. However, let's take a step back and view this issue from a > global perspective. Ask yourself: > > Q: "Am i choosing my words carefully, or just blindly imitating other

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-25 Thread Chris Angelico
On Thu, Jan 26, 2012 at 4:14 PM, Steven D'Aprano wrote: > In the > same way that a native English speaker would never make the mistake of > using "organ" to refer to an unnamed mechanical device, so she would > never use "gadget" to refer to an unnamed body part. I dunno... every Sunday I press k

Re: Distributing methods of a class across multiple files

2012-01-26 Thread Chris Angelico
On Thu, Jan 26, 2012 at 2:19 AM, lh wrote: > Third, length. Well 5000 lines eh... I'm nowhere near that guess I can > stick with one file. Of all the source files I have at work, the largest is about that, 5K lines. It gets a little annoying at times (rapid deployment requires GCC to do its magic

Re: Distributing methods of a class across multiple files

2012-01-26 Thread Chris Angelico
On Fri, Jan 27, 2012 at 1:11 AM, Roy Smith wrote: > So, I'd say the driving principle should be that a function should do > one thing.  Every function should have an elevator talk.  You should be > able to get on an elevator with a function and when you ask it, "So, > what do you do?", it should b

PyPI - how do you pronounce it?

2012-01-27 Thread Chris Angelico
Hopefully this will be a step up from Rick's threads in usefulness, but I'm aware it's not of particularly great value! How do you pronounce PyPI? Is it: * Pie-Pie? * Pie-Pip, but without the last p? (same as above but short i) * Pie-Pea-Eye? * Something else? I've been saying Pie-Pea-Eye myself,

Re: PyPI - how do you pronounce it?

2012-01-28 Thread Chris Rebert
On Fri, Jan 27, 2012 at 11:48 PM, Chris Angelico wrote: > Hopefully this will be a step up from Rick's threads in usefulness, > but I'm aware it's not of particularly great value! > > How do you pronounce PyPI? Is it: > * Pie-Pie? Personally, yes. Reflecting up

Re: PyPI - how do you pronounce it?

2012-01-28 Thread Chris Angelico
On Sat, Jan 28, 2012 at 8:57 PM, Steven D'Aprano wrote: > Obviously that's pronounced Fin-tim-lin-bin-whin-bim-lim-bus-stop-F'tang- > F'tang-Olé-Biscuitbarrel. Ah, it's of British origin then. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging filter limitation, looks intentional?

2012-01-28 Thread Chris Withers
an feature additions. To be clear, I wasn't asking for a change to existing behaviour, I was asking for the addition of an option that would allow the logging framework to behave as most people would expect when it comes to filters ;-) cheers, Chris -- Simplistix - Content Management, B

Re: Job Opportunity: Software Engineers at growing start-up! (Philadelphia, PA area)

2012-01-28 Thread Chris Withers
On 26/01/2012 19:09, GardnerJessica wrote: We’re looking for talented engineers who are interested in working on hard problems. Please don't spam the list with jobs, use the job board: http://www.python.org/community/jobs/howto/ cheers, Chris -- Simplistix - Content Management,

Re: Questions regarding the daemon module.

2012-01-28 Thread Chris Rebert
documentation. Could someone > explain these discrepancies? You seem to have installed the "daemon" package: http://pypi.python.org/pypi/daemon/ If you read the PEP more closely, you'll see that the PEP 3143 reference implementation is instead the "python-daemon" package: http://pypi.python.org/pypi/python-daemon/ Both packages provide modules named "daemon", partially hence your confusion. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-28 Thread Chris Angelico
On Sun, Jan 29, 2012 at 8:23 AM, Ben Finney wrote: > Steven D'Aprano writes: >> > * Pie-Pie? >> >> Or that one. > > What flavour is it? https://www.youtube.com/watch?v=tKB4h9gvmm0> Concrete! Flavour of the month. Thanks for the responses, all. Looks like Pie-Pea-Eye has consensus (with hon ment

Re: object aware of others

2012-01-28 Thread Chris Angelico
On Sun, Jan 29, 2012 at 2:48 PM, Lee Chaplin wrote: > I am trying to create an object that is aware of other objects created > before itself, and when found, then copy some attributes from them, > something like: If you're looking only at other objects of the same class, the easiest way is to mai

Re: object aware of others

2012-01-28 Thread Chris Angelico
On Sun, Jan 29, 2012 at 4:12 PM, Terry Reedy wrote: > On 1/28/2012 11:02 PM, Chris Angelico wrote: >> >> If you're looking only at other objects of the same class, the easiest >> way is to maintain a list every time one is created. Then you just >> iterate o

Re: Reading Adobe PDF File

2012-01-28 Thread Chris Rebert
er.org/~euske/python/pdfminer/ > Or do I need to find a way to convert a PDF file into a text file?  If > so how? The pdf2txt.py script from the same package happens to do exactly this. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Does python(django) have an official database driver to access SQLFire

2012-01-29 Thread Chris Rebert
e.com/docs/DOC-16640 ) and docs mention only JDBC & ADO.NET support. A convoluted solution involving Jython or IronPython might be possible however. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: autoconf error on Windows

2012-01-29 Thread Chris Rebert
error code 1 > Full output: http://pastebin.com/Dp3aw077 Judging by the earlier "'sh' is not recognized as an internal or external command, operable program or batch file." error message and after scanning thru the setup.py, sounds like you need to have MinGW (http://www.mingw.org ) installed. FWICT, there don't seem to be any current Windows binaries for PyCrypto. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: autoconf error on Windows

2012-01-29 Thread Chris Rebert
> On Sun, Jan 29, 2012 at 8:07 PM, Chris Rebert wrote: >> On Sun, Jan 29, 2012 at 12:52 AM, Alec Taylor wrote: >>> PyCrypto's install is giving an autoconf error on Windows, whether I >>> install from the git repo or normally. >>> >>> Traceback (

Re: [Python-Dev] #include "Python.h"

2012-01-29 Thread Chris Angelico
and proper division of code into multiple source files, that's not a significant concern. In any case, the worst that can happen is overly-large intermediate (.o or .obj) files; by the time the final binary is built, any duplicates will have to have been "folded down" to one anyway. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Chris Angelico
On Mon, Jan 30, 2012 at 11:12 PM, Neil Cerutti wrote: > > The British pronunciation of Beauchamp created a minor incident > at Yeoman of the Guard auditions this weekend. What about Sir Richard "Chumley", the "Left Tenant" of the Tower? Although this is now quite off-topic for this list... Chri

TestFixtures 2.3.4 Released!

2012-01-31 Thread Chris Withers
http://www.simplistix.co.uk/software/python/testfixtures Any questions, please do ask on the Testing in Python list or on the Simplistix open source mailing list... cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.u

Re: except clause syntax question

2012-01-31 Thread Chris Angelico
On Wed, Feb 1, 2012 at 9:03 AM, Duncan Booth wrote: > Abitrarily nested tuples of exceptions cannot contain loops so the code > simply needs to walk through the tuples until it finds a match. Is this absolutely guaranteed? The C API for CPython provides: (Py2) http://docs.python.org/c-api/tuple.h

Re: except clause syntax question

2012-01-31 Thread Chris Angelico
On Wed, Feb 1, 2012 at 12:12 PM, Ian Kelly wrote: > Incidentally, I *think* that any correctly written C code attempting > to nest a tuple inside itself would make the reference count of the > tuple be at least 2 at the time of the call, and so it would fail. Good, nice that that's certain :) Mi

Re: How can I verify if the content of a variable is a list or a string?

2012-02-01 Thread Chris Angelico
On Wed, Feb 1, 2012 at 12:11 PM, Andres Soto wrote: > > okok, my mistake is that I was using string in place of str. Thank you!! > regards Tip: In the interactive interpreter, enter: >>> type("spam") In Python 2, it'll say "type" not "class", but same diff. It tells you there what the type is.

Re: Question about name scope

2012-02-01 Thread Chris Kaynor
On Wed, Feb 1, 2012 at 9:11 AM, Olive wrote: > I am learning python and maybe this is obvious but I have not been able > to see a solution. What I would like to do is to be able to execute a > function within the namespace I would have obtained with from > import * > > For example if I write: >

Re: Question about name scope

2012-02-01 Thread Chris Rebert
global namespace would lead to name > clash. It would be nice if I could import all the sympy names but for a > given function only. Don't think that's possible. Best alternative I can think of would be: import sympy as s def f(a): return s.sin(a) + s.cos(a) Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Generator problem: parent class not seen

2012-02-01 Thread Chris Rebert
and how to > track it down (and why it would be so intermittent)? What's the offending line of initAll() [#1690 in BaseFocusScript.py] look like? The lines preceding it would also be helpful for context. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Startup Chile Company Looking For Founding Developer/CTO

2012-02-02 Thread Chris Withers
x27;t spam the list with job adverts, please use the job board instead: http://www.python.org/community/jobs/howto/ cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple constructor __init__

2012-02-02 Thread Chris Rebert
… obj1 = QObject(parent=daddy) obj2 = QObject(arg1, parent=daddy) obj3 = QObject(daddy) # ERROR obj4 = QObject(arg1, daddy) # ERROR obj5 = QObject() # ERROR Cheers, Chris -- Using names instead of some arbitrary ordering makes much more sense. http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: SnakeScript? (CoffeeScript for Python)

2012-02-02 Thread Chris Angelico
On Fri, Feb 3, 2012 at 9:53 AM, andrea crotti wrote: > Mm I don't think it's what the OP is asking (unless I misunderstood...). > I think he wants to compile some syntax TO Python. > But I don't really see why you would something like this (if not for fun). > > Then how are you going to maintain t

Re: copy on write

2012-02-02 Thread Chris Angelico
On Fri, Feb 3, 2012 at 4:04 PM, Steven D'Aprano wrote: > No matter what Python did, somebody would complain. +1 This is, I think, the ultimate truth of the matter. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re:

2012-02-03 Thread Chris Rebert
On Fri, Feb 3, 2012 at 12:06 PM, Debashish Saha wrote: > would u like to help me by answering some vbasic questions about python? You might prefer to ask such questions on the tutor mailing list instead: http://mail.python.org/mailman/listinfo/tutor Cheers, Chris -- http://mail.python.

Re: Common LISP-style closures with Python

2012-02-03 Thread Chris Rebert
are kept between function calls, in other words we can have Common > LISP-like closures. Out of curiosity, what would be non-Common-Lisp-style closures? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread Chris Angelico
On Sat, Feb 4, 2012 at 7:14 AM, Andrew Berg wrote: > It's a rare occurrence, but sometimes my script will terminate and I get > this: > > Traceback (most recent call last): >  File "C:\path\to\script\script.py", line 992, in Do you call on potentially-buggy external modules? I'd be curious to se

Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-04 Thread Chris Angelico
On Sun, Feb 5, 2012 at 3:32 AM, Andrew Berg wrote: > On 2/3/2012 9:15 PM, Chris Angelico wrote: >> Do you call on potentially-buggy external modules? > It imports one module that does little more than define a few simple > functions. There's certainly no (intentional) interpr

Re: Help about dictionary append

2012-02-05 Thread Chris Angelico
27;,'04')} >... > and I get and error that TUPLE object has no attribute Append !!! > > But how to add new Values to a dictionary then ? ... but instead of using parentheses and creating a Tuple, use square brackets and create a List: mydict = {'Name':['Name

Re: MySQLdb not allowing hyphen

2012-02-05 Thread Chris Rebert
where to go. > > How do I work around this error? Don't use raw SQL strings in the first place. Use a proper parameterized query, e.g.: cursor.execute("insert into reviews(message, title) values (%s, %s)", ("We don't know where to go", "We can't wait till morrow")) Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: help function and operetors overloading

2012-02-05 Thread Chris Rebert
#x27;s a help() entry for them. The docs have a full list of those "special method names": http://docs.python.org/reference/datamodel.html#special-method-names Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: [Perl Golf] Round 1

2012-02-05 Thread Chris Angelico
On Mon, Feb 6, 2012 at 10:03 AM, Heiko Wundram wrote: > You're only allowed to bash him for one-liners as soon as he formulates > something that in some way or another resembles a programming challenge, and > not some incoherent listing of words without actual intent... ;-) Nah, one-liners are fu

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-05 Thread Chris Angelico
On Mon, Feb 6, 2012 at 12:26 PM, Terry Reedy wrote: > On 2/5/2012 6:23 PM, Dennis Lee Bieber wrote: >> >> On Mon, 6 Feb 2012 03:42:08 +1100, Alec Taylor >> wrote: >> >>> A 4 year old compiler? >>> >>> I also have MSVC11 installed. Can the python project add support for >>> that so that we aren't w

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-06 Thread Chris Angelico
On Mon, Feb 6, 2012 at 6:39 PM, Terry Reedy wrote: > On 2/6/2012 1:53 AM, Chris Angelico wrote: >> I suppose there's no chance of moving to a free compiler? > > VC express is free-as-in-beer. The whole V. Studio is free to core > developers. MS may not *like* open-source

Re: pySerial question, setting certain serial parameters [newbie]

2012-02-06 Thread Chris Rebert
1); > > I have thus far the following  statements but I think it does not set the > above parameters correctly: > import serial > voltport='/dev/ttyUSB2' > ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1,timeout=15) A link to the Perl library's documentati

Re: Static HTML documentation from docstrings

2012-02-07 Thread Chris Rebert
support for keeping documentation and code in sync? Yes. Sphinx's "autodoc" extension allows the placement of API documentation directly in docstrings and comments: http://sphinx.pocoo.org/ext/autodoc.html Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: iterating over list with one mising value

2012-02-07 Thread Chris Angelico
On Wed, Feb 8, 2012 at 8:25 AM, Aaron France wrote: > for i in range(0, len(x), 2): >    print x[i-1], x[i] I think you want x[i], x[i+1] here, but in any case, this is a fairly standard non-Python way to do this sort of thing. There's a variety of more Pythonic ways to loop, but every now and th

Re: Looking for PyPi 2.0...

2012-02-08 Thread Chris Rebert
de available. > * I want to maintain one README. > > > I don't like "someone needs to do this now" type posts but every time > I use PyPi it infuratiates me.  I usually end up finding modules via > Stack Overflow, which seems silly to me. They don't have all

Re: Naming convention for in-house modules (Newbie question)

2012-02-08 Thread Chris Rebert
gging. That's easy > enough, but is there a recommended way of naming such modules? I am > concerned about avoiding name clashes with standard modules and site > packages. You could put all the modules under a single package; then you only need to worry about avoiding 1 name conflict.

Re: Id of methods

2012-02-08 Thread Chris Angelico
On Thu, Feb 9, 2012 at 2:48 PM, Emeka wrote: > I am trying to see if I could get more of Python without being insane. Oh, I thought insanity was a prerequisite... anyway. > print Boo.__dict__ > > {'__module__': '__main__', 'ball': , 'daf': > , '__dict__ ..} > > print  hex(id(Boo.daf)) > 0x27

Re: Cycle around a sequence

2012-02-08 Thread Chris Angelico
On Thu, Feb 9, 2012 at 2:55 PM, Steven D'Aprano wrote: > If your data is humongous but only available lazily, buy more memory :) Or if you have a huge iterable and only need a small index into it, snag those first few entries into a list, then yield everything else, then yield the saved ones: de

Re: Cycle around a sequence

2012-02-09 Thread Chris Angelico
On Thu, Feb 9, 2012 at 7:33 PM, Peter Otten <[email protected]> wrote: > Chris Angelico wrote: > >> def cycle(seq,n): >>         seq=iter(seq) >>         lst=[next(seq) for i in range(n)] >>         try: >>                 while True: yield

Re: Formate a number with commas

2012-02-09 Thread Chris Rebert
le >>>> locale.setlocale(locale.LC_ALL, "") > 'de_DE.UTF-8' >>>> "{:n}".format(1234) # locale-aware > '1.234' >>>> "{:,d}".format(1234) # always a comma > '1,234' The latter requires Python 3.1+ and is courtesy PEP 378 (http://www.python.org/dev/peps/pep-0378/ ). Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Formate a number with commas

2012-02-09 Thread Chris Rebert
On Thu, Feb 9, 2012 at 1:16 PM, Peter Otten <[email protected]> wrote: > Chris Rebert wrote: >> On Thu, Feb 9, 2012 at 12:39 PM, Peter Otten <[email protected]> wrote: >>>>>> import locale >>>>>> locale.setlocale(locale.LC_ALL, "

Re: round down to nearest number

2012-02-09 Thread Chris Kaynor
On Thu, Feb 9, 2012 at 5:23 PM, noydb wrote: > hmmm, okay. > > So how would you round UP always? Say the number is 3219, so you want > 3300 returned. > You may want to look into the mathematical floor and ceiling functions[1]. Python exposes them in the math module as floor and ceil[2]. [1] ht

Re: round down to nearest number

2012-02-09 Thread Chris Kaynor
On Thu, Feb 9, 2012 at 5:40 PM, Chris Kaynor wrote: > On Thu, Feb 9, 2012 at 5:23 PM, noydb wrote: > >> hmmm, okay. >> >> So how would you round UP always? Say the number is 3219, so you want >> 3300 returned. >> > > You may want to look into the

Re: round down to nearest number

2012-02-09 Thread Chris Rebert
gent: Beware negative numbers when using // or %. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: frozendict

2012-02-10 Thread Chris Angelico
On Fri, Feb 10, 2012 at 1:30 PM, Nathan Rice wrote: > The only thing needed to avoid the hash collision is that your hash > function is not not 100% predictable just by looking at the python > source code.  I don't see why every dict would have to be created > differently.  I would think having th

Re: frozendict

2012-02-10 Thread Chris Rebert
an being dogmatic. It's been proposed previously and rejected: PEP 351 -- The freeze protocol http://www.python.org/dev/peps/pep-0351/ Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing items from a list

2012-02-10 Thread Chris Angelico
On Sat, Feb 11, 2012 at 7:04 AM, Thomas Philips wrote: > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in x: >        if i % 2 == 0: >                x.remove(i) Just a quickie, is there a reason you can't use a list comprehension? x = [i for i in x if i % 2] ChrisA -- http://mail.python.org/mailm

Re: datetime module and timezone

2012-02-10 Thread Chris Rebert
thon.org/pypi/pytz/ ). And python-dateutil (http://labix.org/python-dateutil ) can apparently parse zoneinfo files, if that's what you mean. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Postpone evaluation of argument

2012-02-10 Thread Chris Rebert
All arguments always get evaluated before control passes to the callee. You'd have to "quote" the arguments manually by putting them in lambdas, thus explicitly delaying their evaluation. Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python usage numbers

2012-02-11 Thread Chris Angelico
On Sun, Feb 12, 2012 at 12:21 PM, Eric Snow wrote: > However, in at > least one current thread (on python-ideas) and at a variety of times > in the past, _some_ people have found Unicode in Python 3 to make more > work. If Unicode in Python is causing you more work, isn't it most likely that the

Re: Python usage numbers

2012-02-11 Thread Chris Angelico
On Sun, Feb 12, 2012 at 1:36 PM, Rick Johnson wrote: > On Feb 11, 8:23 pm, Steven D'Aprano [email protected]> wrote: >> "I have a file containing text. I can open it in an editor and see it's >> nearly all ASCII text, except for a few weird and bizarre characters like >> £ © ± or ö.

Re: Python usage numbers

2012-02-11 Thread Chris Angelico
On Sun, Feb 12, 2012 at 4:51 PM, Steven D'Aprano wrote: > You can't say that it cost you £10 to courier your résumé to the head > office of Encyclopædia Britanica to apply for the position of Staff > Coördinator. True, but if it cost you $10 (or 10 GBP) to courier your curriculum vitae to the hea

Re: Need help with shutils.copytree

2012-02-12 Thread Chris Rebert
copytree() entirely: you just LYBL and check if the parent directories already exist; if not, you try to create the directories yourself; and finally, you copy the individual files. [Useful funcs: os.listdir(), os.path.exists(), os.mkdir() / os.mkdirs()] > I also tried an ignore function that always returns (). That's an effective no-op which doesn't alter copytree()'s behavior whatsoever. Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python usage numbers

2012-02-12 Thread Chris Angelico
On Mon, Feb 13, 2012 at 9:07 AM, Terry Reedy wrote: > The situation before ascii is like where we ended up *before* unicode. > Unicode aims to replace all those byte encoding and character sets with > *one* byte encoding for *one* character set, which will be a great > simplification. It is the id

Re: Python usage numbers

2012-02-12 Thread Chris Angelico
On Mon, Feb 13, 2012 at 11:03 AM, Dave Angel wrote: > On 02/12/2012 06:29 PM, Steven D'Aprano wrote: >> I think you mean 4 times as many bytes as characters. Unless you have 32 >> bit bytes :) >> >> > Until you have 32 bit bytes, you'll continue to have encodings, even if only > a couple of them.

Re: Python usage numbers

2012-02-12 Thread Chris Angelico
On Mon, Feb 13, 2012 at 3:48 PM, Rick Johnson wrote: > The problem with bytes is not encodings or OS's. Can you guess what > the REAL problem is? ..take all the time you need. The REAL problem is trolls. But they're such fun, and so cute when they get ranting... ChrisA -- http://mail.python.or

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-13 Thread Chris Angelico
On Tue, Feb 14, 2012 at 5:38 AM, Ian Kelly wrote: > "... Rights, that > **AMONG** these are Life, Liberty and the pursuit of Happiness." AMONG our rights are such elements as Life, Liberty, the Pursuit of Happiness, and an almost fanatical devotion to the Founding Fathers I'll come in again.

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-13 Thread Chris Angelico
Rick, you are either... On Tue, Feb 14, 2012 at 8:01 AM, Rick Johnson wrote: > I can however tell you that what DOES matter is the continued > improvement of the base gene pool. Yes, this improvement comes at a > cost; the cost of the individual. Those with quality genes will reap > the rewards,

Re: Automatic Type Conversion to String

2012-02-13 Thread Chris Rebert
path_obj)) - Add a .open() method to Path, and use that instead of the open() built-in function - Have Path subclass `str` or `unicode` > I'm trying to write the Path class so I can just hand a Path object > to, for example, open() and have it produce the path string. Impossible, short of subclassing `str` or `unicode`. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-13 Thread Chris Angelico
On Tue, Feb 14, 2012 at 11:39 AM, Rick Johnson wrote: > # Py>=3.0 > py> sum(earner.get_income(2012) for earner in earners2012) / > len(earners2012) > average_income > > Once you exceed that amount you are robbing your fellow man. How can > you justify making more than your fair share UNLESS someon

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-14 Thread Chris Angelico
On Wed, Feb 15, 2012 at 11:21 AM, Rick Johnson wrote: > On Feb 14, 2:41 am, John O'Hagan wrote: >> This is a failure to acknowledge the is/ought problem, and is usually >> compounded (Rick is no exception) by the equally mistaken view that there >> exist >> "superior" individuals whose possessio

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-14 Thread Chris Angelico
On Wed, Feb 15, 2012 at 11:48 AM, Rick Johnson wrote: > Duncan, your reading and comprehension skills are atrocious. Please re- > read the paragraph you quoted, then spend some time "comprehending" > it, then show me where i stated that "antibiotics cure viral > infections". psst: i NEVER said any

Re: Complexity question on Python 3 lists

2012-02-15 Thread Chris Rebert
ray grows by more than 1 element) ? Yes. Python lists aren't linked lists. list.append() resizes the underlying array intelligently to give O(1) performance, although I can't find any guarantee of this in the docs, but it is true in practice for all major Python implementatio

Re: Complexity question on Python 3 lists

2012-02-15 Thread Chris Rebert
35, 46, 58, 72, 88, …" -- list_resize() Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: writing to a file from within nested loops

2012-02-15 Thread Chris Rebert
including the stack Traceback. I would suspect there is some problematic assignment to `f` that you excluded from the snippet you posted. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Stand-Alone Python Executable Skeletons

2012-02-15 Thread Chris Rebert
hines, currently)? OS X has application bundles: http://en.wikipedia.org/wiki/Application_bundle py2app can generate them: http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: TEST AN EXECUTABLE PYTHON SCRIPT SPEED UNDER A PYTHON SHELL

2012-02-15 Thread Chris Angelico
On Thu, Feb 16, 2012 at 5:48 AM, Dave Angel wrote: > When you reply to a known bot, please include some indication of the fact, > so we know your message can be ignored as well. Sometimes I wonder about 8. Is there a real person there, as well as the bot? A lot of his/its posts look too intel

Re: Reading sub-string from a file

2012-02-16 Thread Chris Rebert
; Plz help!! Several oddities in the code you posted (e.g. you defined foo() but instead call set_foo(); the `handle` variable comes out of nowhere) suggest that it isn't your actual code; this greatly hinders us in assisting you. Please post your /actual/ code verbatim (or as much of it as you can with as few modifications as you can). Also, avoid using "plz" in the future; it's gotten a reputation for being associated with undesirable folk. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading sub-string from a file

2012-02-16 Thread Chris Angelico
On Thu, Feb 16, 2012 at 8:52 PM, Smiley 4321 wrote: > int Jockey_Apple_cat_1KK(float, int, char, int); > int Jockey_Apple_cat_look(int, float, int, int); > int Jockey_Apple_cat_test_ki21es(int, int, int, int); > int Jockey_Apple_cat_tarLK12OU(void, int, int, int); > --- > > Here substring "Jockey_

Re: Is this the right list?

2012-02-16 Thread Chris Angelico
On Fri, Feb 17, 2012 at 1:43 AM, Rick Johnson wrote: > On Feb 15, 4:04 pm, Terry Reedy wrote: >> On 2/15/2012 4:51 PM, Alan McKay wrote: >> >> > Is this the right list? > > This is neither the "right" or "left" list, however, it may be either > the correct or incorrect depending on your question.

Re: signed to unsigned

2012-02-17 Thread Chris Rebert
ack >>> unpack('=I', pack('=i',-327681234)) (3967286062,) I would think there's some more efficient way to do this though. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-17 Thread Chris Angelico
On Sat, Feb 18, 2012 at 12:13 PM, Rick Johnson wrote: > Here is a list of taxes most everyone else will encounter: You forgot the Microsoft Tax and the Stupid Tax. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: netCDF4 variable manipulation

2012-02-21 Thread Chris Rebert
tCDF4.Variable' and > 'int' > > I'm unsure how this is suppose to work. The API docs suggest that Variables don't support any arithmetic operations, just slicing and attribute manipulation. They seem to interoperate with numpy arrays though, so presumably you could avoid explicit looping by loading the Variable's contents into a numpy array, doing your calculations on that, and then assigning the resulting numpy array back into a slice of the Variable. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

xlwt 0.7.3 released!

2012-02-21 Thread Chris Withers
I'll be happy to add! cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

xlrd 0.7.2 released!

2012-02-21 Thread Chris Withers
ently only put up .tar.gz sdists, if anyone requires anything else, please explain why and I'll be happy to add! cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Python LOC, .exe size, and refactoring

2012-02-22 Thread Chris Angelico
On Wed, Feb 22, 2012 at 4:29 PM, Steven D'Aprano wrote: > While I think 60MB for a basic calculator app is taking the piss, this is > 2011 not 1987 and we don't have to support floppy disks any more. 11MB > for a GUI app is nothing to be worried about. That takes, what, 3 minutes > to download eve

Re: xlwt 0.7.3 released!

2012-02-22 Thread Chris Withers
the python-excel mailing list, as linked to from http://www.python-excel.org cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: [pyxl] xlrd 0.7.2 released!

2012-02-22 Thread Chris Withers
ckage. I believe that will give you everything you need, please explain if it doesn't. cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Python math is off by .000000000000045

2012-02-22 Thread Chris Rebert
answer. Alternatives to floats in Python include: * Fractions: http://docs.python.org/library/fractions.html * Arbitrary-precision decimal floating point: http://docs.python.org/library/decimal.html These aren't the default for both historical and performance reasons. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: storing in list and retrieving.

2012-02-22 Thread Chris Angelico
write one program that writes that format and another that reads it. The open() built-in function will open files for reading or writing, so that's a good place to start. Get as far as you can on your own, and if you get stuck, ask the list for more specific help. Good luck! Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: [pyxl] xlrd 0.7.2 released!

2012-02-23 Thread Chris Withers
- Library for developers to extract data from Microsoft Excel (tm) spreadsheet files xlrd1 - library for extracting data from Microsoft Excel spreadsheet files I would avoid both of these like the plague, it's a shame the people who dumped them

Re: storing in list and retrieving.

2012-02-23 Thread Chris Angelico
On Thu, Feb 23, 2012 at 7:45 PM, Smiley 4321 wrote: > It requires concepts of 'python persistence' for the code to be designed . > > Else it simple. > > Looking for some flow?? Go through the tutorial on python.org if you haven't, get some code written, and then codify your questions :) Chances a

Re: Reset static variables or a workaround

2012-02-23 Thread Chris Rebert
nt to ask on their discussion group instead: http://groups.google.com/group/django-users Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: [pyxl] xlrd 0.7.2 released!

2012-02-23 Thread Chris Withers
On 23/02/2012 14:40, xlstime wrote: Hi, i want to learn pyxl please help me... kindly send useful information about pyxl I would suggest: - using your real name when posting - reading the tutorial at http://www.python-excel.org/ cheers, Chris -- Simplistix - Content Management, Batch

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Chris Rebert
Dec 27 2010 python2.6 $ # this is on my Debian server Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Rebert
n Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> sum([[1,2],[3,4]], []) [1, 2, 3, 4] Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Angelico
On Fri, Feb 24, 2012 at 8:41 AM, Arnaud Delobelle wrote: > _sentinel = object() > > def sum(iterable, start=_sentinel): >    if start is _sentinel: > > del _sentinel Somewhat off-topic: Doesn't the if statement there do a lookup for a global, which would mean that 'del _sentinel' will cause it to

<    18   19   20   21   22   23   24   25   26   27   >