User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 401,609 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,682 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.

Projects for the Beginner

Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,425
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 173
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Solution Re: Projects for the Beginner

  #21  
Sep 26th, 2005
Whenever Pythonians gather, there is always a call for an executable file.

If you have Dev-C++, embedding Python is quite easy with the free Python Development Pak. Look at this C++ code snippet for more information:
http://www.daniweb.com/code/snippet387.html

The Python code has to be fed in strings (morsels) to the embedded interpreter, which actually uses a DLL like Python24.dll. I have played around with it, and found for instance that the for loops etc. have to be in one string (interpretable morsel) with a '\n' after the colon and proper indentation included.

For the masochists, this might be one way to create an executable Python file. Come to think of it, you could let a Python program do the nasty detailed work here! You might call it a Python to C++ translator.

Could be fun to experiment with it, start small and grow.
May 'the Google' be with you!
Reply With Quote  
All times are GMT -4. The time now is 5:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC