[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Testing if a File Exists
- To: "pygame-users@xxxxxxxx" <pygame-users@xxxxxxxx>
- Subject: [pygame] Testing if a File Exists
- From: "Ian Mallett" <geometrian@xxxxxxxxx>
- Date: Sun, 8 Jul 2007 18:50:03 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 08 Jul 2007 21:50:12 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=hlNy6o/PMP6DTWGxBAS536jlHhjOVpP7hoMKPzx37MwUlNIsA0ie1/TFwvwuxd5jsYaIs7UFOaDCJFfm/8SKJbU/y7MS95frRFl4c+gTRh4zkV+NS7h7fkHcsRyAv+bMsDfQ+DjZdyJhg8uxtnSxJdYVTEM8Mn3bGNIovFCDHi8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=df2P/J5er35H6M/QSVREBWSILAuI3yuFIpam0ShaF4Q9MI2hVOKKg57BL0bAxNic73QkPDOrttqcm9GQa59Y0nvLNnS9J0q5QBpVKsJ6Jkiym+1CeJKiOq4AAqnH4ueC57+7SKu/lf1zrKXUF+lAZDwYnYp53GoHgpur67xpg18=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
Exactly what it sounds like. Using pygame.image.load("[file]") will return an error if the file doesn't exist. How do you test if it exists without actually loading it, and without crashing? Thanks.
Ian