Re: Regular Expression

2015-06-04 Thread Tim Chase
On 2015-06-04 06:36, Palpandi wrote: > This is the case. To split "string2" from "string1_string2" I am > using re.split('_', "string1_string2", 1)[1]. > > It is working fine for string "string1_string2" and output as > "string2". But actually the problem is that if a sting is > "__string1_string2

Re: Find in ipython3

2015-06-04 Thread Tim Chase
On 2015-06-04 13:09, Michael Torrie wrote: > Why not use Python for what it's good for and say pipe the results > of find into your python script? Reinventing find poorly isn't > going to buy you anything. Until you port your app to Windows where find(1) is unavailable natively ;-) -tkc -- h

Re: Function to show time to execute another function

2015-06-07 Thread Tim Golden
On 07/06/2015 11:16, Mark Lawrence wrote: On 07/06/2015 09:22, Cecil Westerhof wrote: That only times the function. I explicitly mentioned I want both the needed time AND the output. Sadly the quality of the answers on this list is going down. Here I get an alternative that does only half what

Re: Is it a newsgroup or a list?

2015-06-07 Thread Tim Golden
On 07/06/2015 12:20, random...@fastmail.us wrote: On Sun, Jun 7, 2015, at 05:06, Luca Menegotto wrote: Il 07/06/2015 10:22, Cecil Westerhof ha scritto: > That only times the function. I explicitly mentioned I want both the > needed time AND the output. > > Sadly the quality of the answer

Python NBSP DWIM

2015-06-10 Thread Tim Chase
str.split() doesn't seem to respect non-breaking space: Python 3.4.2 (default, Oct 8 2014, 10:45:20) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print(repr("hello\N{NO-BREAK SPACE}world".split())) ['hello', 'world'] What's the purpos

Re: Testing random

2015-06-17 Thread Tim Golden
On 17/06/2015 08:22, Christian Gollwitzer wrote: > Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: >> 3. >> >> >> (Whereas I predict that the ignorant will see the correct answer to >> quest

Re: Issuing a sqilte query, picking a random result, and copying to the system clipboard

2015-06-22 Thread Tim Chase
On 2015-06-21 17:08, John T. Haggerty wrote: > I'm looking to just have a simple program that will do a SQLite > query pull a random record and then copy that record too the > clipboard the system. I'm not quite seeing how to do this perhaps > this is already been done elsewhere but I spent quite a

Re: windows and file names > 256 bytes

2015-06-25 Thread Tim Golden
On 25/06/2015 10:23, Chris Angelico wrote: > On Thu, Jun 25, 2015 at 7:16 PM, Steven D'Aprano > wrote: >>> 2. Is this a bug in Python? I would prefer if Python dealt with the gory >>> details of Windows' silly behavior. >> >> I would say that it is a bug that it doesn't work with extended-length p

Re: windows and file names > 256 bytes

2015-06-25 Thread Tim Golden
On 25/06/2015 13:04, Joonas Liik wrote: > It sounds to me more like it is possible to use long file names on windows > but it is a pain and in python, on windows it is basically impossible. Certainly not impossible: you could write your own wrapper function: def extended_path(p): return r"\\?

Re: windows and file names > 256 bytes

2015-06-25 Thread Tim Golden
On 25/06/2015 14:35, Michael Torrie wrote: > On 06/25/2015 06:34 AM, Tim Golden wrote: >> On 25/06/2015 13:04, Joonas Liik wrote: >>> It sounds to me more like it is possible to use long file names on windows >>> but it is a pain and in python, on windows

Re: win32print

2015-07-01 Thread Tim Golden
On 01/07/2015 12:02, BartC wrote: > On 01/07/2015 11:15, Mark Lawrence wrote: >> On 01/07/2015 09:59, BartC wrote: >>> I need to print a text file to whatever printer in Windows is called >>> 'Generic/Text Only'. I looked for a Python solution and come acro

Re: Python programming classes for children

2015-07-01 Thread Tim Golden
On 01/07/2015 14:02, beliavsky--- via Python-list wrote: My 11yo son is taking the online class "Intermediate Programming with Python" http://www.artofproblemsolving.com/school/course/catalog/python2 offered by the Art of Problem Solving company (AoPS). Classes meet for 1.5 hours a week for 12 we

Re: Python 3 resuma a file download

2015-07-01 Thread Tim Chase
On 2015-07-01 21:51, Peter Otten wrote: > use a loop: > > CHUNKSIZE = 16*1024 # for example > while True: >data = response.read(CHUNKSIZE) >if not data: >break >out_file.write(data) > > > This can be simplified: > > shutil.copyfileobj(response, out_file) It's these little

Re: Bug in floating point multiplication

2015-07-02 Thread Tim Chase
On 2015-07-03 00:52, Steven D'Aprano wrote: > x = 1 - 1/2**53 > assert x == 0. > for i in range(1, 100): > if int(i*x) == i: > print(i); break tkc@debian:~$ python Python 2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2] on linux2 Type "help", "copyright", "credit

Re: (side-)effects and ...

2015-07-05 Thread Tim Chase
On 2015-07-05 15:36, Tim Chase wrote: > On 2015-07-05 20:29, Stefan Ram wrote: > > But why do we not have a common and well-known term for > > the counterpart, that something does not modify the state > > of the world, but that the state of the world does >

Re: (side-)effects and ...

2015-07-05 Thread Tim Chase
On 2015-07-05 20:29, Stefan Ram wrote: > But why do we not have a common and well-known term for > the counterpart, that something does not modify the state > of the world, but that the state of the world does > influence the value (behaviour) of a call such as > »datetime.datetime.now()

Re: (side-)effects and ...

2015-07-06 Thread Tim Chase
On 2015-07-06 00:44, Robert Kern wrote: >> I believe the term is "idempotent" > > No, "idempotent" means that if it changes the state, then applying > it twice or more has the same effect as applying it once. Ah, thanks for the clarification. -tkc -- https://mail.python.org/mailman/listinfo/

Re: Trouble getting to windows My Documents directory

2015-07-10 Thread Tim Chase
On 2015-07-10 09:27, Mark Storkamp via Python-list wrote: > sourcedir = os.environ['HOME']+"/Documents/" First, I'd do a couple things here to accommodate various systems to make it cross-platform: sourcedir = os.path.join( os.path.expanduser('~'), "Documents" ) > os.chdir(sourcedi

Re: Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?]

2015-07-19 Thread Tim Chase
On 2015-07-19 14:45, Steven D'Aprano wrote: >> ie we can now do > १ + २ >> 3 > > That is actually quite awesome, and I would support a new feature > that set the numeric characters to a particular script, e.g. Latin, > Arabic, Devanagari, whatever, and printed them in that same script. > I

Re: Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?]

2015-07-19 Thread Tim Chase
On 2015-07-20 04:07, Chris Angelico wrote: > The int() and float() functions accept, if I'm not mistaken, > anything with Unicode category "Nd" (Number, decimal digit). In > your examples, the fraction (U+215B) is No, and the Roman numerals > (U+2168, U+2182) are Nl, so they're not supported. Addin

Re: problem with selecting remote procedure calls

2015-07-23 Thread Tim Golden
On 23/07/2015 04:10, eric johansson wrote: > https://docs.google.com/drawings/d/1M-TzfRaSaAhFXQk1OmcmHNOaW31_7W_7q0bf8CAJqSw/edit?usp=sharing > > while this is related to my speech recognition through the next > project, is actually a good question for RPCs in general. > Specifically, are there an

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-02 Thread Tim Chase
a, b, result, expected ) ca = canonical(a) cb = canonical(b) print " Canonical A:", ca print " Canonical B:", cb print " Equal:", (ca == cb) -tim -- https://mail.python.org/mailman/listinfo/python-list

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Tim Chase
On 2015-08-02 21:54, Ben Finney wrote: > So, both XML and JSON should be considered write-only, and produced > only for consumption by a computer; they are a poor choice for > presenting to a human. > > The “INI” format as handled by the Python ‘configparser’ module is > what I would recommend for

Re: Most Pythonic way to store (small) configuration

2015-08-05 Thread Tim Chase
On 2015-08-02 12:11, Cecil Westerhof wrote: > There are a lot of ways to store configuration information: > - conf file > - xml file > - database > - json file > - and possible a lot of other ways > > I want to write a Python program to display cleaned log files. I do > not think I need a lot of c

Re: Most Pythonic way to store (small) configuration

2015-08-05 Thread Tim Chase
On 2015-08-05 06:37, Rustom Mody wrote: > > config = {} > > with open('config.ini') as f: > > for row in f: > > row = row.strip() > > if not row or row.startswith(('#', ';')): > > continue > > k, _, v = row.partition('=') > > config[k.strip().upper()] = v.lst

Re: Most Pythonic way to store (small) configuration

2015-08-05 Thread Tim Chase
On 2015-08-06 00:47, Marko Rauhamaa wrote: > > There's a certain simplicity to simply having key/value pairs > > separated by an "=" and then letting the application do whatever > > it needs/wants with those key/value strings. > > That trap has lured in a lot of wildlife. > > What to do with li

Re: Iterators membership testing

2015-08-09 Thread Tim Chase
On 2015-08-09 19:24, Chris Angelico wrote: > That's exactly right. The only way for the interpreter to handle > 'in' on an iterator is something like this: > > def contains(iter, obj): > for val in iter: > if val == obj: return True > return False Which can nicely be written as

Re: Iterators membership testing

2015-08-10 Thread Tim Chase
On 2015-08-09 19:24, Chris Angelico wrote: > That's exactly right. The only way for the interpreter to handle > 'in' on an iterator is something like this: > > def contains(iter, obj): > for val in iter: > if val == obj: return True > return False Which can nicely be written as

Re: Pipes

2015-08-11 Thread Tim Golden
On 11/08/2015 10:58, Laura Creighton wrote: The O'Reilly book Effective Computation in Physics that Larry Hudson recommended looks really good. It also occurs to me that another way to get familiar with the scientific python world is to attend a Scientific Python conference. EuroSciPy is the en

testing, please disregard

2015-08-18 Thread Tim Johnson
I have had some problems with another python.org ML. I am sending this to see if it is received. Please disregard. thanks -- Tim http://www.akwebsoft.com, http://www.tj49.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Check if dictionary empty with == {}

2015-08-19 Thread Tim Chase
On 2015-08-19 15:57, Anton wrote: > Probably a silly question. > Let's say I have a dictionary mydict and I need to test if a > dictionary is empty. > > I would use > > if not mydict: > """do something""" > > But I just came across a line of code like: > > if mydict == {}: > """do some

Re: Bug!

2015-08-22 Thread Tim Golden
On 22/08/2015 02:02, Chris Angelico wrote: The security concerns of XP aren't Python's problem, and Python isn't in the business of twisting people's arms to make them upgrade just for the sake of upgrading. However, every new version of Windows introduces new APIs and features, so maintaining su

Re: [a,b,c,d] = 1,2,3,4

2015-08-26 Thread Tim Chase
On 2015-08-25 16:59, Jean-Michel Pichavant wrote: > - Original Message - > > From: "Joel Goldstick" > > its called list unpacking or packing (?) > > > > the right side is considered a tuple because of the commas > > >>> a = 1,2,3 > > >>> a > > (1, 2, 3) > > >>> a[1] > > 2 > > To add to J

Re: Please don't make unfounded legalistic demands

2015-08-26 Thread Tim Chase
On 2015-08-26 17:20, Terry Reedy wrote: > On 8/26/2015 12:36 PM, Jean-Michel Pichavant wrote: > Are you allowed to use a newsreader or a mail+newsreader (Outlook > Express, Thunderbird, )? If so post through newsgroup > gmane.comp.python.general at news.gmane.org (as I am). Even if NNTP is block

Re: RPI.GPIO Help

2015-08-31 Thread Tim Daneliuk
On 08/16/2015 02:40 PM, John McKenzie wrote: > > Hello, all. I am hoping some people here are familiar with the RPi.GPIO > python module for the Raspberry Pi. I am not familiar with the module, but I am quite familiar with dealing with hardware interfacing, mostly in assembler. One thing you

Re: Strange location for a comma

2015-09-03 Thread Tim Chase
On 2015-09-03 14:48, Peter Otten wrote: > The only reason I see to add an extra comma are smaller and easier > to read diffs when you make a change: While that's the primary reason I do it, it's also helpful if you have a bunch of named keyword arguments and want sort/rearrange them (usually for c

Re: python

2015-09-06 Thread Tim Chase
On 2015-09-06 16:09, babi pepek wrote: > I wand update Use pip. It's like a magic wand. http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: PIP does not appear to handle diacritics correctly.

2015-09-09 Thread Tim Golden
On 09/09/2015 08:59, Laszlo Lebrun via Python-list wrote: > On Tue, 08 Sep 2015 23:35:33 +0100, Mark Lawrence wrote: > >> On 08/09/2015 20:14, Laszlo Lebrun via Python-list wrote: >>> >>> Dear group, >>> I do use Windows 7 and have a user name with diacritics. >>> >>> Whenever I am querying an ext

Re: PIP does not appear to handle diacritics correctly.

2015-09-09 Thread Tim Golden
On 09/09/2015 14:10, Chris Angelico wrote: > Don't bother responding to jmf - he's our resident Unicode troll. His > posts don't get through to me any more, except when someone responds > :) Not sure where they're getting blocked; probably at the news<->list > boundary. They're held for mailing li

Re: PIP does not appear to handle diacritics correctly.

2015-09-09 Thread Tim Golden
On 09/09/2015 17:16, Wolfgang Maier wrote: > On 09.09.2015 10:23, Chris Angelico wrote: >> On Wed, Sep 9, 2015 at 5:59 PM, Laszlo Lebrun via Python-list >> wrote: >>> Whenever I start PIP, I get: >>> "Fatal error in launcher: Unable to create process using '"C:\Users >>> \BürgerGegenFluglärm\App

Re: PIP does not appear to handle diacritics correctly.

2015-09-09 Thread Tim Golden
On 09/09/2015 08:59, Laszlo Lebrun via Python-list wrote: On Tue, 08 Sep 2015 23:35:33 +0100, Mark Lawrence wrote: On 08/09/2015 20:14, Laszlo Lebrun via Python-list wrote: Dear group, I do use Windows 7 and have a user name with diacritics. Whenever I am querying an extension with pip, it w

Re: Can't use Python Launcher on Windows after update to 3.5

2015-09-10 Thread Tim Golden
On 10/09/2015 00:52, Mark Lawrence wrote: > I've installed 3.5 for all users so it's in C:\Program Files > > From > https://docs.python.org/3.5/using/windows.html#from-the-command-line it > says "System-wide installations of Python 3.3 and later will put the > launcher on your PATH. The launcher i

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
> I was trying to find out how arithmetic on aware datetimes is "supposed > to" work, and tested with pytz. When I posted asking why it behaves this > way I was told that pytz doesn't behave correctly according to the way > the API was designed. You were told (by me) that its implementation of tzi

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
[] > My context is that I am working on an idea to include utc offsets in > datetime objects (or on a similar object in a new module), as an > alternative to something like a "fold" attribute. and since "classic > arithmetic" is apparently so important, Love it or hate it, it's flatly impossible t

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
t; mailing list already, and I'm not volunteering for another round of it >> ;-) [Alex] > Tim and Guido only grudgingly accept it, but datetime already gives you "the > pytz way" and PEP 495 makes a small improvement to it. To be clear, "Tim and Guido" have nothing

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
[Guido] >> Those pytz methods work for any (pytz) timezone -- astimezone() with a >> default argument only works for the local time zone. {Alex] > That's what os.environ['TZ'] = zonename is for. The astimezone() method > works for every timezone installed on your system. Try it - you won't even

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
[Tim] >> Me too - except I think acceptance of 495 should be contingent upon >> someone first completing a fully functional (if not releasable) >> fold-aware zoneinfo wrapping. [Alex] > Good idea. How far are you from completing that? In my head, it was done last week ;

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Tim Peters
[Alex] >>> I will try to create a zoneinfo wrapping prototype as well, but I will >>> probably "cheat" and build it on top of pytz. [Tim] >> It would be crazy not to ;-) Note that Stuart got to punt on "the >> hard part": .utcoffset(), s

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-13 Thread Tim Peters
[Alex] >>I will try to create a zoneinfo wrapping prototype as well, but I will >>probably "cheat" and build it on top of pytz. [Laura Creighton] > My question, is whether it will handle Creighton, Saskatchewan, Canada? > Creighton is an odd little place. Like all of Saskatchewan, it is > in the

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-13 Thread Tim Peters
[Tim] >> Hi, Laura! By "zoneinfo" here, we mean the IANA (aka "Olson") time >> zone database, which is ubiquitous on (at least) Linux: >> >>https://www.iana.org/time-zones >> >>So "will a wrapping of zoneinfo handle XYZ?" is

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-13 Thread Tim Peters
[Laura] >>> But I am not sure how it is that a poor soul who just wants to print a >>> railway schedule 'in local time' is supposed to know that Creighton is >>> using Winnipeg time. [Tim] >> I'm not sure how that poor soul would get a railway

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-13 Thread Tim Peters
[Tim] >> Whatever time zone the traveler's railroad schedule uses, so long as >> it sticks to just one [Laura] > This is what does not happen. Which is why I have written a python > app to perform conversions for my parents, in the past. So how did they get the ri

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-13 Thread Tim Peters
[Guido] > Wouldn't it be sufficient for people in Creighton to set their timezone to > US/Central? IIUC the Canadian DST rules are the same as the US ones. Now, > the question may remain how do people know what to set their timezone to. > But neither pytz nor datetime can help with that -- it is up

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> pytz solves it by _never_ creating a hybrid tzinfo. It only uses >> eternally-fixed-offset tzinfos. For example, for a conceptual zone >> with two possible total UTC offsets (one for "daylight", one for >> "standard"), there two distinct eter

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Guido] >> Wouldn't it be sufficient for people in Creighton to set their timezone to >> US/Central? IIUC the Canadian DST rules are the same as the US ones. Now, >> the question may remain how do people know what to set their timezone to. >> But neither pytz nor datetime can help with that -- it i

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> So, on your own machine, whenever daylight time starts or ends, you >> manually change your TZ environment variable to specify the newly >> appropriate eternally-fixed-offset zone? Of course not. [Random832 ] > No, but the hybrid zone isn't what gets attached

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> It would be nice to have! .utcoffset() is an expensive operation >> as-is, and being able to rely on tm_gmtoff would make that dirt-cheap >> instead. [Alex] > If it is just a question of optimization, Yes. If it's more than just that, then 495 doesn'

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Random832 ] Whether or not datetimes stored tm_gmtoff and tm_zone workalikes has no effect on semantics I can see. If, in your view, they're purely an optimization, they're just a distraction for now. If you're proposing to add them _instead_ of adding `fold`, no, that can't work, for the pick

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> It depends on how expensive .utcoffset() >> is, which in turn depends on how the tzinfo author implements it. [Alex] > No, it does not. In most time zones, UTC offset in seconds can be computed > by C code as a 4-byte integer Which is a specific implementation of .u

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Random832 ] > A) I'm still not sure why, but I was talking about adding an int, not a > timedelta and a string. > > B) Older python versions can't make use of either utcoffset or fold, but > can ignore either of them. I don't even see why they couldn't ignore a > timedelta and a string if we felt

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> Because all versions of Python expect a very specific pickle layout >> for _every_ kind of pickled object (including datetimes).. Make any >> change to the pickle format of any object, and older Pythons will >> simply blow up (raise an exception) when tryin

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Random832 ] > Would allowing a 16-byte string in the future have increased the storage > occupied by a 10-byte string today? Would allowing a third argument in > the future have increased the storage occupied by two arguments today? > As far as I can tell the pickle format for non-primitive types

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Tim Peters
[Tim] >> Sorry, I'm not arguing about this any more. Pickle doesn't work at >> all at the level of "count of bytes followed by a string". [Random832 ] > The SHORT_BINBYTES opcode consists of the byte b'C', followed by *yes > indeed* "count

Re: broken install?

2015-09-16 Thread Tim Golden
On 15/09/2015 11:43, Serj wrote: > Hi there! > > I just downloaded 3.5.0 install package for Win32 > (python-3.5.0-webinstall.exe) and I see some strange behaviour under Win > XP: there is no "Next" or "Run" button in wizard ))) > > Clicked into space near "Cancel" I opened "options" screen, whil

Re: True == 1 weirdness

2015-09-16 Thread Tim Chase
On 2015-09-16 10:03, Random832 wrote: > Do chained "in" comparisons ever really make sense, even when > they're all the same type? > > I mean, I suppose 1 in (1, 2) in ((1, 2), (3, 4)) is technically > true, but how useful is it really? I could concoct a "useful" example where "in" is involved in

Re: True == 1 weirdness

2015-09-16 Thread Tim Chase
On 2015-09-16 21:25, Mark Lawrence wrote: > Is it:- > > modern art == crap > > or > > modern art = crap Pretty sure they're both wrong... modern art < crap ;-) -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: True == 1 weirdness

2015-09-17 Thread Tim Chase
On 2015-09-17 22:46, Sven R. Kunze wrote: > >> Btw. ASCII art is also art. So, why does Python not have ASCII > >> art to define graphs and diagrams? > > > > Nowadays it would have to support Unicode art. Mustn't > > leave out all the world's non-English-speaking artists! > > How do I debug and mo

Re: Python, convert an integer into an index?

2015-09-23 Thread Tim Daneliuk
On 09/22/2015 04:43 PM, Chris Roberts wrote: > > (How do I make it into an index? ) > Preferably something fairly easy to understand as I am new at this. > > results = 134523 #(Integer) > > Desired: > results = [1, 2, 3, 4, 5, 2, 3] #(INDEX) > > Somehow I see ways to convert index to l

Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
I am the author of https://www.tundraware.com/Software/twander, a cross platform, macro- programmable file manager written in python/tkinter. Of late, I am seeing core dumps of this program (which has been stable/mature for some years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7. Is

Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 04:20 PM, Tim Daneliuk wrote: > I am the author of https://www.tundraware.com/Software/twander, a cross > platform, macro- > programmable file manager written in python/tkinter. > > Of late, I am seeing core dumps of this program (which has been stable/mature >

Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 05:29 PM, Paul Rubin wrote: > Tim Daneliuk writes: >> this is somehow VPS related but not sure where to start. > > How are you expecting tkinter to work on a vps, when there is no window > system? It wouldn't surprise me if tk is crashing. > You may h

Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 06:32 PM, Terry Reedy wrote: > On 9/27/2015 5:31 PM, Tim Daneliuk wrote: > >>> Of late, I am seeing core dumps of this program (which has been >>> stable/mature for some >>> years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7. > >

Re: Check if a given value is out of certain range

2015-09-29 Thread Tim Chase
On 2015-09-29 21:32, Mark Lawrence wrote: > On 29/09/2015 17:48, Rob Gaddi wrote: > >> Is there any similar elegant way to check if a value is out of > >> certain range? > >> Example - To check if x is either less than zero or greater than > >> ten? Right now I am using x < 0 or x > 10. > > > > not

Re: Question about regular expression

2015-09-30 Thread Tim Chase
On 2015-09-30 11:34, massi_...@msn.com wrote: > firstly the description of my problem. I have a string in the > following form: > > s = "name1 name2(1) name3 name4 (1, 4) name5(2) ..." > > that is a string made up of groups in the form 'name' (letters > only) plus possibly a tuple containing 1 or

Re: Question about regular expression

2015-10-01 Thread Tim Chase
On 2015-10-01 01:48, gal kauffman wrote: > items = s.replace(' (', '(').replace(', ',',').split() s = "name1 (1)" Your suggestion doesn't catch cases where more than one space can occur before the paren. -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: Finding Blank Columns in CSV

2015-10-05 Thread Tim Chase
On 2015-10-06 00:51, Chris Angelico wrote: > fn = "tmp1.csv" > fin = open(fn, 'rb') > rdr = csv.DictReader(fin, delimiter=',') > # all the same down to here > blanks = set(rdr.fieldnames) > for row in rdr: > blanks = {col for col in blanks if not row[col]} > mt = [col for col in rdr.fieldnames

Re: packaging code with compiled libraries

2015-10-06 Thread Tim Golden
On 05/10/2015 20:43, Tim wrote: > I have a package I want to share but have a question about packaging. > > Mostly the package is pure python code, but it also requires some binary > libraries (*.so, *.dll, *.dylib). I want to bundle these libs so users don't > have to

Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 14:25, MICHAEL wrote: > Hello, > > Please forgive a new user's ignorance. > > I am trying to install Python 3.5.0 on my laptop (Windows 10). The > default installation directory is shown as c:\Users\(my user > name)\AppData\Local\Programs\Python\Python35-32. However, if I select > C

Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 14:25, MICHAEL wrote: > Hello, > > Please forgive a new user's ignorance. > > I am trying to install Python 3.5.0 on my laptop (Windows 10). The > default installation directory is shown as c:\Users\(my user > name)\AppData\Local\Programs\Python\Python35-32. However, if I select > C

Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 16:27, Laura Creighton wrote: > In a message of Thu, 08 Oct 2015 15:49:56 +0100, Tim Golden writes: >> On 08/10/2015 14:25, MICHAEL wrote: >>> Hello, >>> >>> Please forgive a new user's ignorance. >>> >>> I am trying to inst

Re: Is there a Windows Python SIG?

2015-10-09 Thread Tim Golden
On 09/10/2015 03:41, Christopher Reimer wrote: > On 10/7/2015 10:49 PM, Chris Angelico wrote: >> Awesome! Contributors are always welcome. > > On a YouTube video from PyCon 2015, I think someone mentioned the need > for more people to look at Python on Windows. Does this mean that Python > on Linu

Re: Script To Remove Files Made Either By Python Or Git

2015-10-09 Thread Tim Chase
On 2015-10-09 14:01, Grant Edwards wrote: > > Is there an available script to remove file created by either > > using the Python module or by using git? > > Yes. Execute the following at the bash prompt: > > $ rm $(find . ) If you've got GNU find, you can just $ find . -type f {find-options-

Re: teacher need help!

2015-10-17 Thread Tim Golden
On 18/10/2015 00:46, Storey, Geneva wrote: I am teaching a coding class to students grades 7-12. We have been using Python, which seems to be a perfect fit. Everything was going great until this week when I began teaching turtle. Suddenly, of the 13 computers that I have, 3 began giving the me

Re: Trying to build Python

2015-10-18 Thread Tim Golden
On 17/10/2015 17:25, Jeff Archer wrote: I am trying to build Python on windows. I have gotten the source in compressed form, Python-3.5.0.tgz. Attempting to follow PCBuild\readme.txt Ran the get_externals.bat in the PCBuild folder. No apparent errors. Trying to build and getting errors: 1>

Re: teacher need help!

2015-10-19 Thread Tim Golden
On 19/10/2015 02:32, Storey, Geneva wrote: > Same issue! See attached. > Thanks! Geneva -- please try to post text, not pictures. Just use the mouse to cut-and-paste the entirety of the text from that window into an email. Otherwise some of the people who are trying to help you can't actually see

Re: Defamation

2015-10-19 Thread Tim Golden
On 19/10/2015 17:29, Laura Creighton wrote: In a message of Mon, 19 Oct 2015 08:36:37 -0600, Michael Torrie writes: On 10/19/2015 08:14 AM, Chris Angelico wrote: On Mon, Oct 19, 2015 at 7:31 AM, gaini2002--- via Python-list wrote: Please remove the page That page is just spam that someone

Re: How to make this simple code look better

2015-10-27 Thread Tim Chase
On 2015-10-27 17:24, Ganesh Pal wrote: > from myPopen import run > > def configure_network(): > """ > Prepare network for test > """ > try: > cmd = ("netadm enable -p ncp DefaultFixed") > out, err, ret = run(cmd, timeout=60) > if ret != "": > log

Re: Most space-efficient way to store log entries

2015-10-28 Thread Tim Chase
On 2015-10-29 09:38, Chris Angelico wrote: > On Thu, Oct 29, 2015 at 9:30 AM, Marc Aymerich > wrote: > > I'm writting an application that saves historical state in a log > > file. I want to be really efficient in terms of used bytes. > > Why, exactly? > > By zipping the state, you make it utterl

Re: Most space-efficient way to store log entries

2015-10-28 Thread Tim Chase
On 2015-10-29 00:21, Mark Lawrence wrote: > On 28/10/2015 22:53, Tim Chase wrote: >> If nobody is monitoring the logs, just write them to /dev/null >> for 100% compression. ;-) > > Can you get better than 100% compression if you write them to > somewhere other than /dev/

Re: python.exe is not a valid win32 executable

2015-10-29 Thread Tim Golden
On 29/10/2015 16:14, Steffen Herzfeldt wrote: I just wanted to let you know that your program just doesn't work on WinXP. I guess you just think "Linux is better anyway" to which i agree until it comes to games requiring directx, but that doesn't change the fact that the installer was labeled as

Re: UNABLE TO GET IDLE TO RUN

2015-11-01 Thread Tim Golden
On 01/11/2015 14:27, Steven D'Aprano wrote: I remember from a few weeks back, a teacher with the same problem posted this on the mailinglist. Eventually she had a technician coming in to reinstall Windows, just to fix this problem ;-) What an overkill... If that is true, that's really sad. Were

Re: python doesn't install

2015-11-01 Thread Tim Golden
On 02/11/2015 00:08, Daniel Joffe wrote: WinXP...32 bits...professional I keep getting message note also that there is no place on the install box to start...you just click somewhere, and the install started. I'm afraid you've been bitten by the fact that we no longer support Windows XP an

Re: python doesn't install

2015-11-02 Thread Tim Golden
On 02/11/2015 06:16, Tim Golden wrote: > On 02/11/2015 00:08, Daniel Joffe wrote: >> WinXP...32 bits...professional >> >> I keep getting message >> >> >> note also that there is no place on the install box to start...you just >> click somewhere, and t

Re: Regular expressions

2015-11-02 Thread Tim Chase
On 2015-11-02 20:09, Seymore4Head wrote: > How do I make a regular expression that returns true if the end of > the line is an asterisk Why use a regular expression? if line[-1] == '*': yep(line) else: nope(line) -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: Regular expressions

2015-11-03 Thread Tim Chase
On 2015-11-03 10:25, Peter Otten wrote: > >>> How do I make a regular expression that returns true if the end > >>> of the line is an asterisk > >> > >> Why use a regular expression? > >> > >> if line[-1] == '*': > >> yep(line) > >> else: > >> nope(line) > > Incidentally the code exa

Re: Regular expressions

2015-11-03 Thread Tim Chase
On 2015-11-02 22:17, Seymore4Head wrote: > On Mon, 2 Nov 2015 20:42:37 -0600, Tim Chase > wrote: > > >On 2015-11-02 20:09, Seymore4Head wrote: > >> How do I make a regular expression that returns true if the end > >> of the line is an asterisk > > > &g

Re: Irregular last line in a text file, was Re: Regular expressions

2015-11-03 Thread Tim Chase
On 2015-11-03 16:35, Peter Otten wrote: > I wish there were a way to prohibit such files. Maybe a special > value > > with open(..., newline="normalize") f: > assert all(line.endswith("\n") for line in f) > > to ensure that all lines end with "\n"? Or even more valuable to me: with open(

Re: Irregular last line in a text file, was Re: Regular expressions

2015-11-03 Thread Tim Chase
On 2015-11-03 11:39, Ian Kelly wrote: > >> because I have countless loops that look something like > >> > >> with open(...) as f: > >> for line in f: > >> line = line.rstrip('\r\n') > >> process(line) > > > > What would happen if you read a file opened like this without > > iter

Re: Regular expressions

2015-11-03 Thread Tim Chase
ses fixed strings rather than regular expressions. By default, `grep` certainly does use regular expressions: tim@linux$ seq 5 | grep "1*" tim@bsd$ jot 5 | grep "1*" will output the entire input, not just lines containing a "1" followed by an asterisk. > I&

Re: Creating PST files using Python

2015-11-04 Thread Tim Golden
On 03/11/2015 22:12, Chris Angelico wrote: > On Wed, Nov 4, 2015 at 6:09 AM, Anthony Papillion > wrote: >> Does anyone know of a module that allows the wiring of Outlook PST >> files using Python? I'm working on a project that will require me >> to migrate 60gb of maildir mail (multiple accounts)

<    21   22   23   24   25   26   27   28   29   30   >