473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Re: Are .pyc files portable?

Python compiles to bytecode, which means that pyc files can be
interpreted by any Python executable regardless of platform.

As for manual compilation to directories, the py_compile module is the
one you want. Here's an example program to plug in.

#test_compile.py#

import py_compile

print "hello"
py_compile.compile("test_compile.py", "C:\test_compile.pyc")
The manual page for py_compile.compile() can be found on this page:
http://www.python.org/doc/2.5.2/lib/...pycompile.html

Hope that helps.
Cheers,
Wubbulous
Nov 8 '08 #1
1 2935
On Fri, 07 Nov 2008 19:01:31 -0800, Wubbulous wrote:
Python compiles to bytecode, which means that pyc files can be
interpreted by any Python executable regardless of platform.
No, bytecode isn't compatible from one version number to another.

--
Steven
Nov 8 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Efrat Regev | last post by:
Hello, I would like to recurse through a directory and make files (which match a specific criteria) read only. From searching the Internet, I found...
15
by: Rex_chaos | last post by:
I am a c programmer and new to C++. In C, I am familiar with some operations on file. Now when shifting from c to c++, using iostream, I have no idea how to perform the following operations 1....
27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
8
by: jvyyuie | last post by:
// My email is jvyyuie@hotmail.com // I want to make some friends and discuss about programing. #include "stdafx.h" #include <malloc.h> #include <string.h> #define sec1...
15
by: Xarky | last post by:
Hi, Is it possible to make use of data files in C? If yes can someone tell how or suggest me a site from where I can learn them. Thanks in Advance for your patience.
7
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
3
by: masood.iqbal | last post by:
Hi, Kindly excuse my novice question. In all the literature on ifstream that I have seen, nowhere have I read what happens if you try to read a binary file using the ">>" operator. I ran into...
9
by: deepakvsoni | last post by:
are binary files portable?
17
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream>...
30
by: Jrdman | last post by:
hi there can any one write a C code that search for files in a directory without using the windows apis(FindFirstFile() and FindNextFile()) or even has a small idea on how to do that. thanks.
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.