473,394 Members | 1,766 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,394 software developers and data experts.

Include File?

Hi
i am a totally python newcomer. Can i use
include files within python?

(like for example: include <xxx.py>)

Thanks for help in advance
Werner Hofer
Jul 18 '05 #1
4 50487
Whofer wrote:
i am a totally python newcomer. Can i use
include files within python?

(like for example: include <xxx.py>)

The python equivalent is

import xxx

#use it, assuming the doSomething() function is defined in module xxx:
xxx.doSomething()

If you already know a programming language, the tutorial that comes with the
python distribution is a good starting point to learn the language.
Good luck!

Peter
Jul 18 '05 #2
Whofer wrote:

i am a totally python newcomer. Can i use
include files within python?

(like for example: include <xxx.py>)


Have you gone through the several tutorials and web pages for newcomers?

Questions like this should be adequately covered in them, so it would
be surprising if you've read them yet still don't know about "import".

-Peter
Jul 18 '05 #3
Cam
I am not so new and I still dont know if its possible.
I 2nd that question.

Whofer wrote:
Hi
i am a totally python newcomer. Can i use
include files within python?

(like for example: include <xxx.py>)

Thanks for help in advance
Werner Hofer


Jul 18 '05 #4
Cam <no**********************@pacific.net.au> writes:
I am not so new and I still dont know if its possible.
I 2nd that question.

Whofer wrote:
Hi
i am a totally python newcomer. Can i use
include files within python?
(like for example: include <xxx.py>)
Thanks for help in advance
Werner Hofer


There is no raw-file include (as in C's cpp) in the Python language.
(Of course, you could use #include and run cpp on the file
before passing it to Python.)

The Pythonic way to do this is "import". Unlike cpp, the imported
file must be a valid python module in its own right, though it can be
pretty simplistic. E.g., you could just define a list.

--
ha************@boeing.com
6-6M31 Knowledge Management
Phone: (425) 342-5601
Jul 18 '05 #5

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

Similar topics

3
by: middletree | last post by:
I have a page which, according to the boss's instructions, needs to show one of two things, based on which radio button was chosen on the previous page. Because these 'things' are actually some...
7
by: Vojma | last post by:
I have a problem At my site I have designed a framework with tabs as below (tabs_1.asp) +----+ +------+ +-------+ | MC | | Cars | | Boats | + +------------------------- then, into...
9
by: JR | last post by:
Hi, I'm migrating my website to an IIS 6.0 server and all the asp pages work fine except for the ones that reference include files, even though I have "Enable parent paths" enabled in the...
6
by: qaz | last post by:
I run a web site on both a testing server and a "production" server. I noticed that references to the include file do not work on the testing server but they do work on the production server. I...
9
by: Sarath | last post by:
I am working with an application using ASP, getting below error when i am trying to include new asp include file. _____________________________________________________________________ Microsoft...
10
by: Toke H?iland-J?rgensen | last post by:
Hello. I am quite new to the c++ language, and am still trying to learn it. I recently discovered how using include files would allow me to split up my code into smaller segments, instead of having...
10
by: vunet.us | last post by:
What is the workaround of passign a parameter to any included asp file: <!-- #Include File="file.asp" --> This obviously does not work: <!-- #Include File="file.asp?id=123" --> Thank you
1
by: armando | last post by:
Hi, I'm working on a web site devolepped in asp and this site work with the incusion in the page asp <td id="Colonna lato sinistro" width="200px" valign="top" style="height: 19px"> <!--#include...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
10
by: Raheem | last post by:
Hello, I built a development version of a live website on my hosted account. However the development version is having problems with finding include files. After troubleshooting I was able to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.