cjprecord / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

[PyShell] Running python code from interpreter without an explicit import command? #171

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What Plugin does this relate to? What version of the Plugin?
PyShell 0.8

What steps will reproduce the problem?
1. Enable PyShell, show in shelf
2. Try running a function from within your code, in interpreter

What is the expected output? What do you see instead?
Function runs. Module not found.

(specifically)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'hello_world' is not defined

What version of Editra are you using? On what operating system?
Editra 0.6.37, PyShell 0.8, Launch 1.1, Windows 7 x64

Original issue reported on code.google.com by Alec.Tay...@gmail.com on 27 Apr 2011 at 6:41

GoogleCodeExporter commented 9 years ago
Hi,

What exactly are you trying to do?

If you haven't defined the function 'hello_world' in the shell session yet then 
the error your seeing is expected.

i.e)

>>> def hello_world():
        print "Hello world"
>>> hellow_world()
Hello World
>>>

Original comment by CodyPrec...@gmail.com on 27 Apr 2011 at 2:30

GoogleCodeExporter commented 9 years ago
I open hello.py in editra.

[hello.py]
def hello_world():
    print "Hello World"

Then in PyShell if I type: hello_world() it gives me the aforementioned module 
not found error.

Launcher 1.1 just runs the program, PyShell seems to be just a python 
interpreter completely removed from the opened file. Why not link the 
capabilities of these two plugins to enable us to run programs in PyShell, and 
individual functions in PyShell?

Well anyways, being able to run the functions I've defined in my opened python 
files in PyShell would be appreciated.

Thanks,

Alec Taylor

Original comment by Alec.Tay...@gmail.com on 27 Apr 2011 at 4:59

GoogleCodeExporter commented 9 years ago
Issue 177 has been merged into this issue.

Original comment by CodyPrec...@gmail.com on 26 May 2011 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by CodyPrec...@gmail.com on 26 May 2011 at 5:45

GoogleCodeExporter commented 9 years ago
Any update on this feature request?

Original comment by Alec.Tay...@gmail.com on 28 Aug 2011 at 12:56

GoogleCodeExporter commented 9 years ago
No, this is not a high priority right now, also not sure if it a good idea to 
change this behavior or not. PyShell is already a little questionable to be 
using for more than small snippets of code since it runs in the same instance 
of Python as Editra which makes it possible to corrupt Editra's running 
environment in some cases.

A well written patches might change my mind but for now there is a number of 
other things in my queue that have priority over this.

Original comment by CodyPrec...@gmail.com on 28 Aug 2011 at 9:34