Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 03-13-2006, 02:25 AM   #1
LQ Newbie
Registered: Jan 2006
Distribution: Slackware
Posts: 9

Rep: Reputation: 0
Python doesn't make pyc files

I am running Slackware 10.2, and for some reason running "python" doesn't make a file.pyc (compiled bytecode) in the same directory. Does anyone have a shot this problem? The version of python is 2.4.1
Old 03-13-2006, 04:59 AM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
That will just run the python script. Take a look here and here for documentation on how to compile python source files.
Old 03-13-2006, 05:04 AM   #3
Registered: May 2005
Location: West Virginia, US
Distribution: Gentoo
Posts: 56

Rep: Reputation: 21
That's because python doesn't need pyc files to run. If you need one, the simplest way is to simply import the file into a python shell. Change to the directory the file is in and run python. Then enter this.

from os import getcwd
from sys import path
Then press Ctrl-D to exit python and you should have a .pyc file in the directory.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
python - make curses play nice w/ os.system() datadriven Programming 0 02-17-2005 03:31 PM
Python headers... How do I make 'em? ljr2600 Linux - Software 1 09-06-2004 09:45 PM
Python and binary files The_Nerd Programming 2 08-27-2004 02:48 PM
How do I make a daemon in python for linux? koppertop Linux - Software 1 08-13-2004 10:43 AM
make compile errors -- python problems??? p_motch Linux - Newbie 2 07-11-2004 07:37 PM > Forums > Non-*NIX Forums > Programming

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

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