471,353 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Multiline command line parsing

I am implementing a Python command line from scratch in a Win32 application.

Examples online ("How do I tell incomplete input from invalid input" in the
Extending and Embedding Python FAQ) show how to implement this from scratch
using C code. The examples don't work.

This brief snippit illustrates the problem:

char* code = "class Foo:\n"
"\tdef Bar():\n";
PyObject* temp = PyRun_String(code, Py_single_input, glb, loc);

The syntax is completely valid, but should return an "unexpected EOF while
parsing" (which I can handle). However, I receive "expected an indented block."

Shouldn't this example work as stated? Is there something I am missing about my
indentation technique, or any specific Win32 issues lurking?

Sep 19 '07 #1
0 1209

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Manlio Perillo | last post: by
32 posts views Thread by Elliot Temple | last post: by
4 posts views Thread by Uwe Ziegenhagen | last post: by
4 posts views Thread by Boogie El Aceitoso | last post: by
40 posts views Thread by raphfrk | last post: by
4 posts views Thread by Phoe6 | last post: by
13 posts views Thread by Chris Carlen | last post: by
2 posts views Thread by =?Utf-8?B?UmFtb24gR2VuZQ==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.