Re: [Tutor] What is the best way for a program suite to know where it is installed?

2018-10-23 Thread Peter Otten
eryk sun wrote: > On 10/22/18, boB Stepp wrote: >> >> Importing the various program modules/module contents is >> no issue. Where I believe I need to know the paths to things are to >> get to data folders, config files, and occasionally utility programs >> that I have written that are on my hard

Re: [Tutor] Can tempfile.NamedTemporaryFile(delete=False) be used to create *permanent* uniquely named files?

2018-10-23 Thread Cameron Simpson
On 23Oct2018 11:24, Peter Otten <__pete...@web.de> wrote: Cameron Simpson wrote: The doco for mktemp (do not use! use mkstemp or the NamedTemporaryFile classes instead!) explicitly mentions using delete=False. Well, "permanent temporary file" does sound odd. By the way, NamedTemporaryFile re

Re: [Tutor] Can tempfile.NamedTemporaryFile(delete=False) be used to create *permanent* uniquely named files?

2018-10-23 Thread Peter Otten
Cameron Simpson wrote: > On 21Oct2018 10:55, Peter Otten <__pete...@web.de> wrote: >>boB Stepp wrote: >>> So I am now wondering if using >>> tempfile.NamedTemporaryFile(delete=False) would solve this problem >>> nicely? As I am not very familiar with this library, are there any >>> unforeseen iss

Re: [Tutor] Fwd: Can tempfile.NamedTemporaryFile(delete=False) be used to create *permanent* uniquely named files?

2018-10-23 Thread Avi Gross
Since this topic is not focused on efficiency, why exactly does it matter if your function should check if a file exists and then avoid a collision? What you are describing sounds a bit like a hash function. In many cases, when you perform the computations you may find the slot you hash to is alre