Re: Get __name__ in C extension module

2019-10-07 Thread Ian Pilcher
bject actually is a logger. Doing that validation (by using an "O!" unit in the PyArg_ParseTuple format string) requires access to the logging.Logger type object, and I was unable to find a way to access that object by name. -- =====

Re: What's the purpose the hook method showing in a class definition?

2019-10-20 Thread Ian Hobson
odifies the call, to look for a magic method, and starts again at B. When the magic method is found in Object, you get the "not found" error. If you implement the magic method in A or B it will be run instead. Regards Ian -- This email has been checked for viruses by AVG.

Distutils - bdist_rpm - specify python interpretter location

2019-10-30 Thread Ian Pilcher
--record=INSTALLED_FILES Is there a way to tell Distutils to use 'python2'? Thanks! -- ==== Ian Pilcher arequip...@gmail.com --

Re: Any socket library to communicate with kernel via netlink?

2019-11-20 Thread Ian Pilcher
always found library called netlinkg but it actually does something like modify network address or check network card... Any idea is welcome https://pypi.org/project/pyroute2/ -- Ian Pilcher

Re: LittleRookie

2020-08-19 Thread Ian Hill
You can access Dr.Chuck's Python for Everybody course here https://www.py4e.com/ or you need to be on the audit track on Coursera. R. ushills -- https://mail.python.org/mailman/listinfo/python-list

Re: Silly question, where is read() documented?

2020-08-29 Thread Ian Hobson
27;s not a built-in function and it's not documented with (for example) the file type object sys.stdin. So where is it documented? :-) -- Ian Hobson -- This email has been checked for viruses by AVG. https://www.avg.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What kind of magic do I need to get python to talk to Excel xlsm file?

2020-09-03 Thread Ian Hill
If you don't need to do any specific data analysis using pandas, try openpyxl. It will read xlsm files and it quite straight forward to use. https://openpyxl.readthedocs.io/en/stable/ pip install openpyxl. Ian -- https://mail.python.org/mailman/listinfo/python-list

_pydoc.css

2020-10-25 Thread Ian Gay
The default colors of pydoc are truly horrendous! Has anyone written a _pydoc.css file to produce something reasonable? (running 3.6 on OpenSuse 15.1) Ian -- *** To reply by e-mail, make w single in address ** -- https://mail.python.org/mailman/listinfo/python-list

Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Ian Vincent
Damn this is annoying me. I have a webpage with a BZ2 compressed text embedded in it looking like: 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M \x07<]\xc9\x14\xe1BA\x06\xbe\x084' Now, if I simply copy and paste this into Python and decompress it - it works a treat. H

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > please, line = line[20:-1], etc, is easier to read and understand ;-) Thanks, i'll put that in. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Took me a long time to figure out what you meant. ;-) > > So the string actually contains the backslashes, not the escaped > characters. > > This works: > bz2.decompress(eval(repr(user))) > 'huge' Unfortunately, it d

Re: Spoiler to Python Challenge (help!!!)

2005-09-29 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > bz2.decompress(eval('"' + user + '"')) > > Sorry about that. I was trying the other as an alternative, > but in fact, it doesn't work. So ignore that. Excellent! Thanks. -- http://mail.python.org/mailman/listinfo/pytho

How to use generators?

2005-11-09 Thread Ian Vincent
I have never used generators before but I might have now found a use for them. I have written a recursive function to solve a 640x640 maze but it crashes, due to exceeding the stack. The only way around this I can think of is to use Generator but I have no idea how to. The function is as b

Re: How to use generators?

2005-11-10 Thread Ian Vincent
Tom Anderson <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Exactly - using a queue means you'll do a breadth-first rather than a > depth-first search, which will involve much less depth of recursion. > See: Thanks for the answers but found a easier (admittedly cheating) way around

Re: Writing pins to the RS232

2005-11-28 Thread Ian Vincent
Peter Hansen <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > All true, but then Jay might get into electrical compatibility issues, > and may not realize that the output levels of RS-232 serial hardware > are not simply 0 and 5V levels, but rather +9V (or so) and -9V (and > with variatio

Re: Documentation suggestions

2005-12-06 Thread Ian Bicking
A.M. Kuchling wrote: > Here are some thoughts on reorganizing Python's documentation, with > one big suggestion. Thanks for bringing this up... > There are endless minor bugs in the library reference, but that seems > unavoidable. It documents many different and shifting modules, and > what to d

Re: Documentation suggestions

2005-12-06 Thread Ian Bicking
Fredrik Lundh wrote: > I've proposed adding support for semi-automatic linking to external > documents, based on a simple tagging model, a couple of times, e.g. > > http://mail.python.org/pipermail/python-list/2005-May/280751.html > http://mail.python.org/pipermail/python-list/2005-May/2807

Re: Documentation suggestions

2005-12-06 Thread Ian Bicking
to Python, or Think Like A Computer Scientist), and stable personal pages that should be linked in . But I do think that we should encourage some specific process for new or revised tutorial/howto contributions, like encouraging people put such material in the wiki. Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-06 Thread Ian Bicking
Aahz wrote: > Here's a question that kind of gets to the heart of a lot of the > problem: where does ``print`` get documented? If we can come up with a > good process for answering that question, we can probably fix a lot of > other problems. (Note emphasis on the word "process".) Good point; th

Re: Documentation suggestions

2005-12-07 Thread Ian Bicking
urse). But "print", "sorted", and "list" are all equally "built in" in the mind of a new user. And frankly, though with experience I understand the categorization, I don't find it particularly compelling. A new and improved language reference document s

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Ian Bicking
David Bolen wrote: Ian Bicking <[EMAIL PROTECTED]> writes: The one motivation I can see for function expressions is callback-oriented programming, like: get_web_page(url, when_retrieved={page | give_page_to_other_object(munge_page(page))}) This is my primary use case for la

Re: PEP 288 ponderings

2005-01-01 Thread Ian Bicking
t of context that it's just a way of creating shared state. But it's okay, work right now, and provides the exact same functionality. The exception part of PEP 288 still seems interesting. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Frameworks for "Non-Content Oriented Web Apps"

2005-01-01 Thread Ian Bicking
oping of "Non-Content Oriented Web-Apps" easy. Eh, it just needs some clear direction for *any* kind of web apps, IMHO. But with what you are specifically asking for, I think it's just a Hard Problem that Is Not Yet Solved, though there is work being done and people are attacki

Re: Continuations Based Web Framework - Seaside.

2005-01-02 Thread Ian Bicking
ented on any framework, right now, with the expectation that it would work in a production situation. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Continuations Based Web Framework - Seaside.

2005-01-02 Thread Ian Bicking
. But, Rails is really not a very experimental framework, and the existance of continuation-based frameworks for Ruby is an aside. If such frameworks happen at all for Python, I think they will be an aside as well. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://ma

Re: Ann: CherryPy-2.0-beta released

2005-01-03 Thread Ian Bicking
don't like the little Python file used to put the pieces together -- but I think it's a good direction. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-04 Thread Ian Bicking
no one will know what you mean. "Python could have honest support of concepts" is simply an incomplete sentence. "Python could have honest support of Concepts (url)" would be more reasonable. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Exception report library

2005-01-07 Thread Ian Bicking
n some way as well. I feel like there must be something out there, since every Python programmer has to deal with this sort of thing to some degree...? -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception report library

2005-01-07 Thread Ian Bicking
ogging, configuration, and perhaps aspects of the registration you are thinking about. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: The best way to do web apps with Python?

2005-01-09 Thread Ian Bicking
likely to be a very satisfying experience if they do. I'm optimistic that at some point most of the actively developed Python web frameworks we have now will be ported to WSGI. Ultimately, I think WSGI should be something a more casual Python web programmer wouldn't even realiz

Re: The best way to do web apps with Python?

2005-01-12 Thread Ian Bicking
d in a very long time, even if the movement isn't huge. It provides a foundation for further standardization. WSGI compliance also has some other potential benefits, like encouraging environment decoupling, and making mock requests easier to produce and responses easier to consume. But

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Ian Bicking
to avoid too many files in a directory, another option is to put files in subdirectories like: base = struct.pack('i', hash(page_name)) base = base.encode('base64').strip().strip('=') filename = os.path.join(base, page_name) -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Ian Bicking
ata. And that's certainly possible in a wiki, but that's not so much a scaling issue as a flexibility-in-reporting issue. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

[ANN] SQLObject 0.6.1

2005-01-25 Thread Ian Bicking
ect-discuss Archives: http://dir.gmane.org/gmane.comp.python.sqlobject Download: http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.6.1.tar.gz?download -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread Ian Osgood
dule libraries of Python. Graphics, object-orientation, and data-types are all available or easily implemented in a particular Forth, but those batteries are not included as they are in Python. Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Django and SQLObject. Why not working together?

2005-09-08 Thread Ian Bicking
Bruno Desthuilliers wrote: > Also, there's something like darwinism at play here. Yes, there are a > lot of concurrent ORM/Templating/Web Publishing/GUI/Whatnot projects > around, but I guess only the best of them will survive - eventually > 'absorbing' what's good in the others. No, they will all

TKinter, Entry objects and dynamic naming

2005-09-13 Thread Ian Vincent
I am hoping someone may be able to help. I am using Python and TKinter to create a GUI program that will eventually create an XML file for a project I am working on. Now, the XML file contents changes depending on the type of file it represents - so I am dynamically creating the TK Entry boxes.

Re: TKinter, Entry objects and dynamic naming

2005-09-13 Thread Ian Vincent
Ian Vincent <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > I have looked at using a dictionary but I cannot get my head around > how to do that either. I have tried this now but the Entry field just does not seem to work: def add_variable(self, root, varname): L

Re: Django Vs Rails

2005-09-14 Thread Ian Bicking
Diez B. Roggisch wrote: > - rails/subway reflect over a existing table. They create OR-mappings > based on that. You only specify exceptional attributes for these mappings. > > - django specifies the whole meta-model in python - and _generates_ > the SQL/DDL to populate the DB. So obviously you

Re: Britney Spears nude

2005-09-15 Thread Ian Osgood
Jeremy Jones wrote: > Will McGugan wrote: > > >Tim Peters wrote: > > > > > >>[john basha] > >> > >> > >> > >>>send me the britney nude photos > >>> > >>> > >>Because they're a new feature, you'll have to wait for Python 2.5 to > >>be released. > >> > >> > > > >She has just spawned a child process.

Re: Prepending to traceback

2005-02-09 Thread Ian Bicking
rpreter is doing. This sounds similar to what you want. It's pretty simple to use and it doesn't depend on the rest of Zope: http://cvs.zope.org/Products/ErrorReporter/ExceptionFormatter.py?rev=HEAD&content-type=text/vnd.viewcvs-markup -- Ian Bicking / [EMAIL PROTECTED] / http://

Tiled Image viewer

2005-02-21 Thread Ian McConnell
a little tricky. I've found Matt Kimballs pan and zoom widget http://web.archive.org/web/20030810111006/http://matt.kimball.net/image_view.html but this still reads the whole image into memory. Is there something similar to image_view.py, but which also does tiling? Thanks,

Re: Question of speed - Flat file DBMS

2005-03-06 Thread Ian Parker
entire indices in memory. Create an index for any field you'll be querying on to avoid having to read the entire record. If you're dealing with massive data, think about indices of indices. Work on the data, or at least the indices. in memory. Well, that's everything I ever

Re: Python 3000 and "Python Regrets"

2004-12-01 Thread Ian Bicking
ve, and presented as a more realistic plan. print will still be around. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP generic objects

2004-12-03 Thread Ian Bicking
# IMPORTANT! This is subclass friendly: updating __dict__ # is not! setattr(self, name, value) def __call__(self, **kw): # I'm not entirely happy with this: new_values = self.__dict__.copy() new_values.update(kw) return self.__cla

Re: HTTP response code

2004-12-04 Thread Ian Bicking
t;>> conn.request('HEAD', '/whatever') >>> res = conn.getresponse() >>> res.status 404 -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP generic objects

2004-12-04 Thread Ian Bicking
Steven Bethard wrote: Ian Bicking wrote: class bunch(object): def __init__(self, **kw): for name, value in kw.items(): # IMPORTANT! This is subclass friendly: updating __dict__ # is not! setattr(self, name, value) Good point about being subclass

Chicago Python Users Group Meeting, Thurs Dec 9

2004-12-06 Thread Ian Bicking
will talk about the hotspot profiler. Ian Bicking will be talking about py.test, a unittest alternative. Maybe John Roth will be able to talk about Fitnesse, a Wiki-based acceptance test system. There will also be time to chat, and many opportunities to ask questions. We encourage people a

Re: Python vs. Perl

2004-12-13 Thread Ian Bicking
been missing for a while in Python, and it's good to see this done right. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Help need with converting Hex string to IEEE format float

2004-12-17 Thread Ian Vincent
t; print v > ## This one worked great for what I was trying to do. Thanks to everybody for your help. TTFN Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Help With Hiring Python Developers

2004-12-05 Thread Ian Bicking
ns you must expect the lowest common denominator of quality given the constraints. I think that's a stupid way to look at programming in general, but it's *way* more stupid with Python. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Ian Bicking
e's other ways to approach this. Function expressions could get really out of hand, IMHO, and could easily lead to twenty-line "expressions". That's aesthetically incompatible with Python source, IMHO. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Ian Bicking
ke Smalltalk? Yep, I've done a fair amount of Smalltalk and Scheme programming. I don't expect Python to act like them. I appreciate the motivation, but I don't think their solution is the right one for Python. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

Re: [Catalog-sig] Table of Python Packages, updated

2005-03-29 Thread Ian Bicking
yPI's existance. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org -- http://mail.python.org/mailman/listinfo/python-list

RE: Class, object question.

2005-04-05 Thread Ian Sparks
Use the *args positional-argument to catch all the positional arguments in the constructor then test them to see what you have and call a kind of sub-init based on that : class Point:     def __init__(self,x,y,z):    self.x = x    self.y = y    self.z = z   class Vector:    de

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 2:09 AM, Antoon Pardon wrote: > So you are complaining about people being human. Yes that is > how people tend to react when they continualy are frustrated > by someone who refuses to show the slightest cooperation. > So no rejecting such responses, particullarly by the per

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 9:27 AM, Antoon Pardon wrote: > Op 12-11-13 14:02, Ian Kelly schreef: >> On Tue, Nov 12, 2013 at 2:09 AM, Antoon Pardon >> wrote: >>> So you are complaining about people being human. Yes that is >>> how people tend to react when they

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote: > Every time he uses foul language against somebody he's acting like a bully. > > Every time he reposts questions and ignores answers he's acting like a > bully. > > Every time he declares that what he wants is the most important and so he is >

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 4:38 PM, Mark Lawrence wrote: > What would you classify insulting my late mother as? Rudeness. I'm not defending Nikos here, but let's not call it something that it isn't. -- https://mail.python.org/mailman/listinfo/python-list

Re: To whoever hacked into my Database

2013-11-13 Thread Ian Kelly
On Tue, Nov 12, 2013 at 6:19 PM, Ethan Furman wrote: > On 11/12/2013 03:27 PM, Ian Kelly wrote: >> >> On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote: >>> >>> Every time he uses foul language against somebody he's acting like a >>> bully. >

Re: To whoever hacked into my Database

2013-11-13 Thread Ian Kelly
On Wed, Nov 13, 2013 at 2:08 AM, Antoon Pardon wrote: >> That doesn't mean that when somebody >> misbehaves, you can do whatever you want in retaliation without regard >> for others who might be involved. > > But I didn't do whatever. What I did was similar in what others > had been doing before.

Re: Bullying [was Re: To whoever hacked into my Database]

2013-11-13 Thread Ian Kelly
On Tue, Nov 12, 2013 at 8:40 PM, Steven D'Aprano wrote: > Is "bullying" the new "terrorism", which in turn is the new "socialism"? > That is, a meaningless term of opprobrium used on anything you don't > like? That's what it sounds like to me. > > Nikos has practically no power in this community.

Re: Fire Method by predefined string!

2013-11-17 Thread Ian Kelly
On Sun, Nov 17, 2013 at 2:46 PM, Tamer Higazi wrote: > Hi people! > > Assume we have 2 methods, one called Fire and the other __DoSomething. > > I want the param which is a string to be converted, that I can fire > directly a method. Is it somehow possible in python, instead of writing > if else s

Re: Oh look, another language (ceylon)

2013-11-18 Thread Ian Kelly
On Nov 18, 2013 3:06 AM, "Chris Angelico" wrote: > > I'm trying to figure this out. Reading the docs hasn't answered this. > If each character in a string is a 32-bit Unicode character, and (as > can be seen in the examples) string indexing and slicing are > supported, then does string indexing me

Re: Why do only callable objects get a __name__?

2013-11-18 Thread Ian Kelly
On Mon, Nov 18, 2013 at 1:13 PM, John Ladasky wrote: > A few days ago, I asked about getting the original declared name of a > function or method, and learned about the __name__ attribute. > > https://groups.google.com/forum/#!topic/comp.lang.python/bHvcuXgvdfA > > Of course, I have used __name__

Re: Automation

2013-11-19 Thread Ian Kelly
On Fri, Nov 15, 2013 at 1:45 PM, Alister wrote: > and if you haven't seen it before :- > > Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in > waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht > the frist and lsat ltteer be at the rghit pclae. The rset ca

Re: Automation

2013-11-19 Thread Ian Kelly
On Tue, Nov 19, 2013 at 2:26 AM, Chris Angelico wrote: > It couldn't figure out "Absytrytewh", "picsbeliud", or > "hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And > as a human, I'm guessing that the second one isn't an English word - > maybe it's Scots?) Here's the code: It's

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Ian Kelly
On Fri, Nov 22, 2013 at 7:13 AM, rusi wrote: > 2) del will delete objects -- like free in C >Except that like above, thinking in C will cause more problems than it > solves No, del will only delete name bindings. Whether the bound object is also deleted depends on whether it is still refere

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Ian Kelly
On Fri, Nov 22, 2013 at 7:18 PM, Steven D'Aprano wrote: > I'm not an expert on Indian English, but I understand that in that > dialect it is grammatically correct to say "the codes", just as in UK and > US English it is grammatically correct to say "the programs". I wouldn't necessarily even cons

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Nov 23, 2013 9:42 PM, "Chris Angelico" wrote: > As part of a post on python-ideas, I wanted to knock together a quick > little script that "imports" a file based on its name, in the same way > that the Python interpreter will happily take an absolute pathname for > the main script. I'm sure th

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 2:18 AM, Christian Gollwitzer wrote: > Am 24.11.13 04:41, schrieb Chris Angelico: > >> As part of a post on python-ideas, I wanted to knock together a quick >> little script that "imports" a file based on its name, in the same way >> that the Python interpreter will happily

Re: Behavior of staticmethod in Python 3

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 3:30 AM, Antoon Pardon wrote: > Op 23-11-13 22:51, Peter Otten schreef: >> Antoon Pardon wrote: >> >>> Op 23-11-13 10:01, Peter Otten schreef: >>> Your script is saying that a staticmethod instance is not a callable object. It need not be because Fo

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 4:05 AM, Chris Angelico wrote: > Undocumented... that explains why I didn't know about it! But that > does appear to be what I'm looking for, so is there some equivalent > planned as a replacement? Hmm, playing around with importlib a bit, this seems to work: from importl

Re: python-list history

2013-11-26 Thread Ian Kelly
On Tue, Nov 26, 2013 at 2:47 AM, Drew Crawford wrote: > Hello folks, > > I’m interested in digging up some Python mailing list archives from ages > past. Google Groups’ archive goes sporadically back to ’94, but clearly the > list is older. > > Does any one have a lead on where I could get an a

Re: '_[1]' in .co_names using builtin compile() in Python 2.6

2013-11-27 Thread Ian Kelly
On Nov 27, 2013 2:11 PM, "Ned Batchelder" wrote: > > On 11/27/13 2:40 PM, magnus.ly...@gmail.com wrote: >> >> So, in the case of "a.b + x" I'm really just interested in a and x, not b. So the (almost) whole story is that I do: >> >> # Find names not starting with ".", i.e a & b in "a.c + b" >

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Ian Kelly
On Fri, Nov 29, 2013 at 10:37 PM, Roy Smith wrote: > I was speaking specifically of "ligatures like fi" (or, if you prefer, > "ligatures like ό". By which I mean those things printers invented > because some letter combinations look funny when typeset as two distinct > letters. I think the encod

Re: extracting a heapq in a for loop - there must be more elegant solution

2013-12-03 Thread Ian Kelly
On Tue, Dec 3, 2013 at 2:13 PM, Cameron Simpson wrote: > On 03Dec2013 12:18, Helmut Jarausch wrote: >> I'd like to extracted elements from a heapq in a for loop. >> I feel my solution below is much too complicated. >> How to do it more elegantly? > > I can't believe nobody has mentioned PriorityQ

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Ian Kelly
On Tue, Dec 3, 2013 at 11:31 PM, rusi wrote: > Its a more fundamental problem than that: > It emerges from the OP's second post) that he wants '-' in the attributes. > Is that all? > > Where does this syntax-enlargement stop? Spaces? Newlines? At non-strings. >>> setattr(foo, 21+21, 42) Tracebac

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Ian Kelly
On Wed, Dec 4, 2013 at 3:09 AM, rusi wrote: > On Wednesday, December 4, 2013 2:27:28 PM UTC+5:30, Ian wrote: >> On Tue, Dec 3, 2013 at 11:31 PM, rusi wrote: >> > Its a more fundamental problem than that: >> > It emerges from the OP's second post) that he wants &#x

Re: interactive help on the base object

2013-12-09 Thread Ian Kelly
On Sun, Dec 8, 2013 at 4:01 PM, Mark Janssen wrote: > Likewise, WITH A COMPUTER, there is a definite order which can't be > countermanded by simply having this artifice called "Object". If you > FEE(L)s hadn't noticed (no longer using the insult "foo"s out of > respect for the sensativities of th

Re: interactive help on the base object

2013-12-10 Thread Ian Kelly
On Mon, Dec 9, 2013 at 8:19 PM, Steven D'Aprano wrote: > While I'm very confident at this point that he is a crank, in the same > category as circle-squarers, cold fusion proponents, pi-is-a-rational- > number theorists, perpetual motion machine inventors, evolution or AGW > Denialists[1], and oth

Re: Figuring out what dependencies are needed

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:38 AM, Robert Kern wrote: > On 2013-12-11 13:27, Steven D'Aprano wrote: >> >> On Wed, 11 Dec 2013 04:44:53 -0800, sal wrote: >> >>> Now I'd like to use the backtesting package from zipline (zipline.io), >> >> >> ".io" is not normally a file extension for Python files. Are

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 7:30 AM, Tim Chase wrote: > On 2013-12-11 13:44, Steven D'Aprano wrote: >> If necessary, I would consider having 26 dicts, one for each >> initial letter: >> >> data = {} >> for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": >> data[c] = {} >> >> then store keys in the particular d

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:02 PM, Ian Kelly wrote: > This is what I did not so long ago when writing a utility for > typeahead lookup, except that to save some space and time I only > nested the dicts as deeply as there were still multiple entries. As > an example of what the da

Re: Disable HTML in forum messages (was: Movie (MPAA) ratings and Python?)

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:12 PM, Ben Finney wrote: >> I found a "remove formatting" button in gmail's composer, and used it >> on this message. Does this message look like plain text? > > Still sent with an HTML part, so some other change must be needed to > disable that. Check the default format

Re: Movie (MPAA) ratings and Python?

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:01 PM, Ned Batchelder wrote: >> I've also been wondering if ISO-8859-1 is just an octet-oriented codec, >> so it'll read about anything. There are clearly non-7-bit-ASCII >> characters in the file that look like line noise in an mrxvt. > > > Both ISO-8859-1 and Windows-1

Re: Threading In Python

2013-12-12 Thread Ian Kelly
On Thu, Dec 12, 2013 at 1:08 AM, marcinmltd wrote: > Adding subject to the message. > Hello, > > I'm big fan of multiprocessing module, but recently I started looking at > threading in Python more closely and got couple of questions I hope You can > help me with: > > 1. When I run two or more thre

Re: Knapsack Problem Without Value

2013-12-13 Thread Ian Kelly
On Thu, Dec 12, 2013 at 7:08 PM, wrote: > Hi, > > I wanna ask about Knapsack. I do understand what Knapsack is about. But this > one i faced is a different problem. There is no value. I mean, it's like > this, for example. > > I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to

Re: outsmarting context managers with coroutines

2013-12-28 Thread Ian Kelly
On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan wrote: > On 12/29/13 00:13, Burak Arslan wrote: >> Hi, >> >> Have a look at the following code snippets: >> https://gist.github.com/plq/8164035 >> >> Observations: >> >> output2: I can break out of outer context without closing the inner one >> in Pyth

Re: outsmarting context managers with coroutines

2013-12-29 Thread Ian Kelly
On Sun, Dec 29, 2013 at 7:44 AM, Burak Arslan wrote: > On 12/29/13 07:06, Ian Kelly wrote: >> On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan >> wrote: >>> On 12/29/13 00:13, Burak Arslan wrote: >>>> Hi, >>>> >>>> Have a look at the follo

Re: print range in python3.3

2014-01-05 Thread Ian Kelly
On Jan 5, 2014 1:04 AM, "Mark Lawrence" wrote: > > On 05/01/2014 07:38, luofeiyu wrote: > > range(1,10) >> >> range(1, 10) > > print(range(1,10)) >> >> range(1, 10) >> >> how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ? >> > > for i in range(1,10): > print(i, end=',') > print() >

Re: Monkeypatching a staticmethod?

2014-01-09 Thread Ian Kelly
On Thu, Jan 9, 2014 at 10:23 PM, Roy Smith wrote: > This is kind of surprising. I'm running Python 2.7.1. I've got a class > with a staticmethod that I want to monkeypatch with a lambda: > > -- > class Foo: > @staticmethod > def x(): > return 1 > >

Re: plotting slows down

2014-01-13 Thread Ian Kelly
On Mon, Jan 13, 2014 at 6:26 AM, Dave Angel wrote: > Next, please repost any source code with indentation preserved. > Your message shows it all flushed to the left margin, probably > due to posting in html mode. Use text mode here. That's odd, the message that I got includes proper indentatio

Re: plotting slows down

2014-01-13 Thread Ian Kelly
On Mon, Jan 13, 2014 at 1:15 AM, wrote: > First let me say I have not done much python programming! > I am running Python 2.7.3. > I am trying to use python as a front end to a simple oscilloscope. > Ultimately I intend to use it with my micropython board. > > At the moment I am just developing i

Re: 'Straße' ('Strasse') and Python 2

2014-01-15 Thread Ian Kelly
On Wed, Jan 15, 2014 at 9:55 AM, Robin Becker wrote: > The fact that unicoders want to take over the meaning of encoding is not > relevant. A virus is a small infectious agent that replicates only inside the living cells of other organisms. In the context of computing however, that definition is

Re: graphical python

2014-01-19 Thread Ian Kelly
On Sat, Jan 18, 2014 at 10:40 PM, buck wrote: > I'm trying to work through Skienna's algorithms handbook, and note that the > author often uses graphical representations of the diagrams to help > understand (and even debug) the algorithms. I'd like to reproduce this in > python. > > How would y

Re: graphical python

2014-01-19 Thread Ian Kelly
On Sun, Jan 19, 2014 at 12:30 PM, buck wrote: > Thanks Ian. > Have you personally used pyjs successfully? > It's ominous that the examples pages are broken... I don't have any personal experience with either project. I don't know what's going on with pyjs.org curre

Re: Try-except-finally paradox

2014-01-29 Thread Ian Kelly
On Jan 29, 2014 11:01 PM, "Jessica Ross" wrote: > > I found something like this in a StackOverflow discussion. > >>> def paradox(): > ... try: > ... raise Exception("Exception raised during try") > ... except: > ... print "Except after try" > ... return

Re: 1 > 0 == True -> False

2014-01-30 Thread Ian Kelly
On Thu, Jan 30, 2014 at 1:08 PM, Dave Angel wrote: > Rotwang Wrote in message: >> Really? I take advantage of it quite a lot. For example, I do things >> like this: >> >> 'You have scored %i point%s' % (score, 's'*(score != 1)) >> > > I also did that kind of thing when computer resources > were

Re: 1 > 0 == True -> False

2014-01-30 Thread Ian Kelly
On Jan 30, 2014 1:40 PM, "Chris Angelico" wrote: > > On Fri, Jan 31, 2014 at 7:28 AM, Ian Kelly wrote: > > Of course if you're at all concerned about i18n then the proper way to > > do it would be: > > > > ngettext("You have scored %d point&quo

<    13   14   15   16   17   18   19   20   21   22   >