473,511 Members | 14,975 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

packaging python

J
Hi everyone,

I managed to package python for distribution with my app. I
made 'dist' using py2exe and everything runs fine except there
is no more output from the python interpreter. I redirect the
output like so...
static PyMethodDef ioMethods[] =
{
{"output", output, METH_VARARGS, "output"},
{NULL, NULL, 0, NULL}
};

sModule = PyImport_ImportModule ("__main__");
sDictionary = PyModule_GetDict(sModule);

PyObject* lModule = Py_InitModule("gld", ioMethods);
char *code = "class Sout:\n"
" def write(self, s):\n"
" output(s)\n"
"\n"
"import sys\n"
"from code import *\n"
"from gld import *\n"
"sys.stdout = Sout()\n"
"sys.stderr = Sout()\n"
"sys.stdin = None\n"
"print 12\n";

Output never gets called, but everything else works fine. If I
switch back the installed verion of python output works again. Does
anyone have a quick solution ?

Cheers
Jochen

Sep 25 '05 #1
0 827

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1462
by: Peter | last post by:
Are there commands that can be used to install python apps into a dummy tree for later packaging? I would like to accomplish either of the following: when I run python setup.py install can I ...
3
1669
by: J | last post by:
Hi everyone, I have created an App that embedds the python interpreter and I am now in the process of creating an installer. I am currently linking python24.lib, but it is only 184k and I...
0
1160
by: Benji York | last post by:
Please join us September 14, 7:30-9:00 PM, for the fourth meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). This meeting has three features of note. - Fred Drake, Zope...
2
1358
by: Rajarshi Guha | last post by:
Hi, I've been trying to package a python project and I'm a little confused about how I distribute some PNG's that the program uses as icons. Using distutils I can set the data_files argument of...
1
1260
by: schwehr | last post by:
Hi All, I am rearranging the layout of one of my python projects so that it more closely conforms to how most python projects seem to work. I now have a structure like this: seismic-py -...
3
5781
by: Sandro Dentella | last post by:
Hi everybody, I'm trying to fix the packaging of a very simple package, but some problem show me that I have not well understood the whole mechanism The structure of my package (some debug...
1
1272
by: Brian Blais | last post by:
Hello, What is the preferred way of packaging python programs? I know a bit about py2exe (windows) and freeze (linux), but is there a way to package something if you assume that they have...
15
2929
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
24
3340
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
1
1366
by: SPE - Stani's Python Editor | last post by:
Hi All, If you wrote some python code that you want to package or know a cool python application of which you like to make a deb installer, the python packaging session is all for you! Do you...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.