Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Remember, there's a big difference between kneeling down and bending over. -- Frank Zappa


devel / comp.lang.python / Re: Getting Directory of Command Line Entry Point For Packages

SubjectAuthor
o Re: Getting Directory of Command Line Entry Point For PackagesDavid L Neil

1
Re: Getting Directory of Command Line Entry Point For Packages

<mailman.3.1636754598.15285.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20377&group=comp.lang.python#20377

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: DomainAdmin@DancesWithMice.info (David L Neil)
Newsgroups: comp.lang.python
Subject: Re: Getting Directory of Command Line Entry Point For Packages
Date: Sat, 13 Nov 2021 11:02:55 +1300
Lines: 25
Message-ID: <mailman.3.1636754598.15285.python-list@python.org>
References: <CADrxXXkzOTpoW5BbVZFJUSwbHnVnb2rn=EAr=D-=SpjT=WPZ_Q@mail.gmail.com>
<42eaf0dd-409d-fe8d-3ee4-1e80ca225f0a@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de DDlOd8yRXy1ofbWFyIDycApgYAz5/t/Po0ybtnxpE4+w==
Return-Path: <DomainAdmin@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=dHhT5t9o; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.018
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '=dn': 0.09;
'from:addr:danceswithmice.info': 0.09; 'prints': 0.09; 'analogy':
0.16; 'janhangeer': 0.16; 'message-id:@DancesWithMice.info': 0.16;
'print(': 0.16; 'received:51.254': 0.16; 'received:51.254.211':
0.16; 'received:51.254.211.219': 0.16; 'received:cloud': 0.16;
'received:rangi.cloud': 0.16; 'wrote:': 0.16; 'to:addr:python-
list': 0.20; 'command': 0.23; 'lines': 0.23; 'list,': 0.24;
'header:User-Agent:1': 0.30; 'path': 0.33; 'package': 0.34;
'header:In-Reply-To:1': 0.34; 'files': 0.36; 'directory': 0.37;
'received:192.168': 0.37; 'received:51': 0.64; 'well': 0.65;
'named': 0.65; 'received:userid': 0.66; 'subject:For': 0.69;
'above,': 0.70; 'folders': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-6.4 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 8CF7C5EB0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1636754589;
bh=BZd27ZwcWwvXISUh5Buf0ybBpr8+hSLTJX9lewJZJOU=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=dHhT5t9o41jSFzmzp0K+sIGL+MNkoO0YmC7JeWVQfpIgtbuWQbPbMZy7k6Wh6vY3v
PpogCbP2Yk+wHiIQa5ijtBwGdCJh619k9NyTyOvzAwLJgCNLT93w8diekuEvZ6t/AP
ycEc014Pta2/hc8pkQXA9Tge53J65WFn7XKcHWmLzGNaT+me3ixK1ikHw0N69MpaYc
Ptw8RbF3O7yon9sKeli8QVznLmsqXe7lEy3xFJWA51AeabmniFrMjI4ka5zMKsQN2S
Mzb8XYKez7tm1O9w3TGYoEu+9vLDYi/PAHHibimOHWnmFooJQglV8Q+opXN0XXgJG1
bdmKOYnOcethQ==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.3.0
Content-Language: en-GB
In-Reply-To: <CADrxXXkzOTpoW5BbVZFJUSwbHnVnb2rn=EAr=D-=SpjT=WPZ_Q@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.36
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <42eaf0dd-409d-fe8d-3ee4-1e80ca225f0a@DancesWithMice.info>
X-Mailman-Original-References: <CADrxXXkzOTpoW5BbVZFJUSwbHnVnb2rn=EAr=D-=SpjT=WPZ_Q@mail.gmail.com>
 by: David L Neil - Fri, 12 Nov 2021 22:02 UTC

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 in
> site-packages
>
> This is an analogy for a package i have.
>
> Well forgetting about the lines above, how do i get the path from
> which miaw the command is called from?

try:

file_path = __file__
print( file_path )

and process file_path as-required.
--
Regards =dn


devel / comp.lang.python / Re: Getting Directory of Command Line Entry Point For Packages

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor