redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Saturday 17 November 2018 13:36

Ask your IT question here

Help with importing functions from another file



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Python programming forum
View previous topic :: View next topic  
Author Message
Aurora
New Programmer


Joined: 08 Nov 2009
Posts: 1
Hello,
I need help on importing functions so they can be used in a different file. For example, if I have a file A, that looks something like this:

Code:
def return_something(text, list_of_text):

if text in list_of_text:
   if text = 'Yes':
      print 'True'
   else:
      print 'False'
else:
   print 'None'



And in another file B, I'll request user input through raw_input, and use the function "return_something" from A to process the text in B, so either "True" or "False" is printed in file B, how do I do that? "return_something" needs two parameters, but in file B all I want the user to do is input one string, and the program analyzes that string with the list_of_text in file A, processes it with the if/print statements, then display the result back in file B.

Thanks!

Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Python programming forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo