Re: Missing something on exception handling in Python 3

2013-08-26 Thread Skip Montanaro
I found this question/answer on Stack Overflow: http://stackoverflow.com/questions/15123137 but after fiddling around with it, I can't find a solution that works for Python 3.2 and 3.3, let alone 2.x. In 3.2, exceptions have both __cause__ and __context__ attributes. I tried setting both to Non

Re: String splitting with exceptions

2013-08-28 Thread Skip Montanaro
> The record formats are, in the worst case, like this: > > foo.[DOM]::[IP6::4361:6368:6574]:600:: > Any suggestions? Write a little parser that can handle the record format? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPi Module Removal

2013-09-03 Thread Skip Montanaro
> I don't really have any way to contact the author of the module. Is there > any way to have this deleted/renamed? Not directly, but I opened a ticked in the PyPI bug tracker. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: PyPi Module Removal

2013-09-03 Thread Skip Montanaro
> Ah, Unix users. Who else would imagine that the way to install something > called "wxPython" was to use "install wx"? I'm not a wxPython user, but it seems the package/module you import in your programs is "wx". Not an unreasonable guess at the PyPI package name. Skip -- https://mail.python.or

Re: Dealing with \r in CSV fields in Python2.4

2013-09-04 Thread Skip Montanaro
> _csv.Error: newline inside string How are the lines actually terminated, with \r\n or with just \n? If it's just \n, what happens if you specify \n as the line terminator? Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Importing Definitions

2013-09-05 Thread Skip Montanaro
>> You can! Any name will work, functions aren't special. >> >> from module1 import method1, A, B, C, D, E > > Better practice is to use: > > import module1 > print module1.A > print module2.B > > and so forth since that makes it far more clear what you are doing and > where they come from. But it'

Re: PEP8 79 char max

2013-09-06 Thread Skip Montanaro
> Well, what I interpret as the PEP8 79 is chars visible minus the '\n' or > '\r\n'(which would be 2; 81) line enders. You young un's. Always makin' stuff up... :-) In these days of fancy single-user PCs with sophisticated window systems, people tend to forget that BITD there was a thriving mark

Re: Multiprocessing / threading confusion

2013-09-06 Thread Skip Montanaro
On Fri, Sep 6, 2013 at 1:27 PM, Paul Pittlerson wrote: > Ok here is the fixed and shortened version of my script: Before going any further, I think you need to return to marduk's response and consider if you really and truly need both threads and fork (via multiprocessing). http://www.linuxprogr

Re: Confessions of a terrible programmer

2013-09-06 Thread Skip Montanaro
> Pardon me, but I completely don't get this article. Let me in on what > is supposed to be the joke please! I don't really think there's a joke. I think the author is saying in a somewhat sly way is that often, the difference between a terrible programmer and a great programmer is the discipline

Re: Please omit false legalese footers (was: Language design)

2013-09-12 Thread Skip Montanaro
More likely, JP Morgan's mail system added that footer to the message on the way out the virtual door. My recommendation would be to not post using your company email address. Get a free email address. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get time (milisecond) of a python IO execution

2013-09-15 Thread Skip Montanaro
I'm not familiar with how Windows works, but I wouldn't be surprised if it caches directory information. (Unix systems certainly would.) You probably aren't really doing much actual I/O to get the size of a file after the first run. Also, you probably want to subtract the time it takes to execute a

Re: Please use the Python Job Board for recruiting (was: Python Developers)

2013-09-18 Thread Skip Montanaro
On Wed, Sep 18, 2013 at 2:57 AM, Ben Finney wrote: > Kelly Lurz writes: > >> List > > Please do not use this discussion forum for job advertisements. > > Instead, please use the Python Job Board designed for this purpose > http://www.python.org/community/jobs/>. Agreed. This recruiter also spamm

Re: Using the MSI installer on Windows: Setting PATH and Setuptools

2013-09-19 Thread Skip Montanaro
> PIP would definitely do the trick. Does the MSI include PIP? If it does not > include PIP, then how can I easily install it from the command line? I am > looking for something like this: Not yet, but I think just around the corner: http://www.python.org/dev/peps/pep-0453/ Unlike most enhance

Re: Using the MSI installer on Windows: Setting PATH and Setuptools

2013-09-19 Thread Skip Montanaro
> Question 4: If the Windows MSI installer indeed lacks Setuptools, what is the > best way to install it from the command line in a future-proof manner (on > Windows)? I am imagining something like this: > > wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py > python ez_setup.py

Re: Sphinx Doctest: test the code without comparing the output.

2013-09-23 Thread Skip Montanaro
> I don't know why but it seems that google groups stripped the indentation > from the code. Because it's Google Groups. :-) 800-pound gorillas tend to do pretty much whatever they want. Skip -- https://mail.python.org/mailman/listinfo/python-list

Using GNU libc mtrace/muntrace via ctypes?

2013-09-30 Thread Skip Montanaro
I'm getting an error in certain situations which leads to this message: *** glibc detected *** /opt/TWWfsw/bin/python: corrupted double-linked list: 0x07952420 *** Valgrind hasn't been any help. I'd really like to avoid recompiling Python, as that might just move or obscure the error. Mig

Re: Stop posting HTML [was Re: I haev fixed it]

2013-10-01 Thread Skip Montanaro
> I use gmail for this list, and I believe it replies with html if the previous message was written with html. I can verify that. Definitely need to pay attention when using Gmail. It loves to top post and quote entire messages by default as well. Skip (who has a love/hate relationship with Gmail

Re: Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread Skip Montanaro
> def roundingVals_toTwoDeci(): > global y > for d in y: > for k, v in d.items(): > v = ceil(v*100)/100.0 > return > roundingVals_toTwoDeci() > > > > But it is not working - I am still getting the old values. You're not assigning the rou

Re: Variable arguments (*args, **kwargs): seeking elegance

2013-10-07 Thread Skip Montanaro
> What makes Matplotlib so professional? > > Assuming that "professional" packages necessarily do the right thing is > an unsafe assumption. Many packages have *lousy* interfaces. Not that it's a complete explanation for matplotlib's interfaces, but it did start out as a Python-based replacement f

Re: Mysql's mysql module

2013-10-07 Thread Skip Montanaro
On Mon, Oct 7, 2013 at 1:08 PM, Tobiah wrote: > I just noticed this: > > > http://dev.mysql.com/doc/connector-python/en/index.html * Does it adhere to the Python database API? http://www.python.org/dev/peps/pep-0249/ * Is source available? * Does it have a reasonable open source license? These

Re: Re for Apache log file format

2013-10-08 Thread Skip Montanaro
> Aiui apache log format uses space as delimiter, encapsulates strings in > '"' characters, and uses '-' as an empty field. Specifying the field delimiter as a space, you might be able to use the csv module to read these. I haven't done any Apache log file work since long before the csv module was

datetime.timedelta.replace?

2013-10-09 Thread Skip Montanaro
Datetime objects have a replace method, but timedelta objects don't. If I take the diff of two datetimes and want to zero out the microseconds field, is there some way to do it more cleanly than this? delta = dt1 - dt2 zero_delta = datetime.timedelta(days=delta.days, seconds=delta.seconds) I gues

How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
I have a pair of Listboxes, each with ranges of the same text. For example: ABCABC DEFDEF GHIGHI JKLJKL (My apologies, I'm sure Gmail is going to butcher that.) If I select "ABC" from the first list, only the last three values in the second list are appropriate selections. Is th

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> Other synonyms from GUI toolkits are "inactive" and "disabled". I > don't know if that'll be any help though. Thanks. "disabled" did the trick. Turns out you can't disable individual items. Instead, you have to (hackishly) change the display of entries somehow to indicate their inappropriateness

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> Removing inappropriate entries is not much of a hack. True, but then I have to go through the trouble of adding them back in should they become valid again. :-) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> It seems that this could be handled fairly straight-forwardly by subclassing either Listbox or Frame to implement your own, custom widget. I will freely admit that I am far from facile with Tk widgets. I've been using GTK for most GUI apps for a long while (when I need to write such things), but

Process pending Tk events from GObject main loop?

2013-10-11 Thread Skip Montanaro
I know I have things bassackwards, but trying to process Gtk events from Tkinter's main loop using after() isn't working. (I suspect our underlying C++ (ab)use of Gtk may require a Gtk main loop). I'd like to process Tk events periodically from a GObject main loop. I know I want to call gobject.idl

Would you l like to take over lockfile?

2013-10-13 Thread Skip Montanaro
I don't have the time or inclination to continue supporting lockfile ( https://pypi.python.org/pypi/lockfile/). If you'd like to take it over, let me know. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Skip Montanaro
>> Who uses "object abstraction" in C? No one. That's why C++ was invented. > > I wonder if you've heard of something called linux? > http://lwn.net/Articles/444910/ If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Skip -- https://mail.python.org/mailman

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-17 Thread Skip Montanaro
On Oct 17, 2013 6:59 PM, "Peter Cacioppi" wrote: > > You know, I'd heard somewhere that Goto was considered harmful trying to remember exactly where I can't tell if you were kidding or not... Just in case: http://en.m.wikipedia.org/wiki/Considered_harmful (can't grab the [2] & [3] links

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-22 Thread Skip Montanaro
Steven wrote: > The world is much bigger than just the C family of languages. And even within that space, the original authors of C left plenty of room for debate/improvement. In at least two dimensions (object oriented programming, and memory management), various C descendants have tried multipl

Re: pip won't ignore system-installed files

2013-10-22 Thread Skip Montanaro
On Tue, Oct 22, 2013 at 8:11 AM, Neal Becker wrote: > IIUC, it is perfectly legitimate to do install into --user to override system- > wide installed modules. Thus, I should be able to do: > > pip install --user --up blah > > even though there is already a package blah in > /usr/lib/pythonxxx/sit

Re: Python Front-end to GCC

2013-10-22 Thread Skip Montanaro
On Tue, Oct 22, 2013 at 12:50 PM, Mark Janssen wrote: > Okay. The purpose of BNF (at least as I envision it) is to > produce/specify a *context-free* "grammar". A lexer parses the tokens > specified in the BNF into an Abstract Syntax Tree. If one can produce > such a tree for any given source,

Re: Will Python 3.x ever become the actual standard?

2013-10-23 Thread Skip Montanaro
Tim: > Disregarding Mark's tongue-in-cheek rhetoric for now... perhaps you > didn't realise that, on Windows, you can't pip install a binary Mark: > Which on Windows often ends up telling you that it can't find vcvarsall.bat I am well aware that Windows users rarely have compilers available. Pe

Re: Will Python 3.x ever become the actual standard?

2013-10-23 Thread Skip Montanaro
> Thankfully I am. I confess I don't understand how *nix people endure having > to compile code instead of having a binary install. To me it's like going > to the garage to buy a new car, being shown the parts and the tool kit and > being told to get on with it. Perhaps it's a case of second cla

Confused about timezones

2013-10-23 Thread Skip Montanaro
This isn't really a Python issue, though my problem solution will be implemented in Python. If I have a naive datetime object for some time in the past, it's not clear to me how the offset gets set correctly. Consider this sequence: >>> import datetime, pytz >>> LOCAL_TZ = pytz.timezone(os.environ

Re: Confused about timezones

2013-10-23 Thread Skip Montanaro
LOCAL_TZ.localize(dt1).utcoffset() > datetime.timedelta(-1, 68400) LOCAL_TZ.localize(dt2).utcoffset() > datetime.timedelta(-1, 64800) > > Why is the UTC offset the same for both datetime objects despite the > presence/absence of Daylight Savings? Brain freeze! A quick glance told me they

Re: Function for the path of the script?

2013-10-26 Thread Skip Montanaro
Strange. I almost never want to know the location of the file that's executing, and when I do, I just reference the __file__ module level attribute. Skip -- https://mail.python.org/mailman/listinfo/python-list

How do I update a virtualenv?

2013-10-28 Thread Skip Montanaro
I have a virtualenv I'm using for some Django development. Today I switched from MacPorts to HomeBrew on my Mac. I'm thus getting a different version of gcc and its libs. How do I reinstall the virtualenv? I've looked around and found a few descriptions of what to do, but as I am little more than

Re: How do I update a virtualenv?

2013-10-28 Thread Skip Montanaro
> Virtualenvs aren't built to be moved from one Python installation to > another. If you used pip to install your packages (you should), then you > can activate the virtualenv, and run: $ pip freeze > requirements.txt > > Then you can create a new virtualenv using the new Python executable, > acti

Re: How do I update a virtualenv?

2013-10-28 Thread Skip Montanaro
>> I have a virtualenv I'm using for some Django development. Today I >> switched from MacPorts to HomeBrew on my Mac. > > Any particular reason for doing that? That seems like a step backwards, > especially for Python-related work. The guy who sits next to me at work recommended HomeBrew. (Some

Re: How do I update a virtualenv?

2013-10-28 Thread Skip Montanaro
>> Hmmm... And my git repo? > > Usually the virtualenv is outside the git repo (and vice-versa), but git > repos are also easy to recreate from the git server if you need to. Maybe I > don't understand what you mean? I'm using Heroku, following their instructions. They have a "git init" in the mi

Re: How do I update a virtualenv?

2013-10-28 Thread Skip Montanaro
>> Hmmm... And my git repo? > > You are keeping your virtualenv separate from your working tree, right? > I put mine in ‘/var/local/devel/$USER/virtualenvs/foobar/’ where > “foobar” is the specific virtualenv name. No, I'm no expert in these things. I was just following the directions on the Herok

Re: How do I update a virtualenv?

2013-10-29 Thread Skip Montanaro
> Where specifically are these instructions that tell you to put the > virtualenv under VCS control? https://devcenter.heroku.com/articles/getting-started-with-python > As you are a Heroku customer (I'm not), would you be willing to > suggest they alter them based on advice from this forum? It's

Re: Mail client wrapping

2013-10-29 Thread Skip Montanaro
The mail message is encoded. You will have a header like this: Content-Transfer-Encoding: quoted-printable If you are processing email messages you should investigate Python's email module. http://docs.python.org/2/library/email Skip On Tue, Oct 29, 2013 at 7:36 PM, Jason Friedman wrote: > I

Re: How do I update a virtualenv?

2013-10-30 Thread Skip Montanaro
> I believe you may have misread the instructions slightly. You should have a > project structure like this: > > my_project/ > /venv > .gitignore > > The instructions mention adding 'venv' to your .gitignore, so it will be > excluded from version control. If you have .git & .git

Re: RELEASED: Python 2.6.9 final

2013-10-30 Thread Skip Montanaro
> Thanks Barry for all the hard work. Ditto. Wish I still had my Guido van Rossum World Tour t-shirt! Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: sorting german characters äöü...

2013-10-30 Thread Skip Montanaro
> That works, but my be there is a more intelligent way? Especially there > could be much more r.replace to handle all the accents as ^ ° ´ ` and so on. Perhaps this? http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database There is also a rather long-ish r

Re: Error Testing

2013-10-31 Thread Skip Montanaro
On Thu, Oct 31, 2013 at 10:20 AM, Neil Cerutti wrote: > On 2013-10-30, Albert van der Horst > wrote: >> This suggests that Pascal went against established practice. >> This is false. FORTRAN used = and that was a mistake caused by >> the language being hacked together haphazardly. > > Respectfull

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Skip Montanaro
> 1. How fast can Python do math calculations compared with other languages > such as Fortran and fast versions of Basic. I would have to believe that it > is much faster than Perl for doing math calculations. As others have indicated, a lot depends on the form of your calculations. There is a c

Re: how to load test a web app?

2013-11-06 Thread Skip Montanaro
> Have a look at selenium and sauce labs: > > http://www.seleniumhq.org/ > https://saucelabs.com/ Maybe we should pass that information along to Kathleen Sebelius. :-) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: How to tell an HTTP client to limit parallel connections?

2013-11-08 Thread Skip Montanaro
> What I really need is an HTTP header or meta-tag or something that I > can use to tell clients to limit themselves to a single connection. > > I haven't been able to find such a thing, but I'm hoping I've > overlooked something... That will only go so far. Suppose you tell web browsers "no more

Re: chunking a long string?

2013-11-08 Thread Skip Montanaro
> I have a long string (several Mbytes). I want to iterate over it in > manageable chunks (say, 1 kbyte each). You don't mention if the string is in memory or on disk. If it's in memory: >>> for i in range(0, len(s), 10): ... print repr(s[i:i+10]) ... 'this is a ' 'very long ' 'string' If yo

dateutil.relativedelta.WE and friends?

2013-11-11 Thread Skip Montanaro
I found a rather inscrutable use of dateutil recurrence rules in StackOverflow which generates a series of dates corresponding to the third Wednesday of the month: import dateutil.rrule as dr import dateutil.relativedelta as drel dt = datetime.datetime(2012, 1, 1, 0, 0) rule = dr

Re: dateutil.relativedelta.WE and friends?

2013-11-11 Thread Skip Montanaro
damn gmail. Please ignore the drivel below (and this top post)... Skip On Mon, Nov 11, 2013 at 2:33 PM, Skip Montanaro wrote: > I found a rather inscrutable use of dateutil recurrence rules in > StackOverflow which generates a series of dates corresponding to the > third Wednesday of t

Re: Is anyone else unable to log into the bug tracker?

2015-02-26 Thread Skip Montanaro
I have not had problems, but I use the Google login (Open ID, I presume) option. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: My emails are getting bounced?

2015-03-12 Thread Skip Montanaro
On Thu, Mar 12, 2015 at 4:56 PM, Ryan Gonzalez wrote: > Your membership in the mailing list Python-ideas has been disabled due > to excessive bounces I got the same treatment. Probably a mail loop involving Gmail. Skip -- https://mail.python.org/mailman/listinfo/python-list

Pexpect idea - but can I handle curses?

2015-03-13 Thread Skip Montanaro
I have this tweak I'd like to make to the top command (Linux only is fine). Most of the time I want to see just one user or all users. Every now and again though, I'd like to see all users except another. Top doesn't support this functionality, but I thought something like "-u -root" would be a ha

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Skip Montanaro
On Fri, Mar 13, 2015 at 10:54 AM, Thomas 'PointedEars' Lahn < pointede...@web.de> wrote: > Yes, it (top(1) from procps-ng 3.3.9) does. Either run > > top -u '!root' > > or type “o” (for case-insensitive filter), then e.g. “!USER=root” to show > processes started by all users except “root”. RTF

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Skip Montanaro
On Fri, Mar 13, 2015 at 12:03 PM, Thomas 'PointedEars' Lahn wrote: > “o” is not an option, it is an interaktive keystroke command in (my) top(1). "o" is also an unrecognized keystroke. > OpenSUSE 12.2 has reached its end-of-life on 2014-01-27. I understand that. Tell that to management though.

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Skip Montanaro
On Fri, Mar 13, 2015 at 5:47 PM, Christian Gollwitzer wrote: > Why? Do you not have a C compiler? Sure I do, and I'm not afraid to use it. I realize top is just one not-terribly-critical tool, but every divergence between my machines and the "standard" install just makes it that much more diffi

Re: Pexpect idea - but can I handle curses?

2015-03-14 Thread Skip Montanaro
> That might have to do with > , specifically > . Thanks, but not really helpful. I'm well aware of Eric Raymond's contributions to the open source world. I'm also aware aware that my ques

Re: Pexpect idea - but can I handle curses?

2015-03-14 Thread Skip Montanaro
>> Will I be in over my head trying to tweak the output? Hmmm... maybe if I tell top TERM=dumb? > > You may need to tell it TERM=dumb, though it might also refuse to run. It does run w/ TERM=dumb, so hopefully I won't have to resort to defining my own terminal definition. (Now, *that* takes me bac

Re: Best way to calculate fraction part of x?

2015-03-23 Thread Skip Montanaro
On Mon, Mar 23, 2015 at 7:52 AM, Steven D'Aprano wrote: > x % 1 is significantly faster, but has the disadvantage of giving the > complement of the fraction if x is negative I suppose abs(x) % 1 would be just as slow as x - int(x) ? (haven't checked) Skip -- https://mail.python.org/mailman/

Re: Regex Python Help

2015-03-24 Thread Skip Montanaro
On Tue, Mar 24, 2015 at 1:13 PM, wrote: > SyntaxError: Missing parentheses in call to 'print' It appears you are attempting to use a Python 2.x print statement with Python 3.x Try changing the last line to print(line.rstrip()) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex Python Help

2015-03-24 Thread Skip Montanaro
On Tue, Mar 24, 2015 at 2:22 PM, Gregg Dotoli wrote: > The print error is gone, but now the script quickly finishes and doesnt > walk > the OS tree or search. > You need to walk the directory tree recursively. Take a look at os.walk(). Skip -- https://mail.python.org/mailman/listinfo/python-li

Re: Proposal for new minor syntax

2015-03-27 Thread Skip Montanaro
Interesting concept. I suppose it offers some small optimization opportunities, and clearly saves some possibly error-prone typing. You construct the object on the left-hand side, then just DUP_TOP to get its use on the RHS. A couple comments though: * "dot" is pretty invisible unless surrounded

Re: Lockfile hanling

2015-03-31 Thread Skip Montanaro
On Tue, Mar 31, 2015 at 9:50 AM, Ervin Hegedüs wrote: > After few weeks the process > reaches the number if max fd's. > > How can I prevent or avoid this issue? What's the correct way to > handle the lockfile in Python? Ervin, You need to close the files you open. I don't see that happening in y

Re: Lockfile hanling

2015-03-31 Thread Skip Montanaro
> sorry - at the end of the function there is a close() method to a > file, after the thread passes the modifications: > > try: > os.remove(self.lockfile) > except: > syslog.syslog(syslog.LOG_DEBUG, "Sync error: " + > str(sys.exc_info()[1])) Hmmm... Still not seeing os.clo

Re: Please use the Python Job Board (was: Immediate Hire: ETL Developers - Boise, Idaho)

2015-04-15 Thread Skip Montanaro
On Wed, Apr 15, 2015 at 2:48 PM, Ben Finney wrote: > nagaraju thoudoju writes: > >> Please find the requirement below and let me know you interest on this >> position > > Please do not post recruitment messages here. He would have been rejected there as well. I saw nothing which looked obviously

Importing/migrating Mailman mbox files into Google Groups?

2015-04-16 Thread Skip Montanaro
Quite sometime ago (2011?), the classic-rendezvous mailing list, which had been hosted by a Mailman instance at bikelist.org, was reconstituted as a Google Group. Just a bunch of old bikies interested in vintage bikes. The original archives were never imported into the new group. (It might not have

Re: Immediate Hire: Liferay Developer - Remote

2015-04-17 Thread Skip Montanaro
there will notice and discuss the matter with you. If what I have written is at all unclear, feel free to call me (847-971-7098). I would be happy to discuss this with you, especially if it means you quit spamming python-list@python.org. Skip Montanaro -- https://mail.python.org/mailman/listinfo/python-list

Re: Importing/migrating Mailman mbox files into Google Groups?

2015-04-18 Thread Skip Montanaro
On Fri, Apr 17, 2015 at 7:33 PM, Cameron Simpson wrote: > However, before you get very excited see if people can get messages back out > of the archive. A major annoyance for me with GGroups versus mailman is that > if I join a group I cannot download the historical archive. (This is a > standard

Re: Importing/migrating Mailman mbox files into Google Groups?

2015-04-18 Thread Skip Montanaro
On Sat, Apr 18, 2015 at 6:42 PM, Cameron Simpson wrote: > I think I understood that there was an existing archive. My caveat was more > something to consider before choosing GGroups (too late, and in any case > hardly a deal breaker, especially since Google finally cleaned up a lot of > their HTML

Re: do you guys help newbies??

2015-04-20 Thread Skip Montanaro
On Sun, Apr 19, 2015 at 9:01 PM, Mark Lawrence wrote: > Rather sad to see those three initials in that post as well [image: 😢] > We miss John at TradeLink. Skip -- https://mail.python.org/mailman/listinfo/python-list

Type checking tools for Python 2?

2015-04-21 Thread Skip Montanaro
I've been following along with the discussions related to type hints[1] on python-ideas and python-dev. I'm interested enough to start looking into this for my own nefarious purposes. At work, we have lots of C++ code wrapped by Boost.Python. It seems like creating type hint stubs for those librari

Re: Type checking tools for Python 2?

2015-04-21 Thread Skip Montanaro
On Tue, Apr 21, 2015 at 1:29 PM, Terry Reedy wrote: > I believe mypy can typecheck 2.x code in conjunction with stub files. Thanks. Maybe the MyPy FAQ is just out-of-date? It includes this Q&A: All of my code is still in Python 2. What are my options? Mypy currently supports Python 3 sy

Re: Type checking tools for Python 2?

2015-04-21 Thread Skip Montanaro
On Tue, Apr 21, 2015 at 2:26 PM, Terry Reedy wrote: > Sorry if I jumped the gun on mypy. Not a problem. I went ahead and installed Python 3.5a4 and mypy. It seems to run, but it isn't terribly happy with my Python 2 code. Not so much the actual syntax as things like the builtin cmp() function and

Re: Python as shell

2015-04-22 Thread Skip Montanaro
On Wed, Apr 22, 2015 at 12:25 PM, Cecil Westerhof wrote: > I thought there was a Python shell that could be used instead of Bash > (or whichever shell you are using), but I can not find anything about > it. Am I wrong, or are my search engine skills so bad? Maybe Pyshell or IPython? Skip -- htt

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Skip Montanaro
Paul> ... I'm frankly confused ... You and me both. I'm pretty sure I understand what a Future is, and until the long discussion about PEP 492 (?) started up, I thought I understood what a coroutine was from my days in school many years ago. Now I'm not so sure. Calling Dave Beazley... Calling Da

Re: Writing list of dictionaries to CSV

2015-05-05 Thread Skip Montanaro
On Tue, May 5, 2015 at 1:11 PM, MRAB wrote: > I'm assuming that you're reading the CSV file in a text editor, not > some other application that might be trying to be "clever" by > "interpreting" what it thinks looks a date as a date and then > displaying it differently... More likely, viewing the

A __call__ "method" which is itself another callable class instance?

2015-05-08 Thread Skip Montanaro
This is just a pedantic post. It has no real useful application, just something to think about. I apologize that the setup is rather long. The stuff to think about is at the end. (I also apologize for using rich text/html. In this HTML world in which we live nowadays, I'm never certain that mail sy

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-11 Thread Skip Montanaro
Don't CS departments still have a computer languages survey class? When I was a graduate student at Iowa in the early 80s, we had one. (It was, as I recall, an upper level undergrad course. I didn't get into CS until graduate school, so went back to filled in some missing stuff.) I don't recall all

Re: Calling a function is faster than not calling it?

2015-05-11 Thread Skip Montanaro
On Mon, May 11, 2015 at 4:50 AM, BartC wrote: > You just seem surprised that using eval() to do this is slower than a > direct call. Well, it is surprising. Most uses of eval() are to evaluate Python expressions in string form. That I expect to be quite slow, given the parsing+byte compilation

Re: anomaly

2015-05-11 Thread Skip Montanaro
Steven> Python is in production use in hundreds of thousands of organisations. It Steven> has been heavily used for over twenty years, in everything from quick and Steven> dirty one line scripts to hundred-thousand LOC applications. Mark> Yeah, so was COBOL. Boom. Your point being? The software

Re: Calling a function is faster than not calling it?

2015-05-11 Thread Skip Montanaro
On Mon, May 11, 2015 at 10:01 AM, BartC wrote: > (1) It has an extra argument ('code'), in addition to any normal arguments > of func (0 in this case) Which might well push execution down the unoptimized code path. Also, ISTR that Steven's original timeit runs tacked on a standalone "eval ; ..."

Re: anomaly

2015-05-11 Thread Skip Montanaro
On Mon, May 11, 2015 at 10:11 AM, zipher wrote: > I also bought the idea of everything as an object, it has a unbeatable purity > to it. But we won't ever get to the point were OOP is like the purity of > math because the greatest utility of OOP is working with real-world data. > And that rea

Responding to Raju and friends at Intsystech...

2015-05-11 Thread Skip Montanaro
> On Mon, May 11, 2015 at 11:12 AM, nagaraju thoudoju > wrote: >> >> Please find the requirement below and let me know you interest on >> this position So this Raju fellow wants to know our "interest on [sic] this position," and he's not responded appropriately to anyone's pleas to stop spamm

Re: Running cool and silent

2015-05-12 Thread Skip Montanaro
On Tue, May 12, 2015 at 4:33 AM, Rustom Mody wrote: > $ echo "min_power" | sudo tee > /sys/class/scsi_host/host*/link_power_management_policy > > makes the fan slow/stop. > > But I am not sure what it does!! My guess is it lowers the clock speed. To bring this into the realm of Python, here's so

Re: anomaly

2015-05-12 Thread Skip Montanaro
On Tue, May 12, 2015 at 10:34 AM, zipher wrote: >> The general principle here is of consenting adults: Python allows you to >> shadow built-ins because sometimes it is useful, and the good outweighs the >> potential harm. > > I think you'll have to give examples, either from the developer communit

Re: a python pitfall

2015-05-14 Thread Skip Montanaro
> I saw the following example at > http://nafiulis.me/potential-pythonic-pitfalls.html#using-mutable-default-arguments > and did not believe the output produced and had to try it for myself Pylint (and perhaps other Python "linters") would, I think, warn you that you were using a mutable objec

Re: Minimising stack trace

2015-05-15 Thread Skip Montanaro
A third alternative is to take a look at asyncore.compact_traceback. That will only help modestly in Cecil's example, but I found it helpful. Skip On Fri, May 15, 2015 at 2:04 PM, Ned Batchelder wrote: > On Friday, May 15, 2015 at 2:50:12 PM UTC-4, Cecil Westerhof wrote: >> While playing with re

fork/exec & close file descriptors

2015-05-19 Thread Skip Montanaro
Due to presumed bugs in an underlying library over which I have no control, I'm considering a restart in the wee hours of the morning. The basic fork/exec dance is not a problem, but how do I discover all the open file descriptors in the new child process to make sure they get closed? Do I simply s

Re: fork/exec & close file descriptors

2015-05-19 Thread Skip Montanaro
On Tue, May 19, 2015 at 8:33 AM, Chris Angelico wrote: > What Python version are you targeting? Are you aware of PEP 446? Yeah, I'm still on 2.7, and am aware of PEP 446. Note that many of the file descriptors will not have been created by my Python code. They will have been created by underlyi

Re: fork/exec & close file descriptors

2015-05-19 Thread Skip Montanaro
On Tue, May 19, 2015 at 8:54 AM, Chris Angelico wrote: > On Linux (and possibly some other Unixes), /proc/self/fd may be of > use. > Good point. Yes, /proc/PID/fd appears to contain all the entries for open file descriptors (I am on Linux). Skip -- https://mail.python.org/mailman/listinfo/pyth

Strategies for using cffi with C++ code?

2015-05-21 Thread Skip Montanaro
If my reading so far is correct, you can't directly apply cffi to C++ libraries. Everything has to be wrapped in "extern C" declarations, which means, practically speaking, that you have to provide factory function wrapper(s) around constructors and methods. I did find a trivial example: https://g

Re: Strategies for using cffi with C++ code?

2015-05-21 Thread Skip Montanaro
On Thu, May 21, 2015 at 12:06 PM, Laura Creighton wrote: > Skip: you may be interested in the new CFFI the pypy project just released > _today_. > > > http://morepypy.blogspot.se/search?updated-min=2015-01-01T00:00:00%2B01:00&updated-max= > 2016-01-01T00:00:00%2B01:00&max-results=11 > Laura, Su

Re: Strategies for using cffi with C++ code?

2015-05-22 Thread Skip Montanaro
2015-05-22 12:05 GMT-05:00 Lele Gaifax : > Maybe http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html? Thanks for the reference, Lele. I was thinking in terms of cffi, but this might work as well. (Shouldn't cffi interfaces be the thinnest?) Skip -- https://mail.python.org/mailman/listin

Re: Why dropbox.client.DropboxClient.put_file needs file_obj as a parameter?

2015-05-25 Thread Skip Montanaro
Looks like the file_obj is what you are reading locally, and magnum_opus.txt is the destination name on Dropbox. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: What is considered an "advanced" topic in Python?

2015-05-29 Thread Skip Montanaro
On Fri, May 29, 2015 at 11:01 AM, Mike Driscoll wrote: > ... I was wondering what the community considers to be "intermediate" or "advanced". Just about any topic on which Dave Beazley has given a keynote talk

<    3   4   5   6   7   8   9   10   11   12   >