Re: Popen

2009-07-24 Thread Tim
Thanks! If that is the case, i.e. the parent doesn't wait, is the code in my last post wrong? "result" could be nothing. --- On Fri, 7/24/09, Diez B. Roggisch wrote: > From: Diez B. Roggisch > Subject: Re: Popen > To: python-list@python.org > Date: Friday, Ju

Re: Making safe file names

2013-05-09 Thread Tim Chase
On 2013-05-10 12:04, Gregory Ewing wrote: > Roy Smith wrote: > > http://en.wikipedia.org/wiki/The_band > > Nope... googling for "the band" brings that up as the > very first result. > > The Google knows all. You cannot escape The Google... That does it. I'm naming my band "Google". :-) -tkc

Re: Python for philosophers

2013-05-15 Thread Tim Daneliuk
ow questions like the OPs ought be resolved, please read: http://pvspade.com/Sartre/cookbook.html -- ---- Tim Daneliuk tun...@tundraware.com PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for philosophers

2013-05-15 Thread Tim Daneliuk
On 05/15/2013 10:43 PM, Terry Jan Reedy wrote: On 5/15/2013 9:17 PM, Tim Daneliuk wrote: http://pvspade.com/Sartre/cookbook.html Wikedly funny. "Today I made a Black Forest cake out of five pounds of cherries and a live b

Re: Python for philosophers

2013-05-15 Thread Tim Daneliuk
On 05/15/2013 11:49 PM, alex23 wrote: On May 16, 11:17 am, Tim Daneliuk wrote: http://pvspade.com/Sartre/cookbook.html Best recipe for tuna casserole ever! Cheers for this :) "I have have realized that the traditional omelet form (eggs and cheese) is bour

Re: spilt question

2013-05-16 Thread Tim Chase
On 2013-05-16 08:00, loial wrote: > I want to split a string so that I always return everything BEFORE > the LAST underscore > > HELLO_.lst # should return HELLO > HELLO_GOODBYE_.ls # should return HELLO_GOODBYE > > I have tried with rsplit but cannot get it to work. .r

Re: Python for philosophers

2013-05-16 Thread Tim Daneliuk
On 05/16/2013 09:27 AM, Grant Edwards wrote: On 2013-05-16, Tim Daneliuk wrote: On 05/15/2013 08:01 PM, Ned Batchelder wrote: On 5/11/2013 4:03 PM, Citizen Kant wrote: Don't get me wrong. I can see the big picture and the amazing things that programmers write on Python, it's ju

Re: Number of cells, using CSV module

2013-05-16 Thread Tim Chase
On 2013-05-16 14:07, Skip Montanaro wrote: > > len(reader) gives me an error. > > Apologies. len(list(reader)) should work. Of course, you'll wind > up loading the entire CSV file into memory. You might want to just > count row-by-row: > > n = 0 > for row in reader: > n += 1 which can nic

Re: Number of cells, using CSV module

2013-05-16 Thread Tim Chase
On 2013-05-16 14:08, Skip Montanaro wrote: > > So rather than > >>a > >>b > >>c > >>d > >>e > >>f > > I would get [a, b, c, d, e, f] > > all_items = [] > for row in reader: > all_items.append(row[0]) And following up here, this could be tidily rewritten as all_items = [row[0] for row in re

Re: How to write fast into a file in python?

2013-05-19 Thread Tim Roberts
Carlos Nepomuceno wrote: >Python really writes '\n\r' on Windows. Just check the files. It actually writes \r\n, but it's not Python that's doing it. It's the C runtime library. And, of course, you can eliminate all of that by opening the file in binary mode open

Re: Static Maps from Lat Long data in XLS file

2013-05-21 Thread Tim Daneliuk
mage, but rather Google returns an image when that url is used. Any tips or pointers are much appreciated! https://pypi.python.org/pypi/xlrd -- ------- Tim Daneliuk -- http://mail.python.org/mailman/listinfo/python-list

Re: A computer programmer, web developer and network admin resume

2013-05-21 Thread Tim Chase
On 2013-05-22 01:15, i...@databaseprograms.biz wrote: > A computer programmer, web developer and network administrator ...walk into a bar... So what's the punchline? -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: A computer programmer, web developer and network admin resume

2013-05-22 Thread Tim Chase
On 2013-05-22 16:39, Chris Angelico wrote: > On Wed, May 22, 2013 at 12:32 PM, Tim Chase > wrote: > > On 2013-05-22 01:15, i...@databaseprograms.biz wrote: > >> A computer programmer, web developer and network administrator > > > > ...walk into a bar..

Re: Scope of a class..help???

2013-05-23 Thread Tim Roberts
ill automatically refer to the global class. It won't. The only way to solve this dilemma is to change the name you use in the "while" loop. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Prepending string "@" to usernames

2013-05-24 Thread Tim Chase
On 2013-05-24 19:04, Thomas Murphy wrote: >> raw_address = "cookielover93 TheGermanHatesSaurkraut >> WhatsThatBoy932834" address_library = raw_address.split() >> print address_library >> >> final_address = [] >> for address in address_library: >> final_address.append("@" + str(address)) >> prin

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-26 Thread Tim Roberts
latin-1'? Because that's the default character set for pymysql. You could have learned this yourself -- you have the full source code for pymysql on your machine. You can override the default character set: con = pymysql.connect( db = 'metrites', host = 'lo

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Tim Chase
ubdirectory) in /etc as root, then "chown" it to have a group for which certain users can be members. Something like $ su - # or "sudo sh" # addgroup bibhusers # mkdir /etc/bibhu # chown :bibhusers /etc/bibhu # chmod g+rwx /etc/bibhu # for user in bibhu tim

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread Tim Delaney
> > A programmer chooses his own clients, and you are the Atherton Wing to > my Inara Serra. > I've just been watching this train wreck (so glad I didn't get involved at the start) but I have to say - that's brilliant Chris. Thank you for starting my week off so

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread Tim Delaney
On 3 June 2013 09:10, Tim Delaney wrote: > A programmer chooses his own clients, and you are the Atherton Wing to >> my Inara Serra. >> > > I've just been watching this train wreck (so glad I didn't get involved at > the start) but I have to say - that's br

Re: PyWart: The problem with "print"

2013-06-02 Thread Tim Delaney
tunately, by reducing to a single thread + single semaphore slot I was able to turn it from a Heisenbug to a 100% replicable bug. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: How to increment date by week?

2013-06-04 Thread Tim Chase
On 2013-06-04 14:31, PieGuy wrote: >Starting on any day/date, I would like to create a one year > list, by week (start date could be any day of week). Having a > numerical week index in front of date, ie 1-52, would be a bonus. > ie, 1. 6/4/2013 2. 6/11/2013 3. 6/18/2013etc to # 52. i

Re: Do you consider Python a 4GL? Why (not)?

2013-06-04 Thread Tim Chase
On 2013-06-05 02:53, Carlos Nepomuceno wrote: > Do you consider Python a 4GL? Why (not)? Of course it's a 4GL ("4 Guido Language"). You think he wrote it for somebody else? Unless you have some magical list of criteria that makes your own definition of "4GL", in which case you should look at you

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Tim Roberts
#x27;s domain. When ASCII became unavoidable, most programs changed to using 5x 12-bit "bytes" per word. Ah, memories. I spent 10 years working for Control Data. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Tim Golden
On 05/06/2013 16:14, Armando Montes De Oca wrote: > On Wednesday, June 5, 2013 10:40:52 AM UTC-4, Armando Montes De Oca wrote: >> Traceback (most recent call last): >> >> File "Guessing_Game.py", line 32, in >> >> input (enter) >> >> File "", line 0 >> >> ^ >> >> SyntaxError: unexpecte

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Tim Chase
On 2013-06-05 17:57, ru...@yahoo.com wrote: > On 06/05/2013 05:19 PM, Dennis Lee Bieber wrote: > stories over the years where people where convicted (or > at least charged with) violating the DMCA (or perhaps > equally draconian followup U.S. laws) even though they > clearly penetrated the system

Idiomatic Python for incrementing pairs

2013-06-07 Thread Tim Chase
Playing around, I've been trying to figure out the most pythonic way of incrementing multiple values based on the return of a function. Something like def calculate(params): a = b = 0 if some_calculation(params): a += 1 if other_calculation(params): b += 1 return (a,

Re: Idiomatic Python for incrementing pairs

2013-06-07 Thread Tim Chase
On 2013-06-07 23:46, Jason Swails wrote: > On Fri, Jun 7, 2013 at 10:32 PM, Tim Chase > > def calculate(params): > > a = b = 0 > > if some_calculation(params): > > a += 1 > > if other_calculation(params): > > b += 1 > >

Re: Idiomatic Python for incrementing pairs

2013-06-07 Thread Tim Chase
On 2013-06-08 07:04, Carlos Nepomuceno wrote: > alpha, beta = (1 if some_calculation(params) else 0, 1 if > other_calculation(params) else 0) This one sets them to absolute values, rather than the incrementing functionality in question: > > alpha += temp_a > > beta += temp_b The actual code

Re: Redirecting to a third party site with injected HTML

2013-06-09 Thread Tim Chase
On 2013-06-09 10:09, guytam...@gmail.com wrote: > I'm working on a new project and i want to receive a request from a > user and to redirect him to a third party site, but on the page > after i redirect my users i want to them to see injected html (on > the third party site.) As others have stated

Re: Re-using copyrighted code

2013-06-09 Thread Tim Chase
On 2013-06-09 19:30, Mark Janssen wrote: > Thanks for digging out the legal code. Upon reading, it is > stunningly clear that the legal system has not established a solid > framework or arching philosophy in which to contain and express the > desire (in law) to protect content creators of all kind

Re: Split a list into two parts based on a filter?

2013-06-10 Thread Tim Chase
On 2013-06-11 08:50, Chris Angelico wrote: > The iterator version strikes my fancy. Maybe this isn't of use to > you, but I'm going to try my hand at making one anyway. > > >>> def iterpartition(pred,it): > """Partition an iterable based on a predicate. > > Returns two iterables, for

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Tim Chase
On 2013-06-11 08:54, Chris Angelico wrote: > >> Another principle similar to 'Don't add extraneous code' is > >> 'Don't rebind builtins'. > > > > OK, we've all done it by accident (especially when starting out), > > but are there people that rebind builtins intentionally? > > There are times when

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Tim Chase
On 2013-06-10 17:20, Mark Janssen wrote: > >> list = [] > >> Reading further, one sees that the function works with two > >> lists, a list of file names, unfortunately called 'list', > > > > That is very good advice in general: never choose a variable name > > that is a keyword. > > Btw,

Re: A certainl part of an if() structure never gets executed.

2013-06-11 Thread Tim Roberts
is not a tuple. My guess is that this will work fine: cur.execute( "SELECT * FROM works WHERE YEAR(lastvisit)=%s ORDER BY lastvisit", (year,) ) It seems silly to fire up a regular expression compiler to look for a single character. if name.find('=') < 0 and month.find('=') < 0 and year.find('=') < 0: -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-12 Thread Tim Chase
[much of my reply echos Chris but elaborate] On 2013-06-13 10:04, Chris Angelico wrote: > On Thu, Jun 13, 2013 at 9:27 AM, cutems93 > wrote: > > Currently I am considering four software: git, SVN, > > CVS, and Mercurial. > > Don't touch CVS unless you absolutely have to. SVN is also > distinctly

Re: Version Control Software

2013-06-12 Thread Tim Chase
On 2013-06-12 16:27, cutems93 wrote: > I am looking for an appropriate version control software for python > development, and need professionals' help to make a good decision. While I'm generally a git user (see my other email), I'll also put in a plug for Fossil which has

Re: Version Control Software

2013-06-13 Thread Tim Chase
On 2013-06-13 10:20, Serhiy Storchaka wrote: > 13.06.13 05:41, Tim Chase написав(ла): > > -hg: last I checked, can't do octopus merges (merges with more > > than two parents) > > > > +git: can do octopus merges > > Actually it is possible in Mercurial. Okay,

Re: How to get an integer from a sequence of bytes

2013-06-13 Thread Tim Roberts
Fábio Santos wrote: >On 5 Jun 2013 06:23, "Tim Roberts" wrote: >> A single machine word was 60 bits, so a single register read got you 10 >> characters. > >10 characters! Now that sounds like it's enough to actually store a word. >However long words c

Re: My son wants me to teach him Python

2013-06-14 Thread Tim Chase
9.jpg" where the date comes from EXIF data, and a fixed string is replaced. The idea of operating in batch on any data is pretty much always a command-line win. -tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll

2013-06-14 Thread Tim Chase
On 2013-06-14 13:56, D'Arcy J.M. Cain wrote: > > I prefer to simply mail the list. You should be able to mute > > entire threads, and he doesn't start more than a couple a day > > usually. > > But then I have to deal with each thread. I don't want to deal with > them at all. At least Thunderbird

Re: Version Control Software

2013-06-14 Thread Tim Delaney
ing the Mercurial and CC clients in sync. Turns out that CCRC was the best option, as I was able to parse its local state files and work out what timestamp ClearCase thought its files should be, set it appropriately from a Mercurial extension and convince CCRC that really, only these files have change

Re: Version Control Software

2013-06-15 Thread Tim Delaney
long as at some point I can sync the repositories, I can work away (on things that are not dependent on something new from upstream). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: A certainl part of an if() structure never gets executed.

2013-06-15 Thread Tim Roberts
, or if they're all true, the last value. Why? Because it can't know whether the whole expression is true unless it looks at every value. So: 0 and 1 and 'what' ==> 0 1 and 0 and 'what' ==> 0 1 and None and 0 ==> None 1 and 1 and 'what' ==> 'what' -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic if statement

2013-06-18 Thread Tim Chase
On 2013-06-18 07:10, upperdec...@gmail.com wrote: > I have a set of queries that are run against various > databases/tables. The result is all the same in that I always get > back the same field names. > > I query fld1, fld2, fld3, qty, qty2 from table1 > then I loop thru the results > if fld1

Re: dynamic if statement

2013-06-18 Thread Tim Chase
On 2013-06-18 16:27, Mark Lawrence wrote: > On 18/06/2013 15:56, Tim Chase wrote: > > name_index_map = dict( > >(info[0], i) > >for info, i in enumerate(cursor.description) > > Looks like this should be :- > for i, info in enumerate(cursor.des

Re: A certainl part of an if() structure never gets executed.

2013-06-18 Thread Tim Roberts
Nick the Gr33k wrote: > >On 16/6/2013 4:55 ??, Tim Roberts wrote: > >> Nick the Gr33k wrote: >> Because Python lets you use arbitrary values in a Boolean context, the net >> result is exactly the same. > >What is an arbitrary value? don even knwo what arbit

Re: Default Value

2013-06-20 Thread Tim Chase
On 2013-06-21 01:08, Steven D'Aprano wrote: > Here's my syntax plucked out of thin air: > > def func(arg, x=expression, !y=expression): > ... > > where y=expression is late-bound, and the above is compiled to: > > def func(arg, x=expression, y=None): > if y is None: > y = express

Re: Default Value

2013-06-20 Thread Tim Chase
On 2013-06-20 21:40, Roy Smith wrote: > In article , > Tim Chase wrote: > > > On 2013-06-21 01:08, Steven D'Aprano wrote: > > > Here's my syntax plucked out of thin air: > > > > > > def func(arg, x=expression, !y=expression): > > >

Re: Python development tools

2013-06-23 Thread Tim Chase
On 2013-06-23 20:22, Roy Smith wrote: > In article , > ru...@yahoo.com wrote: >> Other things like finding all uses of various objects/functions >> etc would also be useful now and then but I suppose that is a >> common IDE capability? > > $ find . -name '*.py' | xargs grep my_function_name > >

Re: Is this PEP-able? fwhile

2013-06-24 Thread Tim Chase
On 2013-06-25 07:38, Chris Angelico wrote: > Python has no issues with breaking out of loops, and even has > syntax specifically to complement it (the 'else:' clause). Use > break/continue when appropriate. from minor_gripes import breaking_out_of_nested_loops_to_top_level -tkc -- http://mail.

Re: Is this PEP-able? fwhile

2013-06-24 Thread Tim Chase
On 2013-06-24 23:39, Fábio Santos wrote: > On 24 Jun 2013 23:35, "Tim Chase" wrote: > > On 2013-06-25 07:38, Chris Angelico wrote: > > > Python has no issues with breaking out of loops, and even has > > > syntax specifically to complement it (the 'els

Re: newbie question

2013-06-25 Thread Tim Rowe
hat is *terrible* practice in a modern high-level language. Use the library functions. They will take proper account of the character set being used (which you shouldn't even have to know for a task like this, let alone make unsafe assumptions about). -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL code generation from table-free boolean queries?

2013-06-26 Thread Tim Chase
On 2013-06-26 16:17, Foo Stack wrote: > Given string input such as: > foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello' > > I am going to implement: > > - boolean understanding (which operator takes precendence) > - spliting off of attributes into my function which computes their >

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Tim Chase
On 2013-06-28 09:02, Cameron Simpson wrote: > On 27Jun2013 11:50, Ethan Furman wrote: > | If the OP is writing an interactive shell, shouldn't `cmd` be used > | instead of `argparse`? argparse is, after all, intended for > | argument parsing of command line scripts, not for interactive > work. >

Re: Closures in leu of pointers?

2013-06-29 Thread Tim Chase
On 2013-06-29 19:19, Steven D'Aprano wrote: > Nobody ever asks why Python doesn't let you sort an int, or take > the square of a list... just to be ornery, you can sort an int: >>> i = 314159265 >>> ''.join(sorted(str(i))) '112345569' And I suppose, depending on how you define it, you can square

Re: Persistence of CGI (was: OSError [Errno 26] ?!?!)

2013-07-02 Thread Tim Chase
On 2013-07-03 00:19, Steven D'Aprano wrote: > CGI didn't stop working just because more powerful, or better, > alternatives now exist. And for most exceptionally cheap hosting services, your choices are usually limited to PHP, static HTML (possibly server-side includes if you're lucky), or CGI.

Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread Tim Roberts
%1" %* You can create your own, if you want. If you want files with a .script extension to run PythonW, you can type: assoc .script=Python.NoConFile -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 02:34, Andrew Berg wrote: > DOS is long > dead, and is much, much different under the hood from the console > subsystem in modern versions of Windows. While this is clearly true, it's by no means unusual for people to refer to the "DOS Box" or talk about "DOS commands" etc. even whe

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 09:28, Andrew Berg wrote: > On 2013.07.03 02:34, Tim Golden wrote: >> While this is clearly true, it's by no means unusual for people to >> refer to the "DOS Box" or talk about "DOS commands" etc. even when >> they're quite w

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Chase
On 2013-07-03 09:51, Tim Golden wrote: > We can certainly agree on this. I can't count the number of emails > I've deleted as too hot-headed in response to dismissive comments > about Windows as a platform. Some of them, at least, appear to be > from people who last actuall

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 13:50, Tim Chase wrote: > On 2013-07-03 09:51, Tim Golden wrote: >> We can certainly agree on this. I can't count the number of emails >> I've deleted as too hot-headed in response to dismissive comments >> about Windows as a platform. Some of them,

Re: python.exe crash if opencv tries to access busy webcam

2013-07-03 Thread Tim Golden
On 03/07/2013 14:25, ifelset...@gmail.com wrote: > Hello, > > > I have a while loop taking images every 5 minutes from webcam. > Unfortunately, if the camera is busy, python.exe crashes and there is > no exception to catch. Is there a way to check if camera is busy to > avoid the crash? If pytho

Re: Important features for editors

2013-07-04 Thread Tim Chase
On 2013-07-04 05:02, Dave Angel wrote: [snip an excellent list of things to look for in an editor] Also, - the ability to perform changes in bulk, especially across files. Often, this is done with the ability to record/playback macros, though some editors have multiple insertion/edit cursors

Re: Important features for editors

2013-07-04 Thread Tim Chase
On 2013-07-04 15:24, MRAB wrote: > On 04/07/2013 14:22, Tim Chase wrote: > > Other nice-to-haves include > > > > - Unicode support (including various encodings) > > It's 2013, yet Unicode support is merely a "nice-to-have"? Yeah, while I use Vim and it&

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Tim Chase
On 2013-07-05 22:08, Νίκος Gr33k wrote: > Is there a way to extract out of some environmental variable the > Geo location of the user being the city the user visits out website > from? > > Perhaps by utilizing his originated ip address? Yep. You can get an 11MB database (17MB uncompressed) http

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Tim Roberts
h a block of IP addresses. That does not necessarily bear any resemblence to the actual location of the user. It tells you the location of the Internet provider that registered the IP addresses. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Tim Chase
On 2013-07-05 22:59, Support by Νίκος wrote: > Στις 5/7/2013 10:58 μμ, ο/η Tim Chase έγραψε: > > On 2013-07-05 22:08, Νίκος Gr33k wrote: > >> Is there a way to extract out of some environmental variable the > >> Geo location of the user being the city the user v

Re: Geo Location extracted from visitors ip address

2013-07-06 Thread Tim Chase
On 2013-07-06 11:41, Νίκος Gr33k wrote: > you know when i go to maps.google.com its always find my exact city > of location and not just say Europe/Athens. > > and twitter and facebook too both of them pinpoint my _exact_ > location. > > How are they able to do it? We need the same way. A couple

Re: Geo Location extracted from visitors ip address

2013-07-06 Thread Tim Chase
On 2013-07-06 23:14, Νίκος Gr33k wrote: Can you be more specific please about using the aforementioned > HTML5 location API ? https://www.google.com/search?q=html5+location+api It's client-side JavaScript. > Never heard of it. Can it be utilizized via a python cgi script? Because it's client-s

Re: Geo Location extracted from visitors ip address

2013-07-06 Thread Tim Chase
On 2013-07-06 23:12, Νίκος Gr33k wrote: > I though that the ownership of the script file controlled the > privileges it runs under. Only if the script is SUID. In some environments, scripts can't be run SUID, only binaries. > Who controlls the script's privileges then? > The process that cal

Re: RE Module Performance

2013-07-12 Thread Tim Delaney
e. If you are finding that regular expressions are taking too much time, have a look at the https://pypi.python.org/pypi/re2/ and https://pypi.python.org/pypi/regex/2013-06-26 modules to see if they already give you enough of a speedup. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: hex dump w/ or w/out utf-8 chars

2013-07-12 Thread Tim Roberts
Joshua Landau wrote: > >Isn't a superscript "c" the symbol for radians? That's very rarely used. More common is "rad". The problem with a superscript "c" is that it looks too much like a degree symbol. -- Tim Roberts, t...@probo.com Providenza

Re: How do I get the OS System Font Directory(Cross-Platform) in python?

2013-07-12 Thread Tim Roberts
onts directory. Linux doesn't even have a dedicated windowing system. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-13 Thread Tim Delaney
On 13 July 2013 09:16, MRAB wrote: > On 12/07/2013 23:16, Tim Delaney wrote: > >> On 13 July 2013 03:58, Devyn Collier Johnson > <mailto:devyncjohnson@gmail.**com >> wrote: >> >> >> Thanks for the thorough response. I learned a lot. You should writ

Re: GeoIP2 for retrieving city and region ?

2013-07-14 Thread Tim Chase
On 2013-07-13 16:57, Michael Torrie wrote: > On 07/13/2013 12:23 PM, Νικόλας wrote: > > Do you know a way of implementing anyone of these methods to a > > script? > > Yes. Modern browsers all support a location API in the browser for > javascript. And the good browsers give the user the option

Re: Dihedral

2013-07-15 Thread Tim Delaney
passes the Turing test? > > Yes, absolutely. The original Turing test was defined in terms of five > minutes of analysis, and Dihedral and jmf have clearly been > indistinguishably human across that approximate period. > The big difference between them is that the jmfbot does not appear to evolve its routines in response to external sources - it seems to be stuck in a closed feedback loop. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Script Hashplings

2013-07-26 Thread Tim Golden
On 26/07/2013 11:37, Devyn Collier Johnson wrote: > > On 07/25/2013 09:54 AM, MRAB wrote: >> On 25/07/2013 14:42, Devyn Collier Johnson wrote: >>> If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) >>> and Python3.3 is not installed, but Python3.2 is installed, would the >>> s

Re: [Savoynet] G&S Opera Co: Pirates of Penzance

2013-07-28 Thread Tim Chase
On 2013-07-28 16:49, Ethan Furman wrote: > On 07/28/2013 10:57 AM, Chris Angelico wrote: > . > . > . > > Okay, how did you get confused that this was a Python List > question? ;) Must have been this ancient thread http://mail.python.org/pipermail/python-list/2006-September/376063.ht

dynamic type returning NameError:

2013-07-28 Thread Tim O'Callaghan
Hi, I hope that this hasn't been asked for the millionth time, so my apologies if it has. I have a base class (BaseClass - we'll call it for this example) with an http call that i would like to inherit into a dynamic class at runtime. We'll call that method in BaseClass; 'request'. I have

Re: dynamic type returning NameError:

2013-07-28 Thread Tim O'Callaghan
On Sunday, July 28, 2013 10:51:57 PM UTC-4, Terry Reedy wrote: > On 7/28/2013 9:38 PM, Tim O'Callaghan wrote: > > > Hi, > > > > > > I hope that this hasn't been asked for the millionth time, so my apologies > > if it has. > > > > &

Re: dynamic type returning NameError:

2013-07-29 Thread Tim O'Callaghan
On Monday, July 29, 2013 1:43:39 AM UTC-4, Steven D'Aprano wrote: > On Sun, 28 Jul 2013 18:38:10 -0700, Tim O'Callaghan wrote: > > > > > Hi, > > > > > > I hope that this hasn't been asked for the millionth time, so my > > > apolo

Re: import syntax

2013-07-29 Thread Tim Chase
On 2013-07-29 15:48, Devyn Collier Johnson wrote: > The PEP8 recommends importing like this: > > import os > import re > > not like this: > > import os, re > > Why is that? Is there a performance advantage to one of the styles? While I don't believe there's much of a performance difference (if

Re: import syntax

2013-07-29 Thread Tim Chase
On 2013-07-29 16:09, Dave Angel wrote: > On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: > > The PEP8 recommends importing like this: > > > > import os > > import re > > > > not like this: > > > > import os, re > > I got a bit further, and if I'm only using a couple of functions > from the imp

Re: must be dicts in tuple

2013-07-29 Thread Tim Roberts
re supposed to have dicts in a tuple. What you have is a dict in a tuple in a tuple. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-30 Thread Tim Delaney
ng that doing the above in any language which has immutable strings is completely insane you will have no credibility and the only interest anyone will pay to your posts is refuting your FUD so that people new to the language are not driven off by you. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 79 char max

2013-07-31 Thread Tim Chase
On 2013-07-31 07:16, Joshua Landau wrote: > On 30 July 2013 18:52, Grant Edwards wrote: >> I also find intializers for tables of data to be much more easily >> read and maintained if the columns can be aligned. > > Why do you have tables in your Python code? I've had occasion to write things like

Re: Best data structure for DFS on large graphs

2012-07-03 Thread Tim Chase
On 07/03/12 08:39, Miheer Dewaskar wrote: > On Tue, Jul 3, 2012 at 4:53 PM, Stefan Behnel wrote: >> >> Miheer Dewaskar, 03.07.2012 13:11: >>> I am not sure,but if there are large number of states Dictionaries wont >>> help much right? >> >> Dicts are fast for lookup, not for searching. >> > What d

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-04 Thread Tim Roberts
ck. After all, you don't patch code on a byte-by-byte basis -- you just change function bindings. That can be done atomically. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 01:39, yeryomin.i...@gmail.com wrote: > On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote: yes, yes I did, almost 5 years ago. :-) You didn't include any questions/comments on my email, so it's a bit hard to respond. >> While I haven't intervie

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 08:25, Roy Smith wrote: >> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote: > >>> - more detailed questions about the std. libraries (such as >>>datetime/email/csv/zipfile/networking/optparse/unittest) > > You need to be careful whe

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 17:53, Devin Jeanpierre wrote: >> One of my favourite questions when interviewing - and it was >> 100% reliable :-) - "what are your hobbies?" If the answer >> included programming then they were hired, if not, then they >> went to the "B" list. > > Woe is the poor college grad, who wa

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 18:12, Cameron Simpson wrote: > On 09Jul2012 18:53, Devin Jeanpierre wrote: > | On Mon, Jul 9, 2012 at 5:22 PM, Peter wrote: > | > One of my favourite questions when interviewing - and it was 100% > reliable :-) - "what are your hobbies?" > | > If the answer included programming then

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 19:01, dnca...@gmail.com wrote: > The set of questions I'm not sure I understand is the 'What > version did ... appear?' questions. This, to me, doesn't seem to > indicate any programming experience or expertise. A question > asking 'Do you understand different versions?' and 'How wou

Re: Python Interview Questions

2012-07-09 Thread Tim Chase
On 07/09/12 19:27, Roy Smith wrote: >> prefer folks that know which features to check availability for >> deployment. > > Heh. Tell me, when did strings get methods? :-) IIRC, ~2.0? I'm cognizant of the shift happening from the string module to string methods, but I wouldn't expect deep history

Re: How can I disable module of tkinter when compiling Python 2.5 on redhat9 ?

2012-07-09 Thread Tim Roberts
cheetah wrote: > >I don't need it. It's not worth worrying about. You're talking about way less than a megabyte of disk space, and there is no performance penalty unless you're using it. In general, the parts of the Python standard library are not individually sele

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Tim Chase
On 07/17/12 12:24, Terry Reedy wrote: > On 7/17/2012 8:01 AM, Lipska the Kat wrote: >> In bash this is laughably trivial >> >> sort -nr $1 | head -${2:-10} > > Won't sort work alphabetically and leave the following as is? > > 1\talpha > 11\tbeta > 2\tgamma Only if Lipska had omitted the "-n" whi

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Tim Chase
On 07/17/12 12:29, Ethan Furman wrote: > Terry Reedy wrote: >> On 7/17/2012 10:23 AM, Lipska the Kat wrote: >> >>> Well 'type-bondage' is a strange way of thinking about compile time type >>> checking and making code easier to read (and therefor debug >> >> 'type-bondage' is the requirement to rest

Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import csv >>> from cStringIO import StringIO >>> s = String

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 06:21, Tim Chase wrote: > tim@laptop:~/tmp$ python > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import cs

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 08:52, Hans Mulder wrote: > Perhaps it should be documented that the Sniffer doesn't work > on single-column data. I think this would involve the least change in existing code, and go a long way towards removing my surprise. :-) > If you really need to read a one-column csv file, yo

<    1   2   3   4   5   6   7   8   9   10   >