以下はPythonコードの例です。
PyPDF2ライブラリを使用して2つのPDFファイルを結合し、最終的なPDFファイルの重みを表示するPythonコードの例です：

```
import PyPDF2 
# Open the first PDF file 
pdf1 = open("file1.pdf", "rb") 
pdf1reader = PyPDF2.PdfFileReader(pdf1) 

# Open the second PDF file 
pdf2 = open("file2.pdf", "rb") 
pdf2reader = PyPDF2.PdfFileReader(pdf2) 

# Create a new PDF file to hold the combined pages 
pdfwriter = PyPDF2.PdfFileWriter() 

# Add all the pages from the first PDF file for page in 
range(pdf1reader.numPages): pdfwriter.addPage(pdf1reader.getPage(page)) 
# Add all the pages from the second PDF file for page in
 range(pdf2reader.numPages): pdfwriter.addPage(pdf2reader.getPage(page)) 
# Save the combined PDF file with 
open("combined.pdf", "wb") as output: pdfwriter.write(output) 
# Close the PDF files 
pdf1.close() pdf2.close() 
# Get the size of the combined PDF file 
size = output.tell()
 # Print the weight of the final PDF file in bytes 
print(f"The weight of the combined PDF file is {size} bytes.") 
```

注意: このコードを実行する前に、システムにPyPDF2がインストールされていることを確認してください。インストールされていない場合は、pip install PyPDF2を実行してインストールしてください。
Here is an example of Python code that uses the 
PyPDF2 library to join two PDF files and print the weight of the final PDF file: 

import PyPDF2 
# Open the first PDF file 
pdf1 = open("file1.pdf", "rb") 
pdf1reader = PyPDF2.PdfFileReader(pdf1) 

# Open the second PDF file 
pdf2 = open("file2.pdf", "rb") 
pdf2reader = PyPDF2.PdfFileReader(pdf2) 

# Create a new PDF file to hold the combined pages 
pdfwriter = PyPDF2.PdfFileWriter() 

# Add all the pages from the first PDF file for page in 
range(pdf1reader.numPages): pdfwriter.addPage(pdf1reader.getPage(page)) 
# Add all the pages from the second PDF file for page in
 range(pdf2reader.numPages): pdfwriter.addPage(pdf2reader.getPage(page)) 
# Save the combined PDF file with 
open("combined.pdf", "wb") as output: pdfwriter.write(output) 
# Close the PDF files 
pdf1.close() pdf2.close() 
# Get the size of the combined PDF file 
size = output.tell()
 # Print the weight of the final PDF file in bytes 
print(f"The weight of the combined PDF file is {size} bytes.") 

Note: Make sure you have PyPDF2 installed in your system before running this code. If not, install it by running pip install PyPDF2.