[issue33269] InteractiveConsole behaves differently when used on terminal and used within script

2018-04-12 Thread Kadir Haldenbilen

Kadir Haldenbilen  added the comment:

Attached is a non working example
I could not attach a second file, which works OK within script I will attach 
separately

--
Added file: https://bugs.python.org/file47533/iitests.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33269] InteractiveConsole behaves differently when used on terminal and used within script

2018-04-12 Thread Kadir Haldenbilen

Kadir Haldenbilen  added the comment:

This script works OK. Compare with iitests.py uploaded before

--
Added file: https://bugs.python.org/file47534/iiteswok.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33269] InteractiveConsole behaves differently when used on terminal and used within script

2018-04-12 Thread Kadir Haldenbilen

New submission from Kadir Haldenbilen :

on terminal push and runcode accepts indentation where required (like for loop 
etc), within script gives error message

on terminal import works properly and objects can be found  as normal, within 
script you may need to add module name upfront

simple example
import code
ii = code.InteractiveConsole()
ii.push("for ii in range(3):")
ii.push("print('i', i)")

you will get normal expected output on terminal, but indentation error within 
script

ii.push("from time import sleep")
ii.push("sleep(1)")
will sleep 1 sec on terminal, but will give name error

--
messages: 315224
nosy: Kadir Haldenbilen
priority: normal
severity: normal
status: open
title: InteractiveConsole behaves differently when used on terminal and used 
within script
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com