473,394 Members | 1,739 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.

error in importing a file in another file

i have a file name student which i want to import in modify file i have used
import student
and
student file has a lot of functions which i want to import
i have even used
from student import *
but in both cases i am getting an error
"no module name student"
Nov 28 '16 #1
2 1274
Zakoss
6
This is hacky and even dirty, and in my opinion the language shouldn't impose its way of loading files across the filesystem. In PHP we solved the problem by letting the userland code register multiple autoloading functions that are called when a namespace/class is missing.
Nov 28 '16 #2
dwblas
626 Expert 512MB
import searches the python path, so it can not find the file because it is in some other directory. To print the path, use the code below. You can also add the directory that the file is in to the python path so it searches that directory as well.
Expand|Select|Wrap|Line Numbers
  1. import sys
  2. print sys.path 
Nov 28 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Jeff Wagner | last post by:
I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function? Here is the code: ...
9
by: wordsender | last post by:
Hey guys, I can't figure this one out, why is this simple script giving me problems? logfile=file(r'test.txt','w') logfile.write('datetime') test=logfile.readlines() When I run it I get...
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...
0
by: James W | last post by:
I have a pc running Windows XP and Office XP. The problem is that I cannot import or link an Excel file in Access. When I try I get the error message "The wizard is unable to access information in...
3
by: Ney André de Mello Zunino | last post by:
Hello. I would appreciate if somebody could assist me with an error message I am getting from the Microsoft WinDbg 6.3 debugging tool. I am not familiar with it, since I have just downloaded it....
4
by: Amar | last post by:
I am trying to upload a file to the webserver through my asp.net application. The file upload works fine for files below 50 MB size because i have set the maxrequestlength property of the...
19
by: **Developer** | last post by:
When I get the image from the file the file remains locked so the Delete fails with a "used by another process" So I tried using a clone and disposing the obtained image. But that didn't fix...
2
by: jtembe | last post by:
Hi, When a need to import my dumpfile., -uuser -ppasswd -hlocalhost database < C:\dumpfile.mysql i have Error: UnKnow command '\b'. regards,
1
by: Anonymous | last post by:
I am having trouble compiling an ATL library. I get the above error, BUT the typelib file named in the error IS there. I have also checked the following (in the Properties Dialog Page: 1)....
2
by: Aaron Scott | last post by:
I've installed mod_python, and everything seems to be working, but it fails when I try to import another file into the file that's actually producing the output. I have these lines at the top of...
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:
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
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...

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.