LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Distribute applications made in phyton with distutils (https://www.linuxquestions.org/questions/programming-9/distribute-applications-made-in-phyton-with-distutils-761034/)

jtheoden 10-10-2009 03:53 PM

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...

lutusp 10-10-2009 06:20 PM

Quote:

Originally Posted by jtheoden (Post 3714835)
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?


All times are GMT -5. The time now is 12:06 AM.