Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Greg Ewing
On 13/11/21 7:23 pm, Abdur-Rahmaan Janhangeer wrote: os.getcwd is giving the path of site-packages and not the directory from which the command is run from. Something must be changing the working directory before getcwd is called. Once that happens there's no way I know of to find out what it

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Abdur-Rahmaan Janhangeer
Greetings, This is what I am trying to do: How to get the getcwd of the directory of where the command is run and not that of the file where the cli entrypoint is found. Having the user enter the absolute path as a cli argument does not sound nice. Kind Regards, Abdur-Rahmaan Janhangeer about

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Barry
> On 13 Nov 2021, at 06:26, Abdur-Rahmaan Janhangeer > wrote: > > Only thing is that os.getcwd is giving the path of site-packages and not > the directory from > which the command is run from. In which case the code is doing a os.chdir() before the call to os.getwd(). You need to call

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Abdur-Rahmaan Janhangeer
Greetings, Well since sometimes i have this: https://github.com/shopyo/shopyo Old versions worked as we are using it for FlaskCon , even newer versions until sometimes ago. shopyo has a copy of the project which is a flask app in site-packages. upon using

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Greg Ewing
On 13/11/21 10:51 am, Abdur-Rahmaan Janhangeer wrote: ow do i get the path from which miaw the command is called from? What exactly do you mean by "called from"? If you want the user's working directory, os.getcwd() will give you that. If you want something else, you'll have to give us more

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread dn via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread David L Neil via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders