Re: How to run a python script with functions

2015-01-20 Thread faiz . lotfy
On Tuesday, January 20, 2015 at 3:22:55 PM UTC-6, André Roberge wrote:
> On Tuesday, 20 January 2015 17:11:58 UTC-4, faiz@gmail.com  wrote:
> > Hi
> > 
> > I have a file with a python scripts that has many functions in it. To run 
> > the script I did the following:
> > 1. $ python (to initiate python, using the python command)
> > 2. >>> import file_name (without .py)
> > 3. >>> file_name.function_name(argument) (to run the function_name with 
> > argument (argument)
> > 
> > My question is: Is there any other way that I can just use the function 
> > name (function_name) without having to use the file_name. part? That is, 
> > use only:
> > >>> function_name(argument)
> > 
> 
> from file_name import function1, function2
> 
> > ~faizlo

Thank you André
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to run a python script with functions

2015-01-20 Thread André Roberge
On Tuesday, 20 January 2015 17:11:58 UTC-4, faiz@gmail.com  wrote:
> Hi
> 
> I have a file with a python scripts that has many functions in it. To run the 
> script I did the following:
> 1. $ python (to initiate python, using the python command)
> 2. >>> import file_name (without .py)
> 3. >>> file_name.function_name(argument) (to run the function_name with 
> argument (argument)
> 
> My question is: Is there any other way that I can just use the function name 
> (function_name) without having to use the file_name. part? That is, use only:
> >>> function_name(argument)
> 

from file_name import function1, function2

> ~faizlo

-- 
https://mail.python.org/mailman/listinfo/python-list


How to run a python script with functions

2015-01-20 Thread faiz . lotfy
Hi

I have a file with a python scripts that has many functions in it. To run the 
script I did the following:
1. $ python (to initiate python, using the python command)
2. >>> import file_name (without .py)
3. >>> file_name.function_name(argument) (to run the function_name with 
argument (argument)

My question is: Is there any other way that I can just use the function name 
(function_name) without having to use the file_name. part? That is, use only:
>>> function_name(argument)

~faizlo
-- 
https://mail.python.org/mailman/listinfo/python-list