On 24/01/2013 20:01, Oscar Benjamin wrote:
On 24 January 2013 17:13, Tim Golden wrote:
A package-based module run via -m (python -m package.module) works
as described (including the implicit __main__ module, my
primary use-case).
Does it work in the "python -m package.module" case? It looks t
On 24 January 2013 17:13, Tim Golden wrote:
> On 24/01/2013 16:53, Oscar Benjamin wrote:
>>> Does it work if you use the -m option to run a module rather than a script?
>>
>> Sorry that was written incorrectly. I meant to say: does it work when
>> a module is directly on sys.path rather than as a
On 24/01/2013 16:53, Oscar Benjamin wrote:
>> Does it work if you use the -m option to run a module rather than a script?
>
> Sorry that was written incorrectly. I meant to say: does it work when
> a module is directly on sys.path rather than as a submodule of a
> package? In this case __package__
On 24 January 2013 16:08, Oscar Benjamin wrote:
> On 24 January 2013 15:51, Tim Golden wrote:
>> On 24/01/2013 15:28, Oscar Benjamin wrote:
>>> On 24 January 2013 13:45, Tim Golden wrote:
On 24/01/2013 11:30, Oscar Benjamin wrote:
> I don't really understand what your spec is. Why do yo
On 24 January 2013 15:51, Tim Golden wrote:
> On 24/01/2013 15:28, Oscar Benjamin wrote:
>> On 24 January 2013 13:45, Tim Golden wrote:
>>> On 24/01/2013 11:30, Oscar Benjamin wrote:
I don't really understand what your spec is. Why do you need to
inspect this information from sys.argv?
On 24/01/2013 15:28, Oscar Benjamin wrote:
> On 24 January 2013 13:45, Tim Golden wrote:
>> On 24/01/2013 11:30, Oscar Benjamin wrote:
>>> I don't really understand what your spec is. Why do you need to
>>> inspect this information from sys.argv? Can you not just always use
>>> 'python -m pkg' as
On 24 January 2013 13:45, Tim Golden wrote:
> On 24/01/2013 11:30, Oscar Benjamin wrote:
>> I don't really understand what your spec is. Why do you need to
>> inspect this information from sys.argv? Can you not just always use
>> 'python -m pkg' as your entry point?
>
[SNIP]
>
> For completeness,
On 24/01/2013 11:30, Oscar Benjamin wrote:
> I don't really understand what your spec is. Why do you need to
> inspect this information from sys.argv? Can you not just always use
> 'python -m pkg' as your entry point?
Sorry about the confusion. I think my original point was simply one
of surprise
On 24 January 2013 10:56, Tim Golden wrote:
> On 24/01/2013 10:06, Oscar Benjamin wrote:
>> On 24 January 2013 04:49, Steven D'Aprano
>> wrote:
>> [SNIP]
>>>
>>> Contrariwise, I don't believe that there is currently *any* way to
>>> distinguish between running a script with or without -m. That sh
On 24/01/2013 10:56, Tim Golden wrote:
> if the package which is reconstructing the command line the package
> which was the target of the original command line.
Sorry:
if the package which is reconstructing the command line *is not*
the package which was the target of the original command l
On 24/01/2013 10:06, Oscar Benjamin wrote:
> On 24 January 2013 04:49, Steven D'Aprano
> wrote:
> [SNIP]
>>
>> Contrariwise, I don't believe that there is currently *any* way to
>> distinguish between running a script with or without -m. That should be
>> fixed.
>
> As I said earlier in the threa
On 24 January 2013 04:49, Steven D'Aprano
wrote:
[SNIP]
>
> Contrariwise, I don't believe that there is currently *any* way to
> distinguish between running a script with or without -m. That should be
> fixed.
As I said earlier in the thread, the __package__ module global
distinguishes the two ca
On Thu, Jan 24, 2013 at 3:49 PM, Steven D'Aprano
wrote:
> Note however that there is an ambiguity between calling "python -mspam"
> and calling a script literally named "-mspam". But that same ambiguity
> exists in the shell, so I don't consider it a problem. You cannot call a
> script named -mspa
On Wed, 23 Jan 2013 10:01:24 +, Oscar Benjamin wrote:
> On 23 January 2013 03:58, Steven D'Aprano
> wrote:
>> On Wed, 23 Jan 2013 00:53:21 +, Oscar Benjamin wrote:
>>
>>> On 22 January 2013 23:46, Steven D'Aprano
>>> wrote: [SNIP]
>>> The purpose of the -m option is that you can run
On 23 January 2013 03:58, Steven D'Aprano
wrote:
> On Wed, 23 Jan 2013 00:53:21 +, Oscar Benjamin wrote:
>
>> On 22 January 2013 23:46, Steven D'Aprano
>> wrote: [SNIP]
>>>
>> The purpose of the -m option is that you can run a script that is
>> located via the Python import path instead of an
On 23/01/2013 03:58, Steven D'Aprano wrote:
> Currently, if I have a package __main__.py that prints sys.argv, I get
> results like this:
>
> steve@runes:~$ python3.3 /home/steve/python/testpackage/__main__.py ham
> spam eggs
> ['/home/steve/python/testpackage/__main__.py', 'ham', 'spam', 'eggs'
On Wed, 23 Jan 2013 00:53:21 +, Oscar Benjamin wrote:
> On 22 January 2013 23:46, Steven D'Aprano
> wrote: [SNIP]
>>
>> I am a bit disturbed that you cannot distinguish between:
>>
>> python C:\something\on\pythonpath\app\__main__.py
>>
>> python -m app
>>
>>
>> by inspecting the command line
On 22 January 2013 09:24, Tim Golden wrote:
> [Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific,
> though].
>
> I use the python -mpackage incantation to run a package which has a
> __main__.py module and which uses relative imports internally.
>
> I'm developing under cherrypy
On 22 January 2013 23:46, Steven D'Aprano
wrote:
[SNIP]
>
> I am a bit disturbed that you cannot distinguish between:
>
> python C:\something\on\pythonpath\app\__main__.py
>
> python -m app
>
>
> by inspecting the command line. I consider it a bug, or at least a
> misfeature, if Python transforms
On Tue, 22 Jan 2013 15:07:18 +, Tim Golden wrote:
> On 22/01/2013 14:53, Terry Reedy wrote:
>> On 1/22/2013 4:24 AM, Tim Golden wrote:
>>> [Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific,
>>> though].
>>>
>>> I use the python -mpackage incantation to run a package which h
On 22/01/2013 14:53, Terry Reedy wrote:
> On 1/22/2013 4:24 AM, Tim Golden wrote:
>> [Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific,
>> though].
>>
>> I use the python -mpackage incantation to run a package which has a
>> __main__.py module and which uses relative imports int
On 1/22/2013 4:24 AM, Tim Golden wrote:
[Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific,
though].
I use the python -mpackage incantation to run a package which has a
__main__.py module and which uses relative imports internally.
I'm developing under cherrypy which includes
[Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific,
though].
I use the python -mpackage incantation to run a package which has a
__main__.py module and which uses relative imports internally.
I'm developing under cherrypy which includes a reloader for development.
The reloader
23 matches
Mail list logo