[Tutor] Graphical/web program

2018-01-12 Thread Pat Martin
Hello, I have recently written a program to add switches and hosts to my ssh config file, I use argparse for some switches like user name and such and it has been working pretty well. I was thinking of turning this into a web app (one that is just run on my local machine) something like have a f

Re: [Tutor] When is and isn't "__file__" set?

2018-01-12 Thread Steven D'Aprano
On Fri, Jan 12, 2018 at 05:22:05PM +, Albert-Jan Roskam wrote: > > On Jan 11, 2018 03:47, Steven D'Aprano wrote: [...] > > Modules which are loaded from a .py or .pyc file on disk should always > > have __file__ set. If they don't, that's a bug in the interpreter. > > > > Modules which are l

Re: [Tutor] When is and isn't "__file__" set?

2018-01-12 Thread eryk sun
On Fri, Jan 12, 2018 at 5:22 PM, Albert-Jan Roskam wrote: > On Jan 11, 2018 03:47, Steven D'Aprano wrote: >> >> Modules which are loaded from a .dll or .so binary file also should have >> __file__ set. > > And .pyd? I would hope so A .pyd is a Windows DLL (i.e. PE/COFF shared library). The .pyd

Re: [Tutor] When is and isn't "__file__" set?

2018-01-12 Thread Albert-Jan Roskam
On Jan 11, 2018 03:47, Steven D'Aprano wrote: > > On Wed, Jan 10, 2018 at 08:02:24PM -0600, boB Stepp wrote: > > > I am still puzzling over things from the thread, "Why does > > os.path.realpath('test_main.py') give different results for unittest > > than for testing statement in interpreter?" T