Re: Why exception from os.path.exists()?

2018-06-13 Thread Peter J. Holzer
On 2018-06-11 14:23:42 +0300, Marko Rauhamaa wrote: > "Peter J. Holzer" : > > On 2018-06-11 01:06:37 +, Steven D'Aprano wrote: > >> Baking a limitation of some file systems into the high-level > >> interface is simply a *bad idea*. > > > &g

Re: Why exception from os.path.exists()?

2018-06-13 Thread Peter J. Holzer
On 2018-06-13 23:56:09 +0300, Marko Rauhamaa wrote: > "Peter J. Holzer" : > > POSIX specifies a number of error codes which can be returned by stat(): [...] > > So none of these is a good choice for the errno parameter of an OSError > > to be thrown. > > Th

Re: ironpython not support py3.6

2018-06-23 Thread Peter J. Holzer
t beyond "not ready yet". hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https

Re: translating foreign data

2018-06-23 Thread Peter J. Holzer
interpreter should not use the locale when parsing Python, and a program producing Python should also ignore the locale. You two also seem to be writing about different things when you write "THE locale". Steven seems to mean the global settings a user has chosen, you seem to mean the specid

Re: translating foreign data

2018-06-23 Thread Peter J. Holzer
On 2018-06-23 08:41:38 -0400, Richard Damon wrote: > On 6/23/18 8:28 AM, Peter J. Holzer wrote: > > On 2018-06-23 08:12:52 -0400, Richard Damon wrote: > >> On 6/23/18 7:46 AM, Steven D'Aprano wrote: > >>> If I'm in Australia, using the en-AU locale, neverth

Re: translating foreign data

2018-06-23 Thread Peter J. Holzer
On 2018-06-23 16:05:49 +0200, Peter J. Holzer wrote: > I don't think that's a useful way to look at it. "Locale" in > (non-technical) English means "place" or "site". The idea behind the > locale concept is that some conventions (e.g. how to write

Re: translating foreign data

2018-06-23 Thread Peter J. Holzer
On 2018-06-23 12:11:34 -0400, Richard Damon wrote: > On 6/23/18 10:05 AM, Peter J. Holzer wrote: > > On 2018-06-23 08:41:38 -0400, Richard Damon wrote: > >> Once you open the Locale can of worms, EVERYTHING has a locale, to say > >> you aren't using a

Re: translating foreign data

2018-06-23 Thread Peter J. Holzer
basically just defining the right locale. Nope. The right rules for almost any file format are much more than the locale. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h.

Re: translating foreign data

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --drblskvcly73v23o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-23 08:12:52 -0400, Richard Damon wrote: > On 6/23/18 7:46 AM, Steven D'Aprano wrote: > > On Sat, 23

Re: ironpython not support py3.6

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --prnws536gtytpj5v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-22 17:20:29 -0700, denis.akhiya...@gmail.com wrote: > Either wait for IronPython 3.6, use COM inter

Re: translating foreign data

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --jbhqoow7s7225t6e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-23 16:05:49 +0200, Peter J. Holzer wrote: > I don't think that's a useful way to look at it. "

Re: translating foreign data

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --p4u6dkqn7e5fhtwt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-23 08:41:38 -0400, Richard Damon wrote: > On 6/23/18 8:28 AM, Peter J. Holzer wrote: > > On 2018-0

Re: translating foreign data

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --ngg56dmsr6vcxzs5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-23 12:41:33 -0400, Richard Damon wrote: > On 6/23/18 11:44 AM, Steven D'Aprano wrote: > > You'r

Re: translating foreign data

2018-06-24 Thread Peter J. Holzer
From: "Peter J. Holzer" --b2wbudmypdkmv7il Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-23 12:11:34 -0400, Richard Damon wrote: > On 6/23/18 10:05 AM, Peter J. Holzer wrote: > > On 2018-0

Re: ironpython not support py3.6

2018-06-26 Thread Peter J. Holzer
From: "Peter J. Holzer" From: "Peter J. Holzer" --prnws536gtytpj5v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-06-22 17:20:29 -0700, denis.akhiya...@gmail.com wrote: > Either wait for

Re: syntax difference

2018-06-27 Thread Peter J. Holzer
ture which has been implemented in several languages. I haven't checked whether there are packages on pypi. Shouldn't be too hard to implement if one needs it. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-30 Thread Peter J. Holzer
ons are guarantueed to have expired. In practice this scenario is pretty unlikely: Not only has the client have to get the same client port, it also needs to get the sequence numbers (which are 32 bit numbers chosen at random at connection time) just right. OTOH, having to

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-30 Thread Peter J. Holzer
On 2018-06-30 14:01:56 -0700, Dan Stromberg wrote: > On Sat, Jun 30, 2018 at 11:19 AM, Peter J. Holzer wrote: > > On 2018-06-28 18:04:16 -0700, Dan Stromberg wrote: > > > If someone else comes along soon after and starts a dif

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-01 Thread Peter J. Holzer
On 2018-07-01 01:52:12 +, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 23:49:41 +0200, Peter J. Holzer wrote: > > The old adage that "security is binary" is utter balderdash. > > I think that "old adage" is one of those ones that only people denying

Re: error in os.chdir

2018-07-01 Thread Peter J. Holzer
ot; + filename, which will ensure that the correct separator is used). I think the lazy approach using just forward slashes works because *Windows* treats slashes in filenames like backslashes (most of the time), not because Python converts them. hp -- _ | Peter J. Holzer| we

Re: PEP 526 - var annotations and the spirit of python

2018-07-16 Thread Peter J. Holzer
rn on a few additional ones). I remember a time when many compilers had "warning levels". That was really annoying, because level n always was missing a few warnings I found very useful while level n + 1 was burying me in a deluge of useless warnings. hp -- _ | Peter J. Holzer| we build

Re: Cookies not showing up in environ

2018-07-20 Thread Peter J. Holzer
): > if not 'HTTP_COOKIE' in environ: The first argument to a Django view function is the request object, not anything one could plausibly name "environ". See the django docs on how to access the fields of a request. hp -- _ | Peter J. Holzer| we build m

Re: Getting installed version

2018-07-21 Thread Peter J. Holzer
t psycopg2 >>> psycopg2.__version__ '2.5.4 (dt dec pq3 ext)' >>> import numpy >>> numpy.__version__ '1.8.2' But there are exceptions: >>> import xlrd >>> xlrd.__VERSION__ '0.9.2' or even: >&g

Re: [OT] Bit twiddling homework

2018-07-21 Thread Peter J. Holzer
On 2018-07-20 19:13:44 +1000, Chris Angelico wrote: > On Fri, Jul 20, 2018 at 7:00 PM, Brian Oney via Python-list > wrote: > > That's right I had forgotten about that. Thank you for the quick > > answer.Some fun:$ ipythonPython 2.7.13 (default, Nov 24 2017, 17:33:09) &

Re: coding style - where to declare variables

2018-07-22 Thread Peter J. Holzer
s good practice. C++ introduced the possibility to declare variables at any point in a block, not just the beginning. C copied this in C99. Again I would argue that Stroustrup introduced the feature because he considered declaring variables for the smallest possible scope as good practice, an

Re: Good reason not to obfuscate URLs (was: Fishing from PyPI ?)

2018-08-14 Thread Peter J. Holzer
spammers. I hate to defend Outlook (which I think is a really bad MUA), but it gets this one right: Properly configured[1] it does NOT load inline images from web-pages, so you can't be tracked simply by opening a mail. hp [1] Not sure whether this is the default or whether our admins

Re: fsxNet Usenet gateway problem again

2018-09-08 Thread Peter J. Holzer
t; at the end instead of the username to prevent people from (ab)using the path as a mail address. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tool

Re: How to change '\\' to '\'

2018-10-01 Thread Peter J. Holzer
hp [1] And even there not always, as I've learned from the resident Windows expert on this list. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | managem

Re: Python indentation (correct behaviour) (was: Python indentation (3 spaces))

2018-10-08 Thread Peter J. Holzer
indent-guides>. Nice. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/&g

Re: Python indentation (3 spaces)

2018-10-08 Thread Peter J. Holzer
r 57 pixels or whatever. In practice it doesn't work in my experience. There is always someone in a team who was "just testing that new editor" and replaced all tabs with spaces (or vice versa) or - worse - just some of them. It is safer to disallow tabs completely and mandate a cert

Re: Observations on the List - "Be More Kind"

2018-10-09 Thread Peter J. Holzer
planation (at the time). This makes it a bit hard to know what is and is not acceptable on this list. [explanations snipped] hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | |

Re: ESR "Waning of Python" post

2018-10-12 Thread Peter J. Holzer
types in your Go programs. Go isn't object-oriented, but that doesn't make its type system useless (I've certainly created lots of useful data types in C). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because w

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-12 Thread Peter J. Holzer
to do anything you can't do with normal file I/O. It's just sometimes more convenient and/or performant. > -- and even if you manage to do that, > you'd have to write back anything after the changed line if the length > of that line changed by as little as a byte. This is co

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-12 Thread Peter J. Holzer
t;. > Xerox CP-V offered "consecutive", "keyed", and "random" file > organizations. I don't know if there was a C implementation for CP-V, but there is certainly nothing in the C standard which would prevent a standard conforming imp

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-12 Thread Peter J. Holzer
On 2018-10-12 22:28:44 -0400, Dennis Lee Bieber wrote: > On Fri, 12 Oct 2018 21:00:45 +0200, "Peter J. Holzer" > declaimed the following: > >I don't know if there was a C implementation for CP-V, but there is > >certainly nothing in the C standard which would

Re: ESR "Waning of Python" post

2018-10-13 Thread Peter J. Holzer
ch can run mostly without locks. But this is of course a lot of work with no guarantee of success. (JPython and IronPython did something similar, although they didn't design new VMs, but reused VMs designed for other languages). hp -- _ | Peter J. Holzer| we build much bi

Re: Python indentation (3 spaces)

2018-10-13 Thread Peter J. Holzer
On 2018-10-08 20:13:38 +, Grant Edwards wrote: > On 2018-10-08, Peter J. Holzer wrote: > > Theoretically I would agree with you: Just use a single tab per > > indentation level and let the user decide whether that's displayed > > as 2, 3, 4, or 8 spaces or 57 pixe

Re: Python indentation (3 spaces)

2018-10-13 Thread Peter J. Holzer
On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > On 08-10-18 19:43, Peter J. Holzer wrote: > > On 2018-10-08 10:36:21 +1100, Chris Angelico wrote: > >> How wide my indents are on my screen shouldn't influence your screen > >> or your choices. > > Theoreti

Re: Is this mailbox manipulation working by luck, or can't I understand my own code?

2018-10-13 Thread Peter J. Holzer
the get method: https://docs.python.org/3/library/email.compat32-message.html#email.message.Message.get hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | man

Re: Python indentation (3 spaces)

2018-10-14 Thread Peter J. Holzer
On 2018-10-14 00:45:49 +, Grant Edwards wrote: > On 2018-10-13, Peter J. Holzer wrote: > > > >> For "just use tabs" to work, all of those tools would have to > >> magically recognize that they're looking at Python source and adjust > >> th

Re: Python indentation (3 spaces)

2018-10-14 Thread Peter J. Holzer
ad to stop that in Django projects because it messes up the stack traces. > Not sure what you mean by US, RS, and GS, Unit separator, record separator, group separator (and FS is file separator). I think they were intended for a CSV-like file format, but I have never seen them in use (

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 09:49:12 +1100, Cameron Simpson wrote: > On 15Oct2018 00:33, Peter J. Holzer wrote: > > On 2018-10-15 09:06:11 +1100, Chris Angelico wrote: > > > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > > > Chris Angelico : > > > > > Ta

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 12:06:06 +0100, Rhodri James wrote: > On 14/10/18 09:06, Peter J. Holzer wrote: > > If everybody used tabs, why would anyone care about your tab width? > > Unless they look over your shoulder while you are typing, they won't > > even know how wide your tabs

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > On 13-10-18 09:37, Peter J. Holzer wrote: > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > >> On 08-10-18 19:43, Peter J. Holzer wrote: > >>> In practice it doesn't work in my experience. There is alw

Re: Python indentation (3 spaces)

2018-10-20 Thread Peter J. Holzer
On 2018-10-16 06:37:56 +1100, Chris Angelico wrote: > On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: > > On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > > > On 13-10-18 09:37, Peter J. Holzer wrote: > > > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wro

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-20 Thread Peter J. Holzer
s the right fix or previous or > both wrong?? 0xB0 isn't a valid ASCII character, so you'll get a decoding error for open(..., encoding="ascii"), too. You will have to find out the correct encoding for your file and use that. hp -- _ | Peter J. Ho

Re: Python indentation (3 spaces)

2018-11-11 Thread Peter J. Holzer
On 2018-10-25 12:59:18 +0200, Antoon Pardon wrote: > On 20-10-18 14:38, Peter J. Holzer wrote: > > On 2018-10-16 06:37:56 +1100, Chris Angelico wrote: > >> On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: > >>> On 2018-10-15 14:12:54 +0200, Antoon Pardon w

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
On 2018-12-27 14:17:34 +0100, Peter J. Holzer wrote: > On 2018-12-17 21:57:22 +1100, Paul Baker wrote: > > class C: > > def __init__(self): > > self.__dict__['a'] = 1 > > > > @property > > def a(s

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
__(self): ... self.__dict__['a'] = 1 ... @property ... def a(self): ... return 2 ... >>> o = C() >>> o.a 1 hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because

Re: the python name

2019-01-04 Thread Peter J. Holzer
orks the same when I'm ssh'd into a server as when I work locally) and not having to replicate the environment is a plus for me. If my tools worked only locally, I could do all development locally. > as of yet the develop option doesn't seem to work how i > would expect. What is &

Re: the python name

2019-01-04 Thread Peter J. Holzer
ve any of these > enhanced objects back when created, or even now? Certainly not then. Probably not now. Fortran isn't about symbolic manipulation. It's about number crunching. And in the beginning it was mostly about not having to write assembler. hp -- _ | Pete

Re: the python name

2019-01-06 Thread Peter J. Holzer
On 2019-01-04 12:56:56 -0500, songbird wrote: > Peter J. Holzer wrote: > > Almost all of these points don't seem to be related to the language, but > > to your environment. > > an application isn't useful unless it actually can > be deployed and used in an en

Re: the python name

2019-01-06 Thread Peter J. Holzer
can be parallelized while the C compiler can't be sure. (Both languages have constructs (some native, some as extensions) to specify that explicitely, but the programmer has to use them (and use them correctly)) hp -- _ | Peter J. Holzer| we build much bigger, better d

Python packaging (was: the python name)

2019-01-06 Thread Peter J. Holzer
On 2019-01-06 13:26:15 +0100, Peter J. Holzer wrote: > I haven't packaged anything yet. I have looked at the documentation > several times and I agree that it looks somewhat daunting (I am not > unfamiliar with packaging systems: I have built rpm and deb packages, > and used bot

Re: the python name

2019-01-06 Thread Peter J. Holzer
On 2019-01-06 13:43:02 -0500, Dennis Lee Bieber wrote: > On Sun, 6 Jan 2019 13:26:15 +0100, "Peter J. Holzer" > declaimed the following: > > >For example, about 10 years ago I built a continuous integration > >pipeline for a project I was working on [...] > &g

Compilation (was: the python name)

2019-01-06 Thread Peter J. Holzer
, as the authors think that programmers are more likely to look at the output of the tool they have to use than to invoke a separate, optional tool. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more

Re: Im trying to replicate the youtube video Creating my own customized celebrities with AI.

2019-02-11 Thread Peter J. Holzer
sor. Tension, apprehension, And dissention have begun. SCNR, hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.a

Re: The slash "/" as used in the documentation

2019-02-12 Thread Peter J. Holzer
On 2019-02-12 07:31:54 +1100, Chris Angelico wrote: > Positional arguments with defaults is a concept known in MANY > languages, True. > including C. Nope. At least not until C99, and I can't find anything in C11 either. Maybe they'll add it in C2x. hp -- _

Re: Quirk difference between classes and functions

2019-02-27 Thread Peter J. Holzer
al variables and arrange for it to be executed before any other code in the function. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools.

Re: Block Ctrl+S while running Python script at Windows console?

2019-03-19 Thread Peter J. Holzer
does a lot more than just control flow control, so it may not be appropriate for the OP's problem. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools

Re: Might be doing this wrong? (Turtle graphics)

2019-03-22 Thread Peter J. Holzer
he beginning of lines (the "indentation"). This can be a problem when you copy and paste fragments of code. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.a

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Peter J. Holzer
{"french": "ann\xe9e"})) UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 11: ordinal not in range(128) This was fixed(?) in Python 3.7. hp -- _ | Peter J. Holzer| we build much bigger, better disaster

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
don't remember the names and I'm not sure if the generators got beyond the proof of concept stage. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 16:34:35 +, Paul Moore wrote: > On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote: > > > Obviously you need some way to describe the specific binary format you > > want to parse - in other words, a grammar. The library could then use > > the gr

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Peter J. Holzer
ersion (or range of versions). Normally getting the newest version is fine. Finally, here is my venv function: venv() { for d in venv/"$1" ve/"$1" ~/venv/"$1" "$1" do if [ -f "$d"/bin/activate ] then . "$d&quo

Re: Generating generations of files

2019-04-29 Thread Peter J. Holzer
with open11("foo", "w") as f: f.write("test2") with open11("foo", "w") as f: f.write("test3") :-) (WARNING: I haven't really tested this) hp PS: I like Chris' suggestion to just use git. But it

EmailMessage and RFC 2047

2019-04-30 Thread Peter J. Holzer
'[luga] =?utf-8?Q?=C3=84ndern_des_Passwortes_mittels_We?=\n\t=?utf-8?Q?bformular?=' >>> m["From"] 'Martin =?iso-8859-15?Q?W=FCrtele?= ' >>> Am I using it wrong or did I misunderstand what is meant by "handled transp

Re: Dynamic selection for network service ports?

2019-04-30 Thread Peter J. Holzer
server which allows updates (if you use AD, you already have one, if you use bind, it's not too hard). Container orchestration systems like Kubernetes also include such registration services. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: EmailMessage and RFC 2047

2019-04-30 Thread Peter J. Holzer
On 2019-04-30 17:45:52 +0200, Thomas Jollans wrote: > On 30/04/2019 13.11, Peter J. Holzer wrote: > > https://docs.python.org/3.7/library/email.header.html states: > > > > | This module is part of the legacy (Compat32) email API. In the current > > | API encoding

Re: Django Potential Fork Bomb

2019-05-10 Thread Peter J. Holzer
call the django.contrib.admin app "the Django GUI", but that doesn't seem to fit your description that it executes code in *your* app. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated

Re: Help? How do i solve this problem with Python List Concept

2019-05-14 Thread Peter J. Holzer
e youngest children, we get nice round numbers: The youngest child is 5, the oldest 32, and the divisor is 1250. So the youngest inherits 6250 NGN, the oldest 4 NGN, and the rest are trivial to compute. You owe the Oracle a first print of "Rechnung auff der Linihen und Federn" and th

Re: Import module from a different subdirectory

2019-05-18 Thread Peter J. Holzer
s' >>> This doesn't work, since there is no classes/model.py in "", only in "..". But if I add a PYTHONPATH, it works again: hrunkner:~/tmp/bustrac/scripts 18:15 :-) 1151% export PYTHONPATH=~/tmp/bustrac hrun

Re: Import module from a different subdirectory

2019-05-18 Thread Peter J. Holzer
your directory named "business-tracker" (see above). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ |

Re: Import module from a different subdirectory

2019-05-19 Thread Peter J. Holzer
y while waiting for the coffee machine to boot - too much time to form weird associations. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. _

Trouble Downloading Python and Numpy

2019-05-29 Thread Contreras, Brian J
Good Morning, I am a research student at the Georgia Institute of Technology. I have made multiple attempts to download different versions of Python with Numpy on my Microsoft Surface Book with no success. I ensured that I have space for the program and the latest windows 10 update, I still am

Re: Checking refusal of a network connection

2019-06-01 Thread Peter J. Holzer
:1 and 127.0.0.1 are distinct addresses. If you want to accept connections on both, you have to listen on both (or on ::, which does accept connections on all IP addresees - IPv6 and IPv4). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: PEP 594 cgi & cgitb removal

2019-06-01 Thread Peter J. Holzer
close to 10 requests to dynamic content per second. Much less 10 requests per second per core. I don't use CGI very much these days (and when I do, I use Perl - old habits die hard), but performance isn't the reason. hp -- _ | Peter J. Holzer| we build muc

Re: Handling an connection error with Twython

2019-06-01 Thread Peter J. Holzer
an exception) > time.sleep(60) > raise RuntimeError('Should not get here') ^^^^^ So if you can't get a status update you will reach this point. hp -- _ | Peter J. Holzer| we build much

Re: Checking refusal of a network connection

2019-06-01 Thread Peter J. Holzer
need to bind to two addresses. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www

Re: Checking refusal of a network connection

2019-06-01 Thread Peter J. Holzer
ure about this conclusion. Well, we don't study theology here. We don't have to theorize (no pun intended), we can experiment. Why don't you just try it out? > Under which circumstances will the Python programming interfaces > support the direct usage of the identification

Re: Checking refusal of a network connection

2019-06-04 Thread Peter J. Holzer
on since I'm not sure what your question is) > If my software test client would pass the IPv6 address family for a > connection, both processes would use the same network protocol > version. Yes. hp -- _ | Peter J. Holzer| we build much bigger, better disasters n

Re: FDs will be closed after exception automatically in python2.7?

2019-06-10 Thread Peter J. Holzer
d (in the case of a with block immediately, otherwise when the garbage collector gets around to it). hp [1] Don't know if those exist in Python 2.x. You should upgrade to 3.x anyway. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: Why Python has no equivalent of JDBC of Java?

2019-06-16 Thread Peter J. Holzer
of python db drivers uses Cython, > Python C API or external C libraries. Which I would take as an indication that Python is "further from the metal". Python isn't really suited for the job so you have to switch to a lower-level (closer to the metal) language to implement it. &g

Re: Multiprocessing and memory management

2019-07-03 Thread Peter J. Holzer
ocess terminates or maybe only until you get a better estimate). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp

Re: Handle foreign character web input

2019-07-04 Thread Peter J. Holzer
en (or even printed) Chinese name on any keyboard (I managed to do that recently, but that was a lot of work and way into "a fun challenge to do once, not something I want to repeat" territory). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: OT: Is there a name for this transformation?

2019-07-10 Thread Peter J. Holzer
each row (e.g. order of appearance, or a count), so you'll use a second dict for that. For output you get a list of columns in the right order and then iterate over the 1st level keys of your dict and the list of columns to access each cell. hp -- _ | Peter J. Holzer| we bui

Re: How to execute shell command in Python program?

2019-07-20 Thread Peter J. Holzer
cks. In this case you should set shell=False. Either invoke the command directly with an argument vector (almost always preferrable), or invoke the shell with a shell command. Don't mix them. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: Proper shebang for python3

2019-07-20 Thread Peter J. Holzer
e differently because of a different path, #!/usr/bin/env is a total no-no. There is a nice way to achieve this: Just use the interpreter of the virtual environment in the shebang. (That requires rewriting the shebang during installation, but that's a minor inconvenience) hp -- _ | Pet

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
On 2019-07-20 15:26:46 -0500, Tim Daneliuk wrote: > On 7/20/19 2:56 PM, Peter J. Holzer wrote: > > On 2019-07-20 14:11:44 -0500, Tim Daneliuk wrote: > >> So, no, do NOT encode the hard location - ever. Always use env to > >> discover the one that the user has specif

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
er > your control. Control it. > > For your specific example, "man youtube-dl" _is_ affected by the > environment. It honours the $MANPATH variable. MANPATH is explicitely intended to control man. But man doesn't fail if you set your PATH to something weird. It will

Re: Namespaces: memory vs 'pollution'

2019-07-21 Thread Peter J. Holzer
ugh the problem is in general not solvable, most uses of symbols fall into a few common categories which can be discovered by static analysis. So an IDE (or even a syntax-highlighting editor) could flag all symbols where it can't find the definition. hp -- _ | Peter J. Holzer

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
On 2019-07-21 10:26:17 -0500, Tim Daneliuk wrote: > On 7/21/19 8:47 AM, Peter J. Holzer wrote: > > That's fine. Unlike Tim I don't claim that anybody who disagrees with me > > must be a newbie. > > Peter, that's ad hominem and unfair. No, it isn't.

Re: Counting Python threads vs C/C++ threads

2019-07-21 Thread Peter J. Holzer
se more then 100 % because of the GIL and 100 / 32 = 3.125). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ros

Re: help with tkinter

2019-08-09 Thread Peter J. Holzer
.colorchooser.askcolor()) > the only time it worked is when I typed > from tkinter import colorchooser > colorchooser.askcolor() Here you imported 'colorchooser' from tkinter. So you can call colorchooser.askcolor(). Same as above, except that you have only imported colorchoos

Re: help with tkinter

2019-08-09 Thread Peter J. Holzer
On 2019-08-09 12:43:45 -0600, Michael Torrie wrote: > On 8/9/19 4:52 AM, Peter J. Holzer wrote: > > You didn't import 'tkinter', you imported all symbols ('*') from > > tkinter. So, since you imported colorchooser, you can call > > colorchooser

Re: String slices

2019-08-10 Thread Peter J. Holzer
nce Python 3.6) this: outstream.write(f"X: {thing[0]:7.2f}\n") There are of course many variants to all three methods. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more soph

Re: issue in handling CSV data

2019-09-08 Thread Peter J. Holzer
" 17 "address," "length," "6a," 6c ... Note that the commas are within the quotes. I'd say Andrea is correct: This is a tab-separated file, not a comma-separated file. But for some reason all fields except the last end with a comma. I would

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-15 Thread Peter J. Holzer
than ex-ante mitiga-tion. | (Alternatively, they can more easily translate the costs associated | with ex-post responses into manageable claims.) hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophistic

Re: keying by identity in dict and set

2019-10-28 Thread Peter J. Holzer
aybe yourself in two years). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/

Re: fileinput

2019-10-28 Thread Peter J. Holzer
able. If is supposed to be something else, determine what that "something else" actually is, and use that. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp

<    5   6   7   8   9   10   11   12   13   14   >