Skip to content

Tag: python-3.x

Writing a text file, using parts of other text files

I need to figure out something that is confusing me, hope someone can help. I have two text files with different information (these actually input files to run on Abaqus, but let’s call them .txt) MAIN.txt and SUB.txt I guess it is obvious what I want to do, write a script that creates a NEWFILE.txt whi…

Python Group Repeated Values in List in a Sublist

I need to append some repeated values from a list into a sublist, let me explain with an example: I have a variable called array that contains strings of uppercase letters and $ symbols. My end goal is to have this array: As in the example, I need to group all $ symbols that are togheter into sublist in the