On 12/30/2009 11:25 PM, Roald de Vries wrote:
Actually, performance is not much if an issue for what I want to do;
it's mainly interest in 'how should I do this in general'. I'll just
leave in all the code, and if it becomes a real issue, I'll separate the
code over an interactive and a non-inter
On Wed, 30 Dec 2009 14:42:12 +0100, Vito 'ZeD' De Tullio wrote:
> Steven D'Aprano wrote:
>
>
>>> if I run 'python <<< "import sys; print(sys.ps1)"', I get an error.
>>
>> Of course you do, because you're not running interactively
>
> Excuse me, why do you say that?
Two reasons.
First, becaus
Steven D'Aprano wrote:
>> if I run 'python <<< "import sys; print(sys.ps1)"', I get an error.
>
> Of course you do, because you're not running interactively
Excuse me, why do you say that?
--
By ZeD
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 30, 2009, at 4:10 AM, Steve Holden wrote:
Roald de Vries wrote:
On Dec 30, 2009, at 2:28 AM, Dave Angel wrote:
Roald de Vries wrote:
On Dec 29, 2009, at 8:34 PM, Dave Angel wrote:
Antoine Pitrou wrote:
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
Dear all,
Is it
Le Wed, 30 Dec 2009 03:33:18 +0100, Roald de Vries a écrit :
>
> I'm using a database, and want to use python interactively to manipulate
> it. On the other hand, I also want to be able to use it non-
> interactively. In that case, it would be a waste of CPU to load the
> function/class definition
Steve Holden wrote:
Roald de Vries wrote:
On Dec 30, 2009, at 2:28 AM, Dave Angel wrote:
Roald de Vries wrote:
mehow define a different set of functions???
I'm using a database, and want to use python interactively to manipulate
it. On the other hand, I also want to be
On Wed, 30 Dec 2009 03:33:18 +0100, Roald de Vries wrote:
> I'm using a database, and want to use python interactively to manipulate
> it. On the other hand, I also want to be able to use it non-
> interactively. In that case, it would be a waste of CPU to load the
> function/class definitions mea
On Wed, 30 Dec 2009 03:26:20 +0100, Roald de Vries wrote:
> On Dec 30, 2009, at 1:52 AM, Steven D'Aprano wrote:
>> On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote:
>>
>>> Dear all,
>>>
>>> Is it possible for a Python script to detect whether it is running
>>> interactively? It can be usef
Roald de Vries wrote:
>
> On Dec 30, 2009, at 2:28 AM, Dave Angel wrote:
>
>> Roald de Vries wrote:
>>> On Dec 29, 2009, at 8:34 PM, Dave Angel wrote:
Antoine Pitrou wrote:
> Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
>
>
>> Dear all,
>>
>> Is it pos
On Dec 30, 2009, at 2:28 AM, Dave Angel wrote:
Roald de Vries wrote:
On Dec 29, 2009, at 8:34 PM, Dave Angel wrote:
Antoine Pitrou wrote:
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
Dear all,
Is it possible for a Python script to detect whether it is running
interactivel
On Dec 30, 2009, at 1:52 AM, Steven D'Aprano wrote:
On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote:
Dear all,
Is it possible for a Python script to detect whether it is running
interactively? It can be useful for e.g. defining functions that are
only useful in interactive mode.
Ah,
Roald de Vries wrote:
On Dec 29, 2009, at 8:34 PM, Dave Angel wrote:
Antoine Pitrou wrote:
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
Dear all,
Is it possible for a Python script to detect whether it is running
interactively? It can be useful for e.g. defining functions th
On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote:
> Dear all,
>
> Is it possible for a Python script to detect whether it is running
> interactively? It can be useful for e.g. defining functions that are
> only useful in interactive mode.
Ah, I should have looked more carefully at the do
On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote:
> Dear all,
>
> Is it possible for a Python script to detect whether it is running
> interactively? It can be useful for e.g. defining functions that are
> only useful in interactive mode.
Check __name__. It's set to '__main__' when runni
On Dec 29, 2009, at 8:34 PM, Dave Angel wrote:
Antoine Pitrou wrote:
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
Dear all,
Is it possible for a Python script to detect whether it is running
interactively? It can be useful for e.g. defining functions that are
only useful in i
Antoine Pitrou wrote:
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
Dear all,
Is it possible for a Python script to detect whether it is running
interactively? It can be useful for e.g. defining functions that are
only useful in interactive mode.
Try the isatty() metho
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit :
> Dear all,
>
> Is it possible for a Python script to detect whether it is running
> interactively? It can be useful for e.g. defining functions that are
> only useful in interactive mode.
Try the isatty() method (*) on e.g. stdin:
$
Dear all,
Is it possible for a Python script to detect whether it is running
interactively? It can be useful for e.g. defining functions that are
only useful in interactive mode.
Kind regards, Roald
--
http://mail.python.org/mailman/listinfo/python-list
18 matches
Mail list logo