Scott,
Yes.
As Mark Hammond suggested I took a look into the code/console modules.
I wound up using InteractiveConsole from the code module.
I'm sure my requirements are completely different from yours but I'll
explain what I did anyway...
I was working with a client/server architecture where I
On 28/03/2011 2:06 PM, Eric Frederich wrote:
I'm not sure that I know how to run this function in such a way that
it gives me an interactive session.
I passed in stdin as the first parameter and NULL as the second and
I'd get seg faults when running exit() or even imnport sys.
I don't want to
On 26/03/2011 4:37 AM, Eric Frederich wrote:
So I found that if I type ctrl-d then the other lines will print.
I think ctrl-d just causes sys.stdin to see EOF, so things just fall
out as you desire. exit() will winf up causing the C exit() function
after finalizing, hence the behaviour
This is behavior contradicts the documentation which says the value
passed to sys.exit will be returned from Py_Main.
Py_Main doesn't return anything, it just exits.
This is a bug.
On Sun, Mar 27, 2011 at 3:10 AM, Mark Hammond mhamm...@skippinet.com.au wrote:
On 26/03/2011 4:37 AM, Eric
On Sun, Mar 27, 2011 at 9:33 AM, Eric Frederich
eric.freder...@gmail.com wrote:
This is behavior contradicts the documentation which says the value
passed to sys.exit will be returned from Py_Main.
Py_Main doesn't return anything, it just exits.
This is a bug.
Are you sure that calling the
I'm not talking about the documentation for sys.exit()
I'm talking about the documentation for Py_Main(int argc, char **argv)
http://docs.python.org/c-api/veryhigh.html?highlight=py_main#Py_Main
This C function never returns anything whether in the interpreter I
type exit(123) or sys.exit(123).
On Friday, March 25, 2011 12:02:16 PM UTC-4, Eric Frederich wrote:
Is there something else I should call besides exit() from within the
interpreter?
Is there something other than Py_Main that I should be calling?
Does PyRun_InteractiveLoop also have this problem?
--
On 28/03/2011 5:28 AM, Eric Frederich wrote:
I'm not talking about the documentation for sys.exit()
I'm talking about the documentation for Py_Main(int argc, char **argv)
http://docs.python.org/c-api/veryhigh.html?highlight=py_main#Py_Main
This C function never returns anything whether in the
I'm not sure that I know how to run this function in such a way that
it gives me an interactive session.
I passed in stdin as the first parameter and NULL as the second and
I'd get seg faults when running exit() or even imnport sys.
I don't want to pass a file. I want to run some C code, start
On Sunday, March 27, 2011 11:06:47 PM UTC-4, Eric Frederich wrote:
I'm not sure that I know how to run this function in such a way that
it gives me an interactive session.
I passed in stdin as the first parameter and NULL as the second and
I'd get seg faults when running exit() or even imnport
I am able to embed the interactive Python interpreter in my C program
except that when the interpreter exits, my entire program exits.
#include stdio.h
#include Python.h
int main(int argc, char *argv[]){
printf(line %d\n, __LINE__);
Py_Initialize();
So I found that if I type ctrl-d then the other lines will print.
It must be a bug then that the exit() function doesn't do the same thing.
The documentation says The return value will be the integer passed to
the sys.exit() function but clearly nothing is returned since the
call to Py_Main
On 25/03/2011 17:37, Eric Frederich wrote:
So I found that if I type ctrl-d then the other lines will print.
It must be a bug then that the exit() function doesn't do the same thing.
The documentation says The return value will be the integer passed to
the sys.exit() function but clearly
Added a fflush(stdout) after each printf and, as I expectedstill
only the first 2 prints.
On Fri, Mar 25, 2011 at 1:47 PM, MRAB pyt...@mrabarnett.plus.com wrote:
On 25/03/2011 17:37, Eric Frederich wrote:
So I found that if I type ctrl-d then the other lines will print.
It must be a
Mark Lawrence breamore...@yahoo.co.uk added the comment:
I don't see why this needs to be done, the 2nd paragraph of the doc is pretty
explicit.
This document assumes basic knowledge about Python. For an informal
introduction to the language, see The Python Tutorial. The Python Language
Georg Brandl ge...@python.org added the comment:
Agreed with Mark.
--
resolution: - works for me
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6187
___
On Jun 30, 7:02 pm, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Tue, 30 Jun 2009 13:05:42 -0300, Jérôme Fuselier
jerome.fusel...@gmail.com escribió:
I've tried to import a script in an embedded python intrepreter but
this script fails when it imports the uuid module. I have a
In article 7d5cfbf0-38d5-4505-a93a-f321d0da7...@c36g2000yqn.googlegroups.com,
=?ISO-8859-1?Q?J=E9r=F4me_Fuselier?= jerome.fusel...@gmail.com wrote:
I've tried to import a script in an embedded python intrepreter but
this script fails when it imports the uuid module. I have a
segmentation fault
Hello,
I've tried to import a script in an embedded python intrepreter but
this script fails when it imports the uuid module. I have a
segmentation fault in Py_Finalize().
Here is a simple program which imitate my problem.
main.c :
#include Python.h
void test() {
Py_Initialize();
En Tue, 30 Jun 2009 13:05:42 -0300, Jérôme Fuselier
jerome.fusel...@gmail.com escribió:
I've tried to import a script in an embedded python intrepreter but
this script fails when it imports the uuid module. I have a
segmentation fault in Py_Finalize().
#include Python.h
void test() {
: Improvement in doc of Extending and Embedding the Python Interpreter,
5.3 Beyond Very High Level Embedding: An overview
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file14168/interp3.c
___
Python tracker rep
On Aug 28, 4:03 pm, Grant Edwards [EMAIL PROTECTED] wrote:
On 2007-08-28, Tom Gur [EMAIL PROTECTED] wrote:
Hey,
Do you know an easy way to embed the python interpreter in a python
program (so a non-technical user, which has no idea how to install the
python interpreter would be able to
Hey,
Do you know an easy way to embed the python interpreter in a python
program (so a non-technical user, which has no idea how to install the
python interpreter would be able to run the script as an executable) ?
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Do you mean something like py2exe?
http://www.py2exe.org/
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 28, 8:45 pm, Tom Gur [EMAIL PROTECTED] wrote:
Hey,
Do you know an easy way to embed the python interpreter in a python
program (so a non-technical user, which has no idea how to install the
python interpreter would be able to run the script as an executable) ?
py2exe does this very
On 2007-08-28, Tom Gur [EMAIL PROTECTED] wrote:
Hey,
Do you know an easy way to embed the python interpreter in a python
program (so a non-technical user, which has no idea how to install the
python interpreter would be able to run the script as an executable) ?
Hey,
This question is asked
I have been playing around with this issue for a while and seen some
previous posting trying to address the problem but I haven't seen any
answers to the problem so I am reposting it in my quest for a solution.
I am using python 2.2.3, because I am using some dSpace software
[EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
I am using python 2.2.3, because I am using some dSpace software
(controldesk/automationdesk) that is based upon that version of python. I
have some pre-compiled python modules that come with the dspace
applications. I am pretty
Yogesh Sharma [EMAIL PROTECTED] wrote:
one more question to add:
Is there a way to have 2 local copies of python interpreter ?
Yogesh Sharma wrote:
Hi,
I have following setup:
OS Linux Fedora Core 3
Python 2.3.4
How can I embed two python interpreters in one C++ program ?
Thanks
Take
Hi,
I have following setup:
OS Linux Fedora Core 3
Python 2.3.4
How can I embed two python interpreters in one C++ program ?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
30 matches
Mail list logo