473,671 Members | 2,580 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_Import Module ("__main__") ;
sDictionary = PyModule_GetDic t(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 835

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

Similar topics

4
1470
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 1) deposit all files into a specified directory like when I do make install DESTDIR=/foo
3
1680
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 suspect that it imports other dlls... I am also using numarray. Does anyone have any experiences in packaging python with an application in a single installer ? Has that been done before ?
0
1170
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 Corp Senior Software Engineer, Python core developer, and Python documentation maintainer and editor will present a discussion of zpkg, the Zope Packaging Tools (http:// www.zope.org/Members/fdrake/zpkgtools/).
2
1364
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 setup() and get my data files located in, say, /usr/local/mydata. However when I write my code, it would seem that I have to hardcode the above path. But this would mean that while working on the code I would need to have it 'installed' on my...
1
1269
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 - setup.py - seismic - bulk of the code
3
5784
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 functions) is as follows: python/ `-- dbg/ |-- __init__.py
1
1283
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 python installed? For example, if you assume that they have Python 2.4, but don't have scipy/numpy/matplotlib, is there something which will locally package these modules to distribute with the program? What are the options here? Are there any good...
15
2947
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, controlled via Plesk control panel, and turned over to me with Fedora Core 6 in an empty state. This is the standard way you get a server in a colo today. Bringing Python up in this completely clean environment is a huge hassle, and it doesn't...
24
3370
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 without 'utf8' in it, then things start to go downhill: 2a. The app assumes unicode objects internally. i.e. Whenever there is
1
1370
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 develop some cross- platform open source software and you want to give its popularity a boost by bringing it to Ubuntu and Debian, read on! (Packages are what installers are for Windows.) This session will be hosted by the respected Emilio...
0
8485
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8403
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8677
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2819
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 we have to send another system
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.