0

I am trying to use QLineEdit on PyQt5 to take user input and create an array. The user input is a list of integers.

ie. [0,1,2,3]

I want to be able to read the list of integers as an array of numbers in Python. This array will be used as the x values for a plot.

Is there a way to do this?

With my current code, I get a list of strings:

        Input = QLineEdit(self.window)
        self.window.tab2.layout.addWidget(Input,1,1)
        
        Concs=[]
        def data(self):
            Val = (Input.text())   #int(Input.text())
            Concs.append(Val)
            print(Concs)
            print(Val)
eyllanesc
  • 190,383
  • 15
  • 87
  • 142
Siba
  • 5
  • 3
  • It must be clear that the input is not a python list but a string that represents a list so that string has to be parsed as shown by the solutions of the post that I indicate as duplicate – eyllanesc Oct 04 '20 at 20:47

0 Answers0