help!!

Z

z00z

Hello everyone, i'm working on a project and everything is going quiet
well.
ok when my code is like this everything works well
#/usr/bin/python
input = raw_input(">> ").replace(',','\n')
a=open("file","w")
a.write(input)
a.close()
import sys,os,time,subprocess,threading,readline,socket,ifc

but the problem is i have to import the libraries before the code so
my code should be like this
#/usr/bin/python
import sys,os,time,subprocess,threading,readline,socket,interfaces
input = raw_input(">> ").replace(',','\n')
a=open("file","w")
a.write(input)
a.close()

when i execute the above code no error message is given but no file is
written.

i think there is something with the module i'm adding (ifc) but i dont
know what it is.
cat anyone help??
thanks in advance
 
S

Steven D'Aprano

ok when my code is like this everything works well

#/usr/bin/python
input = raw_input(">> ").replace(',','\n')
a=open("file","w")
a.write(input)
a.close()
import sys,os,time,subprocess,threading,readline,socket,ifc


Your hash-bang line is broken, missing the exclamation mark.

What is "ifc" module?


but the problem is i have to import the libraries before the code so my
code should be like this

#/usr/bin/python
import sys,os,time,subprocess,threading,readline,socket,interfaces
input = raw_input(">> ").replace(',','\n')
a=open("file","w")
a.write(input)
a.close()

The hash-bang line is still broken, and the import ifc is replaced by
interfaces. What is interfaces?

when i execute the above code no error message is given but no file is
written.

Apart from not having the interfaces module, it works for me. Are you
sure that's the code you're actually running?
 
Z

z00z

Your hash-bang line is broken, missing the exclamation mark.

What is "ifc" module?



The hash-bang line is still broken, and the import ifc is replaced by
interfaces. What is interfaces?


Apart from not having the interfaces module, it works for me. Are you
sure that's the code you're actually running?
yeah sorry about that
interfaces is ifc and its a module (written by me) to detect the
network interface.
 
Z

z00z

Your hash-bang line is broken, missing the exclamation mark.

What is "ifc" module?



The hash-bang line is still broken, and the import ifc is replaced by
interfaces. What is interfaces?


Apart from not having the interfaces module, it works for me. Are you
sure that's the code you're actually running?

yeah i have some mistakes there sorry about that
ifc is interfaces and its a module (written by me) to detect network
interfaces.
but its ok now i sixed the problem
thanks for your response anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top