0

I have a problem with creating a PDF with Reportlab from PySide GUI. Actually, I have to save a PDF with data of client (name, phone, etc) and i use his name and some data for path name. So, I get an Error 2 that No such file or directory exists. But when I run a test script without GUI, I have no problems. Please, help! The code is pretty basic.

class GUI(QWidget):
...
    def createPDF(self):
        #Here are some settings for PDF
        name = 'Alex Snow'
        date = '15/07/2018'
        c = canvas.Canvas(name+'_from_'+dat+'.pdf',pagesize=A4)
        #Other strings and images and tables
        ...
        c.save()

f = open(filename, "wb")
FileNotFoundError: [Errno 2] No such file or directory: 'Alex Snow_from_10/07/2018.pdf'
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Eloah
  • 15
  • 6
  • 2
    do not use "/", use "-", the first one is a folder separator. change `date = '15/07/2018'` to `date = '15-07-2018'`. the problem has nothing to do with the GUI. – eyllanesc Jul 23 '18 at 14:32
  • Oh, I see. Thanks a lot for your comment! Everything is workable now. – Eloah Jul 23 '18 at 17:12

0 Answers0