LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2009, 03:53 PM   #1
jtheoden
LQ Newbie
 
Registered: Nov 2008
Location: Stgo de Cuba, Cuba
Distribution: Debian and Ubuntu
Posts: 1

Rep: Reputation: 0
Thumbs up Distribute applications made in phyton with distutils


Hey Folks:

I need distribute my application made under phyton2.5 but this use some phyton modules such as os module, using distutils how must be setup.py to recognize the use of os module?

Example :

source code of application to distribute: test.py

------------------------------------------------------------
import sys
print str(sys.platform)
------------------------------------------------------------

source code of file setup.py :
------------------------------------------------------------

from distutils import extension
import os, sys
from distutils.core import setup

setup(
name="test",
version="1.0",
description="test 1.0i",
author="Theoden",
author_email="jtheoden@gmail.com",
url="jtheoden@gmail.com",
license="GPL",
scripts=["milo.py"],
py_modules=[""],

ext_modules=[extension.Extension('os',include_dirs = ['/usr/bin'],)], # here is trouble
)
------------------------------------------------------------

any help, any advice, any suggests will be appreciate...

Last edited by jtheoden; 10-11-2009 at 03:24 PM. Reason: wrong spelling
 
Old 10-10-2009, 06:20 PM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by jtheoden View Post
Hey Folks:

I need distribute my application made under phyton2.5 but this use some phyton modules such as os module, using distutils how must be setup.py to recognize the use of os module?

Example :

source code of application to distribute: test.py

------------------------------------------------------------
import sys
print str(sys.platform)
------------------------------------------------------------

source code of file setup.py :
------------------------------------------------------------

from distutils import extension
import os, sys
from distutils.core import setup

setup(
name="test",
version="1.0",
description="test 1.0i",
author="Theoden",
author_email="jtheoden@gmail.com",
url="jtheoden@gmail.com",
license="GPL",
scripts=["milo.py"],
py_modules=[""],

ext_modules=[extension.Extension('os',include_dirs = ['/usr/bin'],)], # here is trouble
)
------------------------------------------------------------

any help, any advice, any suggests will be appreciate...
First, your post will not be visible to all those Googlers in the future who are interested in Python because you aren't spelling it correctly. Spelling is only as important as it is (not very) unless you are posting on the Internet, in which case spelling becomes very important -- it's how people locate your writings.

Second, the "os" Python module is assumed to be the same between Python releases on different platforms, so distributing a Python program for a given Python version should run anywhere. This means you don't have to either bundle or identify the location of any particular libraries or modules, unless of course you wrote your own. In the latter case, you would simply include the custom modules with your program.

Oh, by the way -- did I happen to mention that you need to be careful about how you spell Python?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing applications made easy davsimp77 Linux - Newbie 1 08-23-2008 01:47 PM
Uninstall/Upgrade Phyton 2.2.3 poeta_boy Linux - Newbie 2 01-25-2006 05:23 PM
using distutils to install a python module shanenin Programming 2 11-29-2005 09:44 PM
pygoogle-0.6 no distutils.version in Knoppix 3.6 suguru Programming 0 10-13-2004 09:07 PM
how to change PKG_CONFIG_PATH per gnome-phyton Ali79 Linux - Software 0 10-12-2004 11:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration