473,672 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

origin of error message

hi
i was trying to create an image using user selection of a file in tix
fileselection box ..and i check for exception like below
<start of code snippet>
....
from string import split
from os.path import basename

....
#this is done inside __init__method
self.imgsel=Fil eSelectBox(self .imgSelectFrame )
....

def button1Click(se lf):
starttime=datet ime.now()
self.okButton.c onfigure(state= DISABLED)

#will clear canvas
self.canvorig.d elete(ALL)
self.canvresult .delete(ALL)
self.resultdisp lay.delete(ALL)

#image file selection by tix widget
self.cursel=sel f.imgsel.select ion.cget("value ")
print "self.cursel:", self.cursel
self.imgsel.sel ection.selectio n_clear()
#here i want to check if anything is selected by user
if self.cursel:
ext=split(basen ame(self.cursel ),'.')[1]
print "image extn:",ext
try:

self.selimg=Ima geTk.PhotoImage (file=self.curs el)
except Exception,inst:
print "xceptn::",inst .message
self.showresult (inst.message," red")
else:

self.selimgtag= self.canvorig.c reate_image(70, 100,image=self. selimg)
self.canvorig.u pdate_idletasks ()

.....
# some other tasks done
.....

else:
#no file was selected by user
print "self.cursel=", self.cursel
self.showresult ("nothing selected","red" )

self.okButton.c onfigure(state= NORMAL)
endtime=datetim e.now()
print "total time:", endtime-starttime,"seco nds"

<end of code snippet>
user is supposed to select an image to be displayed.
when i select some file with a non compatible extension (say .zip)
i get the following output
>>>>
self.cursel: F:/docs/python/gui3.zip
image extn: zip
xceptn:: cannot identify image file
total time: 0:00:00.341000 seconds
Exception exceptions.Attr ibuteError: "PhotoImage instance has no
attribute '_Pho
toImage__photo' " in <bound method PhotoImage.__de l__ of
<ImageTk.PhotoI mage inst
ance at 0x00DA4F08>igno red
My belief was that the message
'total time: 0:00:00.341000 seconds '
should have been the last output message .I don't know where the
Exception exceptions.Attr ibuteError: etc comes from. Already i am
catching the exception when creating PhotoImage .The message 'xceptn::
cannot identify image file' comes from there

Can someone help me find how this error msg happens

gordon
Jul 4 '08 #1
0 793

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2209
by: Randy Webb | last post by:
Is the HTTPRequest Object in IE limited to the Same Origin Policy when run from a webserver? <URL: http://www.hikksworld.com/HTTPRequestIE.html /> When run in IE, throws a "Permission Denied" error. When I run that page locally, it works without errors. Which leads me to believe that its Same Origin Policy coming in, since I can give it www.hikksworld.com instead of www.google.com and it works from the server. Or, is it just something...
1
1433
by: charles | last post by:
when i read the notable book of inside the c++ bject model ,i was confused by the chapter 3.3. i was confused by the statement as follow: chaper 3.3: Given the following pair of program statements: Point3d origin; .....Access of a nonstatic data member requires the addition of the beginningaddress of the class object with the offset location of the data member.For example, givenorigin._y = 0.0; the address of&origin._y; is equivalent...
1
1703
by: johannblake | last post by:
I want to create a scrollable window using GDI+ where the origin is located in the bottom-left corner rather than the default top-left corner. Currently I have found several examples on how to scroll the window and even how to set the drawing origin at the bottom-left corner. What I have not been able to accomplish is doing both of these simultaneously. I cannot find any code examples that show how this is done. When I attempt it,...
2
1781
by: Hugh Welford | last post by:
Hi, My site is being invaded by AFRICA SPAMMERS mostly from Ivory Coast ( according to my stats program) using USA or UK credentials (zip codes etc) to fool the registration monitor. Is there any way that I can grab the IP address as soon as someone lands on the site and determine the country of origin? Since I am only interersted in USA or UK origin visitors this would be a convenient way of preventing them get on the site at all.
4
3700
by: Turko | last post by:
Hi all. I m searching for the equivalent of : try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("Permission UniversalXPConnect denied."); }
3
1624
by: Kürþat | last post by:
Hi, Is it possible to know whether a keyboard message is generated by a phisical key press or an application. If possible, how? Thanks in advance.
1
6741
by: muskaran | last post by:
I am facing 'Cross Domain Security' within Frame.Its the 'Same Origin Policy ' issue. I have a frame which adjusts its height according to the height of the document.This works fine for all types of document. However if the document from different domain is loaded in the frame the code fails to calculate the height or access any property of that document owing to the simple reason that document belongs to different domain. And...
0
1097
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm trying to create a visual aid program to mimic a VIPP layout. In VB.NET the screen origin (0,0) is the top left hand corner of the screen. Is there a way to reset the origin to the bottom left hand corner? What I would like to do is place a frame on the form. The frame will represent the "Paper" and the paper's origin will be at the bottom left hand corner (0,0). I will help resetting the origin inside the frame also. -- Mark
0
1236
by: rohit1979 | last post by:
Hi, I have shifted the origin of a picturebox and changed its extents using the following statements: Call SetViewportOrgEx(PictureBox1.hDC,100, ViewExtY-100, ViewOrgOld) Call SetMapMode(PictureBox1.hDC, MM_ANISOTROPIC) Call SetWindowExtEx(PictureBox1.hDC, WinExtX, WinExtY, WinExtOld) Call SetViewportExtEx(PictureBox1.hDC, ViewExtX, -ViewExtY, ViewExtOld) where,
0
8503
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8944
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8640
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6254
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4239
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2836
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1835
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.