The major difference between attachmentsattachments and enclosuresenclosures in traditional media is really as slight as a staple or other mechanism of close placement physically binding the two documents together, and the terms tell the reader of the main document where to find the mentioned additional article. EnclosedEnclosed tells me to look in the envelope, where attachmentattachment tells me to expect it to be bound to the main document.
What you describe is probably best termed enclosureenclosure if you are handing in a package containing a disk or jump drive, or attachmentattachment if it is printed source code stapled to the document.