python

View on GitHub

“retrival is how you learn”

MY PYTHON DOCUMENTATION

Elankovan M. Gopal(elankovanmg@gmail.com).

This document has been auto-generated using writePythonNotes.py; inteded to serve as my quick reference.

Matlab Scripts - HOME

Shell Scripts - HOME

Java Scripts - HOME

CONTENTS

Tutorials


Basic Syntax
Class

File Name Function Comments
temp.py    
linkedList.py    
list_a.py    
while.py    
list_b.py    
Dictionaries.py    
operator.py    
print.py    
library.py    
class.py   ##example01##example02
userFunction.py   ##example1##example2##example3
binaryTree.py    

tutorials/trash

File Name Function Comments
operator_overloading.py    
reading_only_certain_portion_of_a_file.py    
Finally.py    
get_in_dict.py    
StringArray.py    
temp.py    
input_print.py    
reading_files_line_by_line.py    
key_is_in_dict.py    
RandInt.py    
class_methods.py    
1_print.py    
fucn_euqals_variable.py    
utri.py    
TryFinallyFiles.py    
read_and_display_contents_of_the_file.py    
writting_in_a_file.py    
GetInputDict.py    
IfStatement.py    
FuncIndex.py    
download.py    
Sets_fp_b.py    
DefFucntion.py    
classes.py    
find.py    
asort.py    
PureFunctions.py    
itertools_a.py    
Sets_c.py    
itertools_eg.py    
etry.py    
pana.py    
print_strings.py    
DataStructures_notes.py    
sample.py    
fact.py    
ForInList.py    
sim_calc.py    
lists_.py    
simple_networkx.py    
ListComprehensions.py    
magic_method_operator_overloading.py    
FileReread.py   print(‘##Reading…‘)print(‘##Re-reading…’)
PrintFileLineByLine.py    
FuncInpArg.py    
intro.py   ##multiple variable in one line
While.py    
list_comprehensions.py    
appendListFor.py    
list_func_insert.py    
list_reasignments.py    
binary.py    
reading_files.py    
working_with_files.py    
strip.py    
unknow_exception_handling.py    
push.py    
1_print_quo_rem.py    
simplefor.py    
dict.py    
matrix.py    
list_random.py   ##this is dictionary
spiral.py    
simpe_int.py    
KeyIsInDict.py    
end-sort.py    
Variables.py    
imprt_in_diff_name.py    
Rawip2List.py    
ListReassignment.py    
numpy_arrays_samp.py    
FunctionProgramming_quiz.py    
inheritance_d.py    
hello_world.py    
import_more_than_two_module.py    
StringOperation.py    
samp1.py    
simple_if.py    
ImportingModule.py    
ImpureFunctions.py    
com2spc.py    
MaxMin.py    
Itertools.py    
FuncAsFuncInput.py Print a word with an exclamation mark following it print word+’!’  
Recursion_b_clarify.py    
join_str.py    
Sorting.py    
DirectedGraph_basics.py    
def_func.py    
class_attributes.py    
remove3.py    
counter.py    
new.py    
WhileWithBreak.py    
dictioaries.py    
IndendationError.py    
WhileLoop.py    
Strings.py    
testcase.py    
uppertri.py    
list_func_append.py    
NamedFunction.py    
list_in_strings.py    
asg.py    
itertools_eg_clarify.py    
Sets_b.py    
many_exception_handling.py    
DirectedGraphInPython.py    
itertools_c.py    
math_plot.py    
float_to_int_type_conversion.py    
exception_andling.py    
Sets.py    
clipDuration.py    
string_operation.py    
FunctionEqualsVariable.py    
DictFunc.py    
yesorno.py    
SimplePrint.py    
import_module.py    
copynote.py    
dictionaries_adding_element.py    
opening_file_in_writemode_will_delete_its_content.py    
opening_and_closing_a_file.py    
Recursion_fib.py    
StoringString.py    
Dictionaries.py    
agumending_list_and_repeat_list.py    
Classes_attrib_error.py    
using_numpy.py    
NamedFunctionAndLambda.py    
SemiPrime.py    
listAndTuple.py    
oop_inheritance_c.py    
read.py    
printing_line_by_line_in_for_loop.py    
Sets_fp_a.py    
try_finally_while_working_with_files.py    
spcl.py    
concatenation.py    
test.py    
sumFirstN.py   ##— for loop —###— while loop —##
func_with_inp_arg.py    
inheritance_eg.py    
sort.py    
simple_calculator.py    
func_as_func_input.py Print a word with an exclamation mark following itself. print(word+”!”)  
listFileNames.py    
Func2Func.py    
func_to_a_func.py    
user_fun.py    
Float2Int.py    
file_rereading_will_return_nothing.py    
raise_exception.py    
print_no_of_length_of_strings_in_a_file.py    
btemp.py    
while_with_break.py    
mysym.py    
working_with_files_with_statement.py    
Lambdas.py    
OpenCloseFile.py    
inheritance_magic.py    
magic_methods_operator_over.py   ## Magic Methods
FuncAppend.py    
temp11.py    
secvowel.py    
pagerank.py    
list_func_index.py    
cheat.py    
ExceptionHandling.py    
OpeningText.py    
sortplay.py    
convert.py outputpath = os.path.splitext(inputpath)[0] + targetFormat  
test1.py    
string_formating.py    
while_loop.py    
int2str.py    
Array.py    
InputFromUser.py    
SimpleCalculator.py    
StringConcatenation.py    
Sets_fp.py    
1sort.py    
EndSortSoln.py    
buttons.py =======  
randi.py    
UnknowExceptionHandling.py    
list_func_max_min_count_rev.py    
StringFormatting.py    

Data Structures & Algorithms


Linked List

Research

File Name Function Comments
PlotDispCsv.py calculates the position and displacemnt and make animation ##to calculate the position of atoms in all frames## Plot your results## Writing to csv file
writePythonNotes.py Copies all the *.py file into *.md file with about information and comments; documentation purpose; Using this file i created “MY PYTHON DOCUMENTATION” about=about+next(fsrc) if ‘##’ in line: ## Writing to notes.md file; writng to a file## ref
PlotKeCsv.py plot ke vs position in csv file; ## to calculate the position, ke of atoms in all frames## PLOT YOUR RESULTS## Writing to csv file
exportfile_and_render_image.py this will read your dump and create last dump a seperate file and create animation. ## export_file(pipeline, “output.%i.dump” % i, frame=i)## uses the second argument as file ip
distance_bw_tow_particles_ovito.py This script calculates distance bw partices of given position; importing global attributes into a text file; ## dist bw position 0 and position 2## ref
makegifdisp.py prints the postion and displacement in .csv file ##to calculate the position, disp, eng of all atoms;## Writing to csv file
export_particular_intervals_frames.py Exports dump files into lmp files using ovitos;19-nov-19 ## change frame numbers here
export_any_dump.py converts dump files into lmp files using ovitos; can convert all dump frames or particular choosen frames; oct-19; ## specify the frame numbers
editMass.py Updated the mass of lmp file created from ovito python;oct-19 ## specify mass here
dos_calc.py Calculates density of states information from the velcity auto-corelation function from lammps simulation; june-20 ## sub plots using matplotlib## Writing to csv file## printing dos of atom A## printing dos of atom B## printing dos of GB interface
plotvar.py to know the list of properties availabe; to collect particular particle property; printing in csv; specify the particle id; ## to know all the lis of particle properties list(data_collection.particle_properties.keys())## Plot your results## to get the x component data alone give 0 for i; or 1 for y;2 for z in var_data[i][]## ploting…## Writing to csv file
pGrp.py calculates the position & displacement of all atoms in the dump file (for all frames) and prints a *.csv file;20-nov-19 ## to calculate the position of atoms in all frames # ## Writing to csv file
makeDis.py ovito python make displacemnt vs position plot;9-aug-19; ## to calculate the position of atoms in all frames## Writing to csv file
makeTE.py calculates the total energy of all the column of atoms in each dump frames ## to calculate the tot ene of all the columns of atoms in all frames## specify the particle properties an “c_eng” and “c_kin”## Writing to csv file
data_single_gpulse.py gaussiam function to identify the pulse information ## matplotlib library## mumpy library
disp_of_atoms_all_frame.py calculates the position and displacement of particular atom; specify the particle id;may-19 ##to calculate the position of atoms in all frames## Plot your results## to get the x data alone; put 1 or 2 for y or z in x_position[i][]## Writing to csv file
newPlotDisp.py Displacement of atoms wrt position; net displcements from x, y z components; oct-19 ## to calculate the position & equivalent disp of atoms in all frames
dump2lmp.py converts the dump file with N number of frames to N number of seperate lmp files; used for finding the GB Min Structure using anhealing technique; ## writing a text file from series of strings
analyse_gb_str.py this function analyses the grain boundary structure and calculates the grain boundary thickness, Gb atomic density, area, etc… ## Writing to csv file
export_particular_frames.py exports the dump data for particular frames using ovito python ## writing lmp file using ovitos
readLogFile_gbe.py reads the set of log files and extracts the GBE data from a particular line ## GBE; edit this line## Writing to csv file
PosDisp.py Plot the position vs disp; plot position vs c_eng ## to calculate the position of atoms in all frames ## this has the position data of particle_id x y z;access x[1][1]
readLogfiles.py this reads the logfile and extracts the value of the variable “PE” and prints the resutls in a seprate *.csv file; nov-19; ## reads the file line upto this string## Writing to csv file
waveAnim.py creates a wave animation from reading the dump file displacement data; prints the sequance of *.png images; aug-19 ##to calculate the position of atoms in all frames ## Writing to csv file
rendergbp_dump.py this will read your dump and create last dump a seperate file and create animation. Useing tachyonrenderer, openGBrenderer; using pileline object; feb-19; ## using object
TimeDispCsv.py time-vs-disp from dump file;30-aug-19 ## python inline arguments## Plot your resutls## Writing to csv file
v1plotdisp.py calculate the position of specific atoms in particular frame; displacement of one atom; particle data of one atom; ##ploting…
make_biDetails.py creates the input file to generate the bicrystal from atomsk package;specify the misorientation angle;22-nov-19 ## specify theta in inline argument
rename_atom_ids.py renames the atom id from the file “hexPlane30.lmp” with the sequance of atom ids as specified;nov-19; ## writing to a text file
rendergbp_lmp.py render the GB microstructure using ovito python; specify the slicde distance; viewing angle; normal plane; slice width;feb-19 ## using pipleline object## to get the sim cell dimensionspipeline.add_to_scene() ## updating pipeline
makegif.py Makes *.gif animation; ## to calculate the position of atoms in all frames## node data collection using node.compute## particle data extration ## this has the position data of particle_id x y z;access x[1][1]## Writing to csv file
ReadFromDump.py this will return a ‘.csv' which can loaded into matlab for ploting. use this *$PATH_Ovitos ReadFromDump.py 'file.dump' 'Position' 200* to run;returns col1 in number of timesteps only;may-19 ## getring ip from command line## reading data using ovitos## writing to csv file ## Add more columns to write
sliceLayer.py Using slice modifer of ovito using ovtio-python-interepreter  
makelmpscript.py Specify the pulse center, width and max amplitude ; this generated the lammps file;28-aug-19; ## Pulse data, p_center, p_width, a_max ## insert1: the group of atoms if ‘##—DefiningGroup—##’ in line:## NOTE: this cannot be linear; it should follow Gaussian curve ##insert2: timestep ##insert3: pulse width range

Projects

File Name Function Comments
style.py Using Natural Language tool kit library to identify the style of authors writting;  
writePythonNotes.py Copies all the *.py file into *.md file with about information and comments; documentation purpose; Using this file i created “MY PYTHON DOCUMENTATION”folder=”projects/” about=about+next(fsrc) if ‘##’ in line: ## Writing to notes.md file; writng to a file## ref
speech.py Converts speech into text using google speach2text api; used to convert my notes ## use the audio file as source only in .wav## reads the audio file## exception handling
netwrokx.py Using networkx library to plot nodes  
cleanDT.py Real Project; Reads the input.csv file; Prints the correstponding DT data into output.csv ## REFERENCE VALUES(EDIT) ; dictionaries

Problems

Index

Problem Topic Level
Increasing Order Search Tree Binary Search Tree 1