Re: embedding interactive python interpreter

2013-09-11 Thread Eric Frederich
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 w

Re: How to print a number as if in the python interpreter?

2012-09-02 Thread me
Use repr() print(repr(sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]))) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print a number as if in the python interpreter?

2012-07-06 Thread Chris Rebert
On Fri, Jul 6, 2012 at 3:38 PM, Peng Yu wrote: > Hi, > > In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) > Out[2]: 0. > > In ipython, I got the above output. But I got a different output from > "print". Is there a way to print exact what I saw in ipython? > > ~/linux/test/pyt

How to print a number as if in the python interpreter?

2012-07-06 Thread Peng Yu
Hi, In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) Out[2]: 0. In ipython, I got the above output. But I got a different output from "print". Is there a way to print exact what I saw in ipython? ~/linux/test/python/man/library/math/fsum$ cat main.py #!/usr/bin/env python pr

has anybody used ctypes to call back into c program which embeds a python interpreter

2012-03-31 Thread Hannu Krosing
Hi, I want to use ctypes to use some functions from postgreSQL server which embeds python interpreter as language pl/python. That is I want to use ctypes to call _back_ to some internal functions in the server What I tried is the following: hannu=# create or replace function send_raw_notice

Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Joshua Jodrey
a some python directories laying around from an odd svn installation or something... Thanks again! From: Fabio Zadrozny To: Joshua Jodrey Cc: "python-list@python.org" Sent: Friday, December 16, 2011 12:57 PM Subject: Re: Python Interpreter Error

Re: Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-16 Thread Fabio Zadrozny
It seems you have a version of Python 2.5 in your system and when starting up Python 3.2.2 it's getting things from 2.5 (this would probably also happen on the command line). The usual suspect is that you defined a PYTHONROOT variable which is pointing to Python 2.5 and not to the python you're us

Python Interpreter Error with PyDev (Eclipse IDE)

2011-12-15 Thread Joshua Jodrey
Hi, This is my first email to this list, so I apologize if there's a better mailing-list for this type of question. I'm looking to get started with python development, so I downloaded Python 3.2.2 and PyDev IDE for Eclipse.  When I go to configure my interpreter for a new python project, Window

Re: Using the Python Interpreter as a Reference

2011-12-02 Thread Devin Jeanpierre
> In my opinion, if your code is indented four or more levels, you should > start to think about refactorising your code; if you reach six levels, > your code is probably a mess. Here's some code I encountered while grading assignments from first-year CS students: if 'not' in temp_holder:

RE: Using the Python Interpreter as a Reference

2011-12-02 Thread Sells, Fred
thon-list-bounces+frsells=adventistcare@python.org] On Behalf Of Steven D'Aprano Sent: Thursday, December 01, 2011 7:43 PM To: python-list@python.org Subject: Re: Using the Python Interpreter as a Reference On Thu, 01 Dec 2011 10:03:53 -0800, DevPlayer wrote: [...] > Well, that may be a lit

Re: Using the Python Interpreter as a Reference

2011-12-01 Thread Chris Angelico
On Fri, Dec 2, 2011 at 11:43 AM, Steven D'Aprano wrote: > Why would you want to encourage coders to write deeply indented code? > > In my opinion, if your code is indented four or more levels, you should > start to think about refactorising your code; if you reach six levels, > your code is probab

Re: Using the Python Interpreter as a Reference

2011-12-01 Thread Steven D'Aprano
On Thu, 01 Dec 2011 10:03:53 -0800, DevPlayer wrote: [...] > Well, that may be a little hyperbolic. But with 2 spaces you can > encourage coders to get very deep, indentially, and still fit 80 chars. Why would you want to encourage coders to write deeply indented code? In my opinion, if your cod

Re: Using the Python Interpreter as a Reference

2011-12-01 Thread DevPlayer
f myfunc(): \t"""here is my docstring that bla bla bla's \t\tand indented do da days... \t""" verse (s = space) def myfunc(): """here is my docstring that bla bla bla's and indented do da days... """ verse space = tab or s

Re: Using the Python Interpreter as a Reference

2011-11-29 Thread Dave Angel
On 11/29/2011 03:12 AM, Steven D'Aprano wrote: On Tue, 29 Nov 2011 13:57:32 +1100, Chris Angelico wrote: I'm inclined toward an alternative: explicit recursion. Either a different syntax, or a special-case on the use of the function's own name, but whichever syntax you use, it compiles in a "re

Re: Using the Python Interpreter as a Reference

2011-11-29 Thread Steven D'Aprano
On Tue, 29 Nov 2011 13:57:32 +1100, Chris Angelico wrote: > I'm inclined toward an alternative: explicit recursion. Either a > different syntax, or a special-case on the use of the function's own > name, but whichever syntax you use, it compiles in a "recurse" opcode. > That way, if name bindings

Re: Using the Python Interpreter as a Reference

2011-11-29 Thread Steven D'Aprano
On Tue, 29 Nov 2011 12:49:49 +1100, Chris Angelico wrote: > On Tue, Nov 29, 2011 at 11:54 AM, DevPlayer wrote: >> To me, I would think the interpreter finding the coder's intended >> indent wouldn't be that hard. And just make the need for consistant >> spaces or tabs irrevelent simply by reforma

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Ian Kelly
On Mon, Nov 28, 2011 at 7:42 PM, Travis Parks wrote: > I find that interesting. I also find it interesting that the common > functional methods (all, any, map, filter) are basically built into > Python core language. That is unusual for most imperative programming > languages early-on. all and an

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 5:57 pm, Steven D'Aprano wrote: > On Mon, 28 Nov 2011 13:29:06 -0800, Travis Parks wrote: > > Exception handling is one of those subjects few understand and fewer can > > implement properly in modern code. Languages that don't support > > exceptions as part of their signature lead to ca

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 8:49 pm, Chris Angelico wrote: > On Tue, Nov 29, 2011 at 11:54 AM, DevPlayer wrote: > > To me, I would think the interpreter finding the coder's intended > > indent wouldn't be that hard. And just make the need for consistant > > spaces or tabs irrevelent simply by reformatting the ind

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Chris Angelico
On Tue, Nov 29, 2011 at 1:42 PM, Travis Parks wrote: > A good example I have run into is recursion. When a local function > calls itself, the name of the function may not be part of scope (non- > local). Languages that support tail-end recursion optimization can't > optimize. In order to support t

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 5:24 pm, Steven D'Aprano wrote: > On Mon, 28 Nov 2011 12:32:59 -0700, Ian Kelly wrote: > > On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano > > wrote: > [...] > >>> Lambdas and functions are the same thing in my language, so no need > >>> for a special keyword. > > >> That does not fol

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Chris Angelico
On Tue, Nov 29, 2011 at 11:54 AM, DevPlayer wrote: > To me, I would think the interpreter finding the coder's intended > indent wouldn't be that hard. And just make the need for consistant > spaces or tabs irrevelent simply by reformatting the indent as > expected. Pretty much all my text editors

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread DevPlayer
> I do not understand why the interpreter preprocesses each logical line > of source code using something as simple as this: correction: I do not understand why the interpreter - does not- preprocess each logical line of source code using something as simple as this: -- http://mail.python.org/m

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread DevPlayer
On Nov 27, 6:55 pm, Steven D'Aprano wrote: > On Sun, 27 Nov 2011 14:21:01 -0800, Travis Parks wrote: > > Personally, I find a lot of good things in Python. I thinking tabs are > > out-of-date. Even the MAKE community wishes that the need for tabs would > > go away and many implementations have don

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2011 13:29:06 -0800, Travis Parks wrote: > Exception handling is one of those subjects few understand and fewer can > implement properly in modern code. Languages that don't support > exceptions as part of their signature lead to capturing generic > Exception all throughout code. It

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Chris Angelico
On Tue, Nov 29, 2011 at 9:24 AM, Steven D'Aprano wrote: > Because the syntax is completely different. One is a statement, and > stands alone, the other is an expression. Even putting aside the fact > that lambda's body is an expression, and a def's body is a block, def > also requires a name. Usin

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Steven D'Aprano
On Mon, 28 Nov 2011 12:32:59 -0700, Ian Kelly wrote: > On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano > wrote: [...] >>> Lambdas and functions are the same thing in my language, so no need >>> for a special keyword. >> >> That does not follow. Lambdas and def functions are the same thing in >>

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Chris Angelico
On Tue, Nov 29, 2011 at 8:29 AM, Travis Parks wrote: > Languages that don't support > exceptions as part of their signature lead to capturing generic > Exception all throughout code. It is one of those features I wish .NET > had. At the same time, with my limited experience with Java, it has > bee

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 3:40 pm, Gregory Ewing wrote: > Travis Parks wrote: > > I thinking tabs are > > out-of-date. Even the MAKE community wishes that the need for tabs > > would go away > > The situation with make is a bit different, because it > *requires* tabs in certain places -- spaces won't do. > Pytho

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 2:32 pm, Ian Kelly wrote: > On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano > > wrote: > >> My language combines generators and collection initializers, instead of > >> creating a whole new syntax for comprehensions. > > >> [| for i in 0..10: for j in 0.10: yield return i * j |] > > >

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Neil Cerutti
On 2011-11-28, Gregory Ewing wrote: > Neil Cerutti wrote: >> I've always held with the "anti-functional style conspiracy" >> interpretation of Python's lambda expressions. They were added >> but grudgingingly, made weak on purpose to discourage their >> use. > > Seems to me that Python's lambdas a

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Alemu mihretu
Hello all, My python runs and crashes after another run. I am getting errors like Microsoft Visual C++ Runtime Library program c:\Python27\pythonw.exe This application has requested the Runtime to terminate it in an usuak way. Please contact the application's support team for more information.

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Gregory Ewing
Neil Cerutti wrote: I've always held with the "anti-functional style conspiracy" interpretation of Python's lambda expressions. They were added but grudgingingly, made weak on purpose to discourage their use. Seems to me that Python's lambdas are about as powerful as they can be given the stat

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Gregory Ewing
Travis Parks wrote: I thinking tabs are out-of-date. Even the MAKE community wishes that the need for tabs would go away The situation with make is a bit different, because it *requires* tabs in certain places -- spaces won't do. Python lets you choose which to use as long as you don't mix them

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Neil Cerutti
On 2011-11-28, Ian Kelly wrote: > I think the implication is that Unit has only one syntax for > creating functions, which is lambda-style. In any case, why > does Python require a special keyword? def is only used in a > statement context, and lambda is only used in an expression > context. Wh

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Ian Kelly
On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano wrote: >> My language combines generators and collection initializers, instead of >> creating a whole new syntax for comprehensions. >> >> [| for i in 0..10: for j in 0.10: yield return i * j |] > > Are we supposed to intuit what that means? > > Is

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 27, 6:55 pm, Steven D'Aprano wrote: > On Sun, 27 Nov 2011 14:21:01 -0800, Travis Parks wrote: > > Personally, I find a lot of good things in Python. I thinking tabs are > > out-of-date. Even the MAKE community wishes that the need for tabs would > > go away and many implementations have don

Re: Using the Python Interpreter as a Reference

2011-11-27 Thread Chris Angelico
On Mon, Nov 28, 2011 at 10:55 AM, Steven D'Aprano wrote: > What does it mean to say that a language is "small"? > > A Turing Machine is a pretty small language, with only a few > instructions: step forward, step backwards, erase a cell, write a cell, > branch on the state of the cell. And yet anyt

Re: Using the Python Interpreter as a Reference

2011-11-27 Thread Steven D'Aprano
On Sun, 27 Nov 2011 14:21:01 -0800, Travis Parks wrote: > Personally, I find a lot of good things in Python. I thinking tabs are > out-of-date. Even the MAKE community wishes that the need for tabs would > go away and many implementations have done just that. Tabs have every theoretical advantage

Re: Using the Python Interpreter as a Reference

2011-11-27 Thread Colin Higwell
On Sun, 27 Nov 2011 14:21:01 -0800, Travis Parks wrote: > On Nov 26, 1:53 pm, Rick Johnson wrote: >> On Nov 20, 6:46 pm, Travis Parks wrote: >> >> > Hello: >> >> > I am currently working on designing a new programming language. It is >> > a compiled language, but I still want to use Python as a

Re: Using the Python Interpreter as a Reference

2011-11-27 Thread Travis Parks
On Nov 26, 1:53 pm, Rick Johnson wrote: > On Nov 20, 6:46 pm, Travis Parks wrote: > > > Hello: > > > I am currently working on designing a new programming language. It is > > a compiled language, but I still want to use Python as a reference. > > Python has a lot of similarities to my language, s

Re: Using the Python Interpreter as a Reference

2011-11-26 Thread Rick Johnson
On Nov 26, 1:34 pm, Chris Angelico wrote: > On Sun, Nov 27, 2011 at 5:53 AM, Rick Johnson > > wrote: > > I hope you meant to say "*forced* indention for code blocks"! "Forced" > > being the key word here. What about tabs over spaces, have you decided > > the worth of one over the other or are you

Re: Using the Python Interpreter as a Reference

2011-11-26 Thread Chris Angelico
On Sun, Nov 27, 2011 at 5:53 AM, Rick Johnson wrote: > I hope you meant to say "*forced* indention for code blocks"! "Forced" > being the key word here. What about tabs over spaces, have you decided > the worth of one over the other or are you going to repeat Guido's > folly? I recommend demandin

Re: Using the Python Interpreter as a Reference

2011-11-26 Thread Rick Johnson
On Nov 20, 6:46 pm, Travis Parks wrote: > Hello: > > I am currently working on designing a new programming language. It is > a compiled language, but I still want to use Python as a reference. > Python has a lot of similarities to my language, such as indentation > for code blocks, I hope you mea

Re: Using the Python Interpreter as a Reference

2011-11-26 Thread Alec Taylor
Consider implementing OOP, reflection and implement in HLA or C =] On Mon, Nov 21, 2011 at 11:46 AM, Travis Parks wrote: > Hello: > > I am currently working on designing a new programming language. It is > a compiled language, but I still want to use Python as a reference. > Python has a lot of

Re: Using the Python Interpreter as a Reference

2011-11-26 Thread Matt Joiner
http://pyjs.org/ On Sat, Nov 26, 2011 at 3:22 PM, Sells, Fred wrote: > I'm looking at a variation on this theme.  I currently use > Flex/ActionScript for client side work, but there is pressure to move > toward HTML5+Javascript and or iOS.  Since I'm an old hand at Python, I > was wondering if th

RE: Using the Python Interpreter as a Reference

2011-11-25 Thread Sells, Fred
I'm looking at a variation on this theme. I currently use Flex/ActionScript for client side work, but there is pressure to move toward HTML5+Javascript and or iOS. Since I'm an old hand at Python, I was wondering if there is a way to use it to model client side logic, then generate the javascript

Re: Using the Python Interpreter as a Reference

2011-11-25 Thread rusi
On Nov 21, 5:46 am, Travis Parks wrote: > Hello: > > I am currently working on designing a new programming language. It is > a compiled language, but I still want to use Python as a reference. > Python has a lot of similarities to my language, such as indentation > for code blocks, lambdas, non-lo

Re: Using the Python Interpreter as a Reference

2011-11-25 Thread Chris Angelico
On Fri, Nov 25, 2011 at 9:55 PM, Travis Parks wrote: > I have been thinking about compiling into a > language like C++ or C instead of assembler for my first time through. Yep, or any other language you feel like using as an intermediate. Or alternatively, just start with an interpreter - whateve

Re: Using the Python Interpreter as a Reference

2011-11-25 Thread Travis Parks
On Nov 22, 1:37 pm, Alan Meyer wrote: > On 11/20/2011 7:46 PM, Travis Parks wrote: > > > Hello: > > > I am currently working on designing a new programming language. ... > > I have great respect for people who take on projects like this. > > Your chances of popularizing the language are small.  Th

Re: Using the Python Interpreter as a Reference

2011-11-22 Thread Alan Meyer
On 11/20/2011 7:46 PM, Travis Parks wrote: Hello: I am currently working on designing a new programming language. ... I have great respect for people who take on projects like this. Your chances of popularizing the language are small. There must be thousands of projects like this for every

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-22 Thread becky_lewis
On Nov 15, 8:37 pm, Passiday wrote: > Hello, > > I am looking for a way how to bring Python interpreter to JavaScript, in > order to provide a web-based application with python scripting capabilities. > The app would have basic IDE for writing and debugging the python c

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-22 Thread Lorenzo
t > feasible? > I cannot imagine how slow can be a python interpreter in javascript crunching numbers using numpy, and converting those numeric libraries (ATLAS, LAPACK,MKL,ACML) to javascript. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using the Python Interpreter as a Reference

2011-11-21 Thread Travis Parks
On Nov 21, 12:44 am, Steven D'Aprano wrote: > On Mon, 21 Nov 2011 13:33:21 +1100, Chris Angelico wrote: > > What's your language's "special feature"? I like to keep track of > > languages using a "slug" - a simple one-sentence (or less) statement of > > when it's right to use this language above o

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-21 Thread Alec Taylor
Just compile your python to C :] On Mon, Nov 21, 2011 at 6:41 PM, OKB (not okblacke) wrote: > Carl Banks wrote: > >> Some people have already made an LLVM-to-Javascript compiler, and >> have managed to build Python 2.7 with it. >> >> The LLVM-to-Javascript project is called emscripten. >> >> htt

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-20 Thread OKB (not okblacke)
Carl Banks wrote: > Some people have already made an LLVM-to-Javascript compiler, and > have managed to build Python 2.7 with it. > > The LLVM-to-Javascript project is called emscripten. > > https://github.com/kripken/emscripten/wiki > > Demo of Python (and a bunch of other languages) here: >

Re: Using the Python Interpreter as a Reference

2011-11-20 Thread Chris Angelico
On Mon, Nov 21, 2011 at 4:44 PM, Steven D'Aprano wrote: > On Mon, 21 Nov 2011 13:33:21 +1100, Chris Angelico wrote: > >> What's your language's "special feature"? I like to keep track of >> languages using a "slug" - a simple one-sentence (or less) statement of >> when it's right to use this langu

Re: Using the Python Interpreter as a Reference

2011-11-20 Thread Steven D'Aprano
On Mon, 21 Nov 2011 13:33:21 +1100, Chris Angelico wrote: > What's your language's "special feature"? I like to keep track of > languages using a "slug" - a simple one-sentence (or less) statement of > when it's right to use this language above others. For example, Python > is optimized for 'rapid

Re: Using the Python Interpreter as a Reference

2011-11-20 Thread Dan Stromberg
On Sun, Nov 20, 2011 at 4:46 PM, Travis Parks wrote: > Hello: > > I am currently working on designing a new programming language. It is > a compiled language, but I still want to use Python as a reference. > Python has a lot of similarities to my language, such as indentation > for code blocks, la

Re: Using the Python Interpreter as a Reference

2011-11-20 Thread Chris Angelico
On Mon, Nov 21, 2011 at 11:46 AM, Travis Parks wrote: > I am currently working on designing a new programming language. It is > a compiled language, but I still want to use Python as a reference. > Python has a lot of similarities to my language, such as indentation > for code blocks, lambdas, non

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-20 Thread Lorenzo
On Nov 15, 11:51 pm, Carl Banks wrote: > Some people have already made an LLVM-to-Javascript compiler, and have > managed to build Python 2.7 with it. > > The LLVM-to-Javascript project is called emscripten. > > https://github.com/kripken/emscripten/wiki > > Demo of Python (and a bunch of other l

Using the Python Interpreter as a Reference

2011-11-20 Thread Travis Parks
Hello: I am currently working on designing a new programming language. It is a compiled language, but I still want to use Python as a reference. Python has a lot of similarities to my language, such as indentation for code blocks, lambdas, non-locals and my language will partially support dynamic

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-16 Thread Amirouche Boubekki
Héllo I am looking for a way how to bring Python interpreter to JavaScript, in > order to provide a web-based application with python scripting > capabilities. The app would have basic IDE for writing and debugging the > python code, but the interpretation, of course, would b

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Passiday
Of course, I am aware of this. But the file system can be emulated, and certain networking can be mediated via the server, too. But for starts, I don't plan to go beyond the basic file operations, if at all. -- http://mail.python.org/mailman/listinfo/python-list

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Passiday
Thanks Carl, this looks like a good base to start from. -- http://mail.python.org/mailman/listinfo/python-list

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Carl Banks
On Tuesday, November 15, 2011 12:37:03 PM UTC-8, Passiday wrote: > Hello, > > I am looking for a way how to bring Python interpreter to JavaScript, in > order to provide a web-based application with python scripting capabilities. > The app would have basic IDE for writing an

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Alan Meyer
On 11/15/2011 3:37 PM, Passiday wrote: Hello, I am looking for a way how to bring Python interpreter to JavaScript, in order to provide a web-based application with python scripting capabilities. The app would have basic IDE for writing and debugging the python code, but the interpretation

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Terry Reedy
On 11/15/2011 3:52 PM, Ian Kelly wrote: On Tue, Nov 15, 2011 at 1:37 PM, Passiday wrote: Hello, I am looking for a way how to bring Python interpreter to JavaScript, in order to provide a web-based application with python scripting capabilities. The app would have basic IDE for writing and

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Stef Mientki
On 15-11-2011 21:37, Passiday wrote: Hello, I am looking for a way how to bring Python interpreter to JavaScript, in order to provide a web-based application with python scripting capabilities. The app would have basic IDE for writing and debugging the python code, but the interpretation, of

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Ian Kelly
On Tue, Nov 15, 2011 at 1:37 PM, Passiday wrote: > Hello, > > I am looking for a way how to bring Python interpreter to JavaScript, in > order to provide a web-based application with python scripting capabilities. > The app would have basic IDE for writing and debugging the p

(don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Passiday
Hello, I am looking for a way how to bring Python interpreter to JavaScript, in order to provide a web-based application with python scripting capabilities. The app would have basic IDE for writing and debugging the python code, but the interpretation, of course, would be done in JavaScript

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Chris Angelico
On Wed, Nov 16, 2011 at 7:37 AM, Passiday wrote: > The app would have basic IDE for writing and debugging the python code, but > the interpretation, of course, would be done in JavaScript. I'd like to avoid > any client-server transactions, so all the interpretation should take place > on the c

Adding new keywords to Python interpreter

2011-10-02 Thread Yaşar Arabacı
Hi people, Nowadays, I am trying to explore python source. I added a new keyword, essentially doing same thing as 'continue' keyword to the interpreter, mostly by following instructions in PEP 306. If anyone interested here is the video about how I did it: http://www.youtube.com/watch?v=Ww7BeIdUb

Re: why ps/fname of a python interpreter changes across platforms?

2011-09-16 Thread Duncan Booth
keobox wrote: > I don't know why the fname of the python interpreter changes across > platforms. > > I saw a "isapytho" in some solaris 10 platforms. > I saw "python2." in some Linux platforms. > On most platforms the value is "python". &

Fwd: why ps/fname of a python interpreter changes across platforms?

2011-09-16 Thread Yaşar Arabacı
-- Yönlendirilmiş ileti -- Kimden: Yaşar Arabacı Tarih: 16 Eylül 2011 14:33 Konu: Re: why ps/fname of a python interpreter changes across platforms? Kime: Steven D'Aprano For example, in arch linux, I had 3 different interpreters named python, python26 and python27 because

Re: why ps/fname of a python interpreter changes across platforms?

2011-09-16 Thread Steven D'Aprano
, they > are not launched with exec permissions. > > I don't know why the fname of the python interpreter changes across > platforms. Ask the person who built the system, or the people who made the distribution. They are free to name the Python executable anything they like. -- Steven

why ps/fname of a python interpreter changes across platforms?

2011-09-16 Thread keobox
I don't know why the fname of the python interpreter changes across platforms. I saw a "isapytho" in some solaris 10 platforms. I saw "python2." in some Linux platforms. On most platforms the value is "python". Why? Ok, I know that I can easily work around the

Re: embedding interactive python interpreter

2011-03-28 Thread Mark Hammond
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 pa

Re: embedding interactive python interpreter

2011-03-27 Thread eryksun ()
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 imnp

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
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 an

Re: embedding interactive python interpreter

2011-03-27 Thread Mark Hammond
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

Re: embedding interactive python interpreter

2011-03-27 Thread eryksun ()
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? -- http://mail.python.o

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
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)

Re: embedding interactive python interpreter

2011-03-27 Thread Jerry Hill
On Sun, Mar 27, 2011 at 9:33 AM, Eric Frederich 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 builtin exit() function

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
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 wrote: > On 26/03/2011 4:37 AM, Eric Frederich wrote: > exit() will wi

Re: embedding interactive python interpreter

2011-03-27 Thread Mark Hammond
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

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
ay to pass a value back from the interpreter via sys.exit. >> > You could flush stdout after each print or turn off buffering on stdout > with: > >    setvbuf(stdout, NULL, _IONBF, 0); > >> Thanks, >> ~Eric >> >> >> >> On Fri, Mar 25, 2011 at

Re: embedding interactive python interpreter

2011-03-25 Thread MRAB
able to embed the interactive Python interpreter in my C program except that when the interpreter exits, my entire program exits. #include #include int main(int argc, char *argv[]){ printf("line %d\n", __LINE__); Py_Initialize(); printf("line

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
to pass a value back from the interpreter via sys.exit. Thanks, ~Eric On Fri, Mar 25, 2011 at 12:02 PM, Eric Frederich wrote: > I am able to embed the interactive Python interpreter in my C program > except that when the interpreter exits, my entire program exits. > >    #include >

embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
I am able to embed the interactive Python interpreter in my C program except that when the interpreter exits, my entire program exits. #include #include int main(int argc, char *argv[]){ printf("line %d\n", __LINE__); Py_Initialize(); printf(

Re: python interpreter

2011-01-26 Thread Dave Angel
On 01/-10/-28163 02:59 PM, nair rajiv wrote: Hi, I was exploring python. I wanted to know more about the python interpreter i.e the technical details of how it has been written. If I am directed to the code that also will be fine. The implementation of python data structures lists, tuples and

python interpreter

2011-01-25 Thread nair rajiv
Hi, I was exploring python. I wanted to know more about the python interpreter i.e the technical details of how it has been written. If I am directed to the code that also will be fine. The implementation of python data structures lists, tuples and dictionaries. If there exists any online

Re: how to embed the python interpreter into web App (Mehndi, Sibtey)

2009-07-29 Thread André
On Jul 29, 1:11 pm, Ryniek90 wrote: > > Hi All > > > I am trying to embed the python interpreter in to a web app but could > > not get the way, any one can suggest me how to do this. > > > Thanks, > > > Sibtey Mehdi > > > This e-mail (and any att

Re: how to embed the python interpreter into web App (Mehndi, Sibtey)

2009-07-29 Thread Ryniek90
Hi All I am trying to embed the python interpreter in to a web app but could not get the way, any one can suggest me how to do this. Thanks, Sibtey Mehdi This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended

how to embed the python interpreter into web App

2009-07-29 Thread Mehndi, Sibtey
Hi All I am trying to embed the python interpreter in to a web app but could not get the way, any one can suggest me how to do this. Thanks, Sibtey Mehdi This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients

Re: Problem with uuid package when embedding a python interpreter

2009-07-01 Thread Aahz
In article <7d5cfbf0-38d5-4505-a93a-f321d0da7...@c36g2000yqn.googlegroups.com>, =?ISO-8859-1?Q?J=E9r=F4me_Fuselier?= 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 in Py_Finalize(). Yo

Re: Problem with uuid package when embedding a python interpreter

2009-07-01 Thread Jérôme Fuselier
On Jun 30, 7:02 pm, "Gabriel Genellina" wrote: > En Tue, 30 Jun 2009 13:05:42 -0300, Jérôme Fuselier > 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().

Re: Problem with uuid package when embedding a python interpreter

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 13:05:42 -0300, Jérôme Fuselier 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() { Py_Initialize(); PyImp

Problem with uuid package when embedding a python interpreter

2009-06-30 Thread Jérôme Fuselier
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(); Py

using Winpdb in an embedded python interpreter

2009-05-16 Thread Adrian Genaid
Hi there, I have a problem using Winpdb in Pythonscripts running in a program which uses an embedded Python interpreter. After linking all needed modules statically to python, "import rpdb2" can be done and leads to no error. But on using the next line "rpdb2.start_embedded_deb

<    1   2   3   4   5   >