On Saturday, February 17, 2018 at 8:50:48 AM UTC-6, Steven D'Aprano wrote:
>
> For me, the tool I use is a set of re-usable tools:
>
> - a text editor;
> - a system command prompt in a terminal/console window;
> - a Python REPL for running code snippets and looking up help(obj).
>
> Other
On Fri, 16 Feb 2018 14:18:16 -0800, windhorn wrote about running scripts
from the interpreter:
[...]
> That works, but nothing is very convenient for debugging simple scripts.
> If I run the script from a command prompt it works, but I lose all my
> other stuff (debugging functions, variables,
On Fri, Feb 16, 2018 at 3:18 PM, windhorn wrote:
> Yes, it's been covered, but not quite to my satisfaction.
>
> Here's an example simple script:
>
> # Very simple script
> bar = 123
>
> I save this as "foo.py" somewhere Python can find it
>
import foo
bar
>
On Sat, Feb 17, 2018 at 9:18 AM, windhorn wrote:
> Yes, it's been covered, but not quite to my satisfaction.
>
> Here's an example simple script:
>
> # Very simple script
> bar = 123
>
> I save this as "foo.py" somewhere Python can find it
>
import foo
bar
>
Yes, it's been covered, but not quite to my satisfaction.
Here's an example simple script:
# Very simple script
bar = 123
I save this as "foo.py" somewhere Python can find it
>>> import foo
>>> bar
Traceback (most recent call last):
File "", line 1, in
NameError: name 'bar' is not defined
On Fri, 30 May 2014 12:04:27 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 11:49 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano
On Fri, May 30, 2014 at 4:20 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
It's on par with creating a file with a name beginning with a
hyphen, and then fiddling around with various commands as you try to
manipulate it (tip: rm ./-r works); programs will happily interpret
-r
On Fri, 30 May 2014 17:19:00 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 4:20 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
It's on par with creating a file with a name beginning with a hyphen,
and then fiddling around with various commands as you try to
manipulate
On Fri, May 30, 2014 at 9:27 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
This is why I'm so adamant that, while REPLs may be permitted to
introduce *new* syntax which is otherwise illegal to the Python parser,
(e.g. like IPython's %magic and !shell commands) they *must not*
On 5/30/2014 7:46 AM, Chris Angelico wrote:
Hmm. I'm not sure that raises SyntaxError is any less a part of the
language's promise than evaluates to twice the value of x is.
Of course it is. A real SyntaxError cannot be caught immediately.* When
new syntax features are added, breaking the
On Fri, 30 May 2014 21:46:55 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 9:27 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
This is why I'm so adamant that, while REPLs may be permitted to
introduce *new* syntax which is otherwise illegal to the Python parser,
On Sat, May 31, 2014 at 5:28 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Before you ask, there is no absolutely hard and fast line between shell
feature and Python code, but the more closely your shell features
resemble Python code, the harder it will be for users (power or
On 5/28/14 10:22 PM, Steven D'Aprano wrote:
If you want to use python as a shell-glue you can try using system.
from os import system
def function_name([parms])
blah blah
rc = system(your_script_name)
os.system is cool for quick and dirty calls to an external command.
On Thu, 29 May 2014 15:26:37 -0500, Mark H Harris wrote:
I think the IDLE REPL should have a system shell mode. What say you?
I don't use IDLE, so I don't really care what you do to it. But speaking
generally, -1 on that. IDLE is primarily aimed at beginners, and
beginners have enough trouble
On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
(By the way, ; won't work for a Python shell, because ;spam already is
valid Python syntax: it's an empty statement followed by the statement
spam, separated by a semicolon.)
That's not really a
On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
(By the way, ; won't work for a Python shell, because ;spam already is
valid Python syntax: it's an empty statement followed by the statement
On Fri, May 30, 2014 at 11:49 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote:
On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
(By the way, ; won't work for a Python shell,
On Friday, January 19, 2001 1:22:23 AM UTC+5:30, Rolander, Dan wrote:
What is the best way to run a python script from within the interpreter?
What command should I use?
Thanks,
Dan
try using execfile(filename)
--
https://mail.python.org/mailman/listinfo/python-list
On 5/28/2014 3:44 AM, onlyvin...@gmail.com wrote:
On Friday, January 19, 2001 1:22:23 AM UTC+5:30, Rolander, Dan wrote:
What is the best way to run a python script from within the interpreter?
What command should I use?
Thanks,
Dan
try using execfile(filename)
or in 3.x
with open(filename)
On 5/28/14 2:44 AM, onlyvin...@gmail.com wrote:
On Friday, January 19, 2001 1:22:23 AM UTC+5:30, Rolander, Dan wrote:
What is the best way to run a python script from within the interpreter?
What command should I use?
try using execfile(filename)
What type of script? python? bash?
On Wed, 28 May 2014 11:39:23 -0500, Mark H Harris wrote:
On 5/28/14 2:44 AM, onlyvin...@gmail.com wrote:
On Friday, January 19, 2001 1:22:23 AM UTC+5:30, Rolander, Dan wrote:
What is the best way to run a python script from within the
.
interpreter?
21 matches
Mail list logo