Stefano Mtangoo 455 Senior Poster

System Restore is the best option when you face such snags. Instead of tottally delete cut it and paste it somewhere. As per Caper Jack, if it is spyware, after delete system will complain that because it have registry entry of the file. Just in that case use revouninstaller's startup utility to delete the registry entry (Or Do it manually if you can) and reboot the machine.

NOTE: BEFORE THAT MAKE BACKUP OF REGISTRY USING EITHER ERRUNT OR ANY BACKUP UTILITY!!!

Quick-Study commented: Your info was very helpful because now I know more +1
Stefano Mtangoo 455 Senior Poster

I was in search for wx_IDs and one guy presented me with some code with for loop!
I modified a little bit and here is a code for simple preogram that will show all available built in wx.IDs

import wx

class Frame1(wx.Frame):
    def __init__ (self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(400, 400))
	self.text = wx.TextCtrl(self, -1, style = wx.TE_MULTILINE)
        
	x = dir(wx)

	for y in x:
	    if y.find('ID_')!=-1:
		search = y + "\n"
		self.text.write(search)
		

app = wx.App(False)
f = Frame1(None, -1, "wx.IDs")
f.Centre()
f.Show(True)
app.MainLoop()

Editor's note:
Careful when copying this code to your editor, it uses mixed spaces and tabs.

Stefano Mtangoo 455 Senior Poster

thank u to all

i'm still learning how everything works, and i'm still very much a newbe,..

If you feel annoyed by Tkinter, try others also!
I found myself in love with wxpython. Some have fallen in hands of pyQt, PyGTK etc. I mean when you start learning try as amny available as you can and then choose among them. Don't underestimate Tkinter, I don't mean it is uselless, No! It is great, but I mean as I said you may fall in hands of one of those

Just MHO
Steve

Stefano Mtangoo 455 Senior Poster

According to your response, it seems msxml3r.dll is corrupt and some of modules that are in in that dll are corrupt! by the way, have you googled and know what that DLL does?

Stefano Mtangoo 455 Senior Poster

It seems your DLL is corrupt!
You need to replace it

Stefano Mtangoo 455 Senior Poster

why don't you upgrade to 2.5? I'm curious if there is special feature or just you love it!

Stefano Mtangoo 455 Senior Poster

OK i WAS ABOUT TO SUGGEST RUN-->cmd THEN TYPE explore BUT YOU SAID HE DID SO. Here are my Question:
What about task bar?

Here is my suggestion:
Try using system restore to restore it to last worked config and then re-scan it using trusted AV

try and Feedback
Steve

Stefano Mtangoo 455 Senior Poster

I myself only got into Python about a year ago, after deciding to give up on Java and C++; luckily I found that Python is fast, easy, and most importantly, fun.

This one interested me! Why did you do that?

Stefano Mtangoo 455 Senior Poster

Boa constructor? Is project living? I thought the IDE is dead!
Anyway, Paul's advice is best. Just play around it and post any difficulty you get IMHO

Stefano Mtangoo 455 Senior Poster

Ok My 2Cents here:
Download and Install revo uninstaller, and It should help with uninstalling issues.

Install avast, register and enter key (All free)!
Run it,and right click, and schedule boot time scanning.

Then download and Install wise registry cleaner (free/pro if you have $ for it) and scan and fix invalid registry

then feedback us!

Stefano Mtangoo 455 Senior Poster

from what I know Notepad++ Is editor not IDE. I think you need to Go for something like Netbeans. Their next version will support python (For now it supports to some extent). It does more than that, maaany languages. Just check their main package and nbpython plugin!

Stefano Mtangoo 455 Senior Poster

Every day i learn py, I see it doing many things and from what I can see, it can do anything. Anyway i plan to do my massive code for my project sometime this year! For now there are some things I must learn!!

Happy Py Programming!

Stefano Mtangoo 455 Senior Poster

py2exe = Create executables
nsis or inno = create setups
Just google for and crawler for their home pages, download them learn them and use them!

If you need $ based go for installshield

Steve

Stefano Mtangoo 455 Senior Poster

Thanks

Stefano Mtangoo 455 Senior Poster

Like when you want to create class that will create simple dialog and then call it from GUI you have created:

import wx
    class Dialogi(wx.Dialog):
        ...........
Stefano Mtangoo 455 Senior Poster

Grib,
I'm too Jr. in py that I have no Idea of that module. For Now I try to familiarize with Wxpython while learning python extensively. May be some time later I will dig it. BTW what does it do in summary??

Stefano Mtangoo 455 Senior Poster

-- ---[code=python] ---

Stefano Mtangoo 455 Senior Poster

Howdy,
Okay, I'm brand new to DaniWeb, and new to programming myself.......... I apologize for the bad format of my coding, as I said, I'm rather new to this.

Welcome Andy!
Don't worry about being new, you learned to speak your language, right? You will learn Python too :)

Just use "

put your code here

" and you will come out with nice pycode!
Happy Pyprogramming!!
Steve

Stefano Mtangoo 455 Senior Poster

can you give a living example?
For me I don't understand what you are exactly saying! I don't want to redefine it

Stefano Mtangoo 455 Senior Poster

what I understand is, custom module you import in your python must be on the same directory as the script from which you are importing. Is that so in your case?WHAT ERROR(s) DO YOU GET?

Stefano Mtangoo 455 Senior Poster

I always use to copy url of video and paste it at <snipped illegal link> and then use free download manager to download it. For conversion, Super is the best I know. Go to freecodecs.com for the rest

Stefano Mtangoo 455 Senior Poster

Reformatted your code and did simple restructuring and some edits
See if that is what you want and post more queries
Steve

#determine shipping charges according to weight
print 'Welcome to Shipping Company Rate Calculator'
shipweight=input ('Please Enter the Weight of the Item You Wish To Ship: ')
def shipping_charges():
        if shipweight>=2:
                print 'Your total shipping charges: $2.10'
        
        elif  shipweight>2 or shipweight<6:
                        print 'Your total shipping charges: $3.20'
        
        elif shipweight>6 or shipweight<10:
                        print 'Your total shipping charges: $4.70'
        else:
                if shipweight>10:
                        print 'Your total shipping charges: $4.80'
                else:
                        print 'Your total shipping charges: $4.80'    
shipping_charges()
sneekula commented: good thinking! +4
Stefano Mtangoo 455 Senior Poster

Just have a look at example and tell me what is you exact question.

Stefano Mtangoo 455 Senior Poster
import wx
class CListBox(wx.Frame):
    def __init__ (self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(350, 450))
        
        #Add a panel as parent to widget
        panel = wx.Panel(self, -1)
        self.lst = ["Jesus", "Loves", "You!"]
        self.clbox = wx.CheckListBox(panel, -1,(0, 0), wx.DefaultSize, self.lst )
        self.mess = wx.StaticText(panel, -1, "Love of God")
        
        #Add to sizers
        vbox = wx.BoxSizer(wx.VERTICAL)
        vbox.Add(self.mess, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 20)
        vbox.Add(self.clbox, 0, wx.ALL, 10)        
        panel.SetSizer(vbox)
        panel.Layout()
        
        #Set up event handlers - set from widgets on special section for clarity
        #bind event to checklistbox
        self.Bind(wx.EVT_CHECKLISTBOX, self.OnChecked, id = self.clbox.GetId())
        
        
        
        
        self.Centre()
        self.Show(True)
        
        #Start event handlers
    def OnChecked(self, event):
        # Get Index of the checked item from List
        index = event.GetSelection() 
        # Get string corresponding to that item
        label = self.clbox.GetString(index) 
        
        #Use if to check whether the item is checked or not
        if self.clbox.IsChecked(index) : 
            status = "Checked"
        else:
            status = "Unchecked"     
        #Set message for dialog box
        message = "%s Option is %s" %(label, status)  
        # Dialog box for Alert
        dia = wx.MessageDialog(self,message , "Alert", style = wx.OK |wx.ICON_INFORMATION )
        ret = dia.ShowModal()
        if ret == wx.ID_YES :
            dia.Destroy()
    
        
app = wx.App(False)
#Instantiate class CListBox
CListBox(None, -1, "Simple List Box")
app.MainLoop()
Stefano Mtangoo 455 Senior Poster

If the event works to disable ListCtrl, then it fails to disable, I guess that might be due to no special reference. I mean that when you disable it you need reference to that item so as using that reference, you can enable it again.
BTW are you calling the method in the same class or from another class?

Stefano Mtangoo 455 Senior Poster

Don't forget to mark solved and don't forget to add Reputation: to Freaky_Chris
All after you are sure everything is solved

Stefano Mtangoo 455 Senior Poster

Hi Dinil,
I have tried to play around with your codes but here is what I found difficult:
Your GUI code is mixed up with Win32 Code and I'm less in Win32. My suggestions are: Separate your GUI from Win32 codes/methods and Leave pure wx.Python module related codes. That Will Make easy for me to work with that complex codes!

Here are simple Observation I have made before I hit the wall:
Note your Original Codes are commented out and I cannot Assure you of nything because I din't tested the code I was trying to rectify, Infact I didin't reach even the end due to mixture, so provide gui code and I will proceed

#Why Horizontal sizer while you have added one element?
         ##hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        ##hbox2.Add(self.staticText1, 0)
        ##vbox.Add(hbox2, 0,  wx.LEFT|wx.BOTTOM , 10)
        vbox.Add(self.staticText1, 0,  wx.LEFT|wx.BOTTOM , 10)
      
#Why Horizontal sizer while you have added one element?
        ##hbox3 = wx.BoxSizer(wx.HORIZONTAL)
        ##hbox3.Add(self.txtActionId, 1)
        ##vbox.Add(hbox3, 0, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
        vbox.Add(self.txtActionId, 0, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
 
#Why Horizontal sizer while you have added one element?     
        ##hbox5 = wx.BoxSizer(wx.HORIZONTAL)
        ##hbox5.Add(self.btnProceed, 0)
        ##vbox.Add(hbox5, 0, wx.ALIGN_CENTER|wx.BOTTOM, 10)
        vbox.Add(self.btnProceed, 0, wx.ALIGN_CENTER|wx.BOTTOM, 10)
   
#Why Horizontal sizer while you have added one element?     
        ##hbox4 = wx.BoxSizer(wx.HORIZONTAL)
        ##hbox4.Add(self.treeAction, 1, wx.EXPAND)
        ##vbox.Add(hbox4, 1, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
        vbox.Add(self.treeAction, 1, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
Stefano Mtangoo 455 Senior Poster

I'll Be back

Stefano Mtangoo 455 Senior Poster

To merge two partition, All you need is Gparted. It worked for me many times. I have no time to Link you (may be someone will do). Just Google Gparted, download image and burn on cd. Boot with it, There you Go!

Stefano Mtangoo 455 Senior Poster

Ok Dear Dinil,
I think the best way i can help is to post full code here so that I can rectify the problem and repost them. By doing so it will be easy for somebody to work with minimum thinking.

It took alot of time to figure out what are you trying to add and not many will devote in doing so. So IMHO, post full code then rectification must be easy; for I will copy and paste On my IDE and do some debugging and play around and come up with clean code pointing out errors

Any Question? Just post it, No Problem

Stefano Mtangoo 455 Senior Poster

Is Main a custom module or just inbuilt module? I think you have to check if it is custom and check how to import custom module if it is!

Don't think it will help alot for I have note trie d before

Steve

Stefano Mtangoo 455 Senior Poster

Ok, if that is the case, have muscle exercise in python programming here:
http://zetcode.com/wxpython

I believe you will enjoy that!

Steve

Stefano Mtangoo 455 Senior Poster

Consider my Questions and comments below:

b = 0
# why Both flex and Box sizers have same variable? IMO, they should have different variables! That's why I commented out flex sizer
hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
#hsizer1 = wx.FlexGridSizer(cols=1, hgap=5, vgap=5) 
#hsizer1.AddGrowableCol(0) 

# what do you want to do exactly with this ALIGNING CENTER? If align as center widget then make it second, in adding widgets to sizer instead of first!
hsizer1.Add(self.staticBitmap1, 0,wx.ALIGN_CENTER)

#you have said border to be 10 but border on what side? You should state something like wx.EXPAND | wx.LEFT to make 10px border from left or wx.ALL if, from all sides
hsizer1.Add(self.staticText1, 0,wx.EXPAND,10)
#Ibid.
hsizer1.Add(self.txtActionId, 0,wx.EXPAND,10)
# Still don't know what you are doing with align cebter flag
hsizer1.Add(self.btnProceed, 0,wx.ALIGN_CENTER,10)

hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
# if you need these two to have minimum width when exanded and the latter to be taking the rest of space put proportion = 0
hsizer2.Add(self.treeAction, 1,wx.EXPAND|wx.ALL,5) 
hsizer2.Add(self.customTree,1,wx.EXPAND | wx.ALIGN_LEFT,0)
# wx.ALL isn't necessary for by default border is 0 (IMO)
hsizer2.Add(self.chkLstBox, 1,wx.EXPAND | wx.ALL,0)

hsizer3 = wx.BoxSizer(wx.HORIZONTAL)

hsizer3.Add((130,0), 1) 
hsizer3.Add(self.btnNext) 
hsizer3.Add((130,10), 1) 
hsizer3.Add(self.btnExit1) 
hsizer3.Add((130,10), 1)


hsizer4 = wx.BoxSizer(wx.HORIZONTAL)
hsizer4.Add((100,20), 1) 
hsizer4.Add(self.btnPrev) 
hsizer4.Add((100,20), 1) 
hsizer4.Add(self.btnProcSel) 
hsizer4.Add((100,20), 1)

hsizer4.Add(self.btnOutput) 
hsizer4.Add((100,20),1)

hsizer4.Add(self.btnExit2) 
hsizer4.Add((100,20), 1)

### Prgress Bar####
hsizer5 = wx.BoxSizer(wx.HORIZONTAL)
hsizer5.Add(self.gauge1, 1,wx.EXPAND)
### Prgress Bar####


b = 5
vsizer2 = wx.BoxSizer(wx.VERTICAL)
vsizer2.Add(hsizer1, 0, wx.EXPAND | wx.ALL, b)
vsizer2.Add(hsizer2, 1, wx.EXPAND | wx.ALL, b)

vsizer2.Add(hsizer3, 0, wx.EXPAND | wx.ALL, b)

vsizer2.Add(hsizer4, 0, wx.EXPAND | wx.ALL, b)

vsizer2.Add(hsizer5, 0, wx.EXPAND | wx.ALL, b)

self.SetSizer(vsizer2)
#get the …
Stefano Mtangoo 455 Senior Poster

try border = 5

Stefano Mtangoo 455 Senior Poster

vsizer2.Add(hsizer2, 1, wx.EXPAND | wx.ALL, b)

Did you meant 6 or b?

Stefano Mtangoo 455 Senior Poster

Hello Dinil,
I think the problem might be with assigning the same variable to two sizers:

hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
hsizer2 = wx.FlexGridSizer(cols=1, hgap=5, vgap=5)

Remove The Flexible Sizer and leave Box Sizer an see what it does!

Steve

Stefano Mtangoo 455 Senior Poster

What do you exactly want to do?

Stefano Mtangoo 455 Senior Poster

I also suggest that you give tree a proportion of 0 and the list box 1 so that only list box will expand to fill whole space and the tree will just take optimum space

But IMO

Stefano Mtangoo 455 Senior Poster

I think Paul is right but cannot give 100% vote until I test it! If you post simple piece of code, it will be easy to play with code and re-post it modified; but if your codes are not closed source anyway!

Stefano Mtangoo 455 Senior Poster

I was doing exercises and came up with Idea to post something for very begginers. I'm not experienced in pythoning but I post as my contributing to my fellow programmers in Py! Any suggestion correction and Addition is highly appreciated.
Thanks alot
Steve.

NOTE: Don't forget to start new thread for Questions! Thanks for your understanding!

import wx
ID_EXIT = 12
class MainWindow(wx.Frame):
    def __init__ (self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        
        #Add simple menu with quit item only
        #define menubar and menu
        menubar = wx.MenuBar()
        # attach menubar to the frame
        self.SetMenuBar(menubar)
        #define menus
        filemenu = wx.Menu()
        #Append file menu to menubar
        menubar.Append(filemenu, "&File")
        # Append items    
        filemenu.Append(ID_EXIT, "&Exit", "Close Application")        
        #---You can add as many Menu and Its items as you want
        #-----------------------------------------
        # Define Event handlers
        #also you can bind event using any of the methods below; I prefer the latter
        #self.Bind(wx.EVT_MENU, self.OnExit, id = ID_EXIT)
        wx.EVT_MENU (self, ID_EXIT, self.OnExit)
        #Add a panel
        Panel = wx.Panel(self, -1)
        
        #Add status bar
        self.CreateStatusBar()
        # Add text to status bar
        self.SetStatusText("Press F1 for help")
        
        # Add all your widgets here
        #--------------------------------
        #Add text are with mutliline capability
        Text = wx.TextCtrl(Panel, -1, style= wx.TE_MULTILINE)
        #Text.SetValue("Type your text here!")
        # Add three buttons that need to be equal in size
        yes = wx.Button(Panel, -1, "Yes")
        no = wx.Button(Panel, -1, "No")
        cancel = wx.Button(Panel, -1, "Cancel")
        # After adding all widget stuffs, add them to sizers
        #declare sizers
        main = wx.BoxSizer(wx.VERTICAL)
        grid = wx.GridSizer(1, 3, 4, 4) # …
Stefano Mtangoo 455 Senior Poster

Try this best free book
www.diveintopython.org
also there is newbie tutorials at zetcode
www.zetcode.com

For IDE to use with
Netbeans IDE (www.netbeans.org) with Nbpython plugin (www.nbpython.dev.java.net)
or you can use eclipse(I think it is www.eclipse.org) with pydev plugin (search it at www.sourceforge.net)

or you can use Wing ide 101 VERSION
here at www.wingware.com

Simple editors/IDEs includes
IDLE --- comes with python
Pspad ----Just google it!

Ready to go! Enjoy!

Stefano Mtangoo 455 Senior Poster

Try Gpy2exe. It work for me
here it is
http://www.gpy2exe.tk/
Tell me how you see it!
Steve

lllllIllIlllI commented: Awesome software +1