Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 13:10
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
How do I compile apps with Python?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Tman


Joined: 22 Jan 2011
Posts: 814
Location: Toronto

PostPosted: Sat 23 Jun 2012, 23:05    Post_subject:  How do I compile apps with Python?
Sub_title: .
 

These, days when I play with Puppy stuff, I am trying to compile different apps. Having learned the basics of how to use GCC compiler, I thought I'd try to learn how to compile Python apps.

Can anyone please tell me what the basic steps to compiling Python apps are?

More specifically, what is the Python equivalent to the following code?
Code:

./configure  --prefix=/usr  ...etc
make install
make install DESTDIR=/my/custom/folder


So far, I've only discovered the following:
Code:

python setup.py --fcompiler=gnu build
python setup.py install


I not 100% sure if the code above is correct. (input needed)
What code do I need to install the app to a custom folder, so that I can use dir2pet on it?
Back to top
View user's profile Send_private_message 
tallboy


Joined: 21 Sep 2010
Posts: 444
Location: Oslo, Norway

PostPosted: Sun 24 Jun 2012, 07:37    Post_subject:  

Python is an high-level, interpreted languge, so no compilation is necessary.
http://docs.python.org/tutorial/index.html

tallboy
Back to top
View user's profile Send_private_message 
muggins

Joined: 20 Jan 2006
Posts: 6688
Location: lisbon

PostPosted: Sun 24 Jun 2012, 08:58    Post_subject:  

Python apps will often come with setup.py

Code:
 ./setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied
# ./setup.py --help
Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package

Global options:
  --verbose (-v)      run verbosely (default)
  --quiet (-q)        run quietly (turns verbosity off)
  --dry-run (-n)      don't actually do anything
  --help (-h)         show detailed help message
  --command-packages  list of packages that provide distutils commands

Information display options (just display information, ignore any commands)
  --help-commands     list all available commands
  --name              print package name
  --version (-V)      print package version
  --fullname          print <package name>-<version>
  --author            print the author's name
  --author-email      print the author's email address
  --maintainer        print the maintainer's name
  --maintainer-email  print the maintainer's email address
  --contact           print the maintainer's name if known, else the author's
  --contact-email     print the maintainer's email address if known, else the
                      author's
  --url               print the URL for this package
  --license           print the license of the package
  --licence           alias for --license
  --description       print the package description
  --long-description  print the long package description
  --platforms         print the list of platforms
  --classifiers       print the list of classifiers
  --keywords          print the list of keywords
  --provides          print the list of packages/modules provided
  --requires          print the list of packages/modules required
  --obsoletes         print the list of packages/modules made obsolete

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help


Problems arise when the python you've installed is missing certain modules the particular app needs etc.
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sun 24 Jun 2012, 16:29    Post_subject:  

You might also come across "Python eggs" which require "EasyInstall"
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Tman


Joined: 22 Jan 2011
Posts: 814
Location: Toronto

PostPosted: Sun 24 Jun 2012, 22:41    Post_subject:  

Thank you tallboy, muggins and disciple for the info. It is much appreciated. I didn't know python programs don't need to be compiled. So I guess, they are kind-of like bash scripts then?

So I assume that when I use setup.py, I will just look for a "build" folder and use dir2pet on it, after I have renamed it.

I did come across http://cx-freeze.sourceforge.net/ which looks interesting...
It is supposed to turn Python apps into binaries. I haven't tried it out yet, though.
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Sun 24 Jun 2012, 23:26    Post_subject:  

Quote:
So I guess, they are kind-of like bash scripts then?

Yes, they are Python scripts.
As you might have noticed in Muggins post, you don't need to run `python some_script.py`. You can just run `path_to_some_script.py`, and it will run, as long as it is executable.

But some programs that are mainly Python might have parts written in another language like C, to get better performance than Python can provide. In that case the C parts would obviously be compiled. Also, Python programs often have dependencies which are Python bindings of C libraries. These are also compiled IIRC.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0661s ][ Queries: 12 (0.0090s) ][ GZIP on ]