Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python: Sending a variable to another script

$ cat first.py second.py 
#first.py
def demo():
    some_list = []
    for i in 'string':
         some_list.append( i )
    return some_list

#second.py 
from first import demo

some_list = demo()
print some_list 

$python second.py
['s', 't', 'r', 'i', 'n', 'g']
Comment

PREVIOUS NEXT
Code Example
Python :: example python 
Python :: convert multidimentional numpy array to string and back 
Python :: substring in python 
Python :: List Get a Element-2 
Python :: selenium python login instagram 
Python :: what is a good django orm cookbook 
Python :: interval time specification 
Python :: How to make a script that reads from Database and then writes to the csv file and then uploads the file to Google Drive in python 
Python :: if the value is not in dict return default 
Python :: ascii value of pi symbol in python 
Python :: decorator patter 
Python :: add percentage sign to string python 
Python :: how to loop over all dates in python 
Python :: Python - Cómo cruda la cuerda 
Python :: how to search for element in list python 
Python :: merge_sort 
Python :: python star sign before list 
Python :: cx_freeze include images in specific path 
Python :: Kinesis Client get_records response json 
Python :: how to find projectile angle from distance python 
Python :: python union type 
Python :: date component 
Python :: Summarizing Data and description data in pandas 
Python :: how to play mp3 file form pygame module 
Python :: File "main.py", line 11 if message.author == client.user: ^ IndentationError: expected an indented block 
Python :: python zip function 
Python :: obspy stats 
Python :: pybind11 python37_d.dll access violation 
Python :: how to create dll from java code 
Python :: python allow null argument 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =