611 Posted Topics
Re: [COLOR="Green"]Shodow14l be friendly ok?[/COLOR] | |
Re: [Code]s = "abc def ghi jkl" Print("\t".join(s.split())[/code] Or [CODE]print("Hello \t world")[/CODE] | |
Re: with better check with unique number. I think its not a good idea using enumerate function. Since enumearte repeates the number once new directory of files/ data in called. I use anydbm alot and i think the best way is to use a counter with a dict. Then you check … | |
Re: You must chmod cgi scripts to 0755. Cgi's only works with that permission. ok? :) | |
Re: but i dont see any prolem with binding a button to self. Infact i think its a good idea. Well not to start te holy war here but but that is my view [CODE] self.Bind(wx.EVT_BUTTON, self.OnSubmit, self.sendButton)[/CODE] have alot of advantages.... | |
Re: More user friendly :) [CODE] def prompt(acts): while True: print """ Please select one of the choices\n ==================================\n\n north\t south\n east\t west\n""" m = input("choice please: ") message = m.lower()[0] if message == "n": acts['north'] break elif message == "e": acts['east'] break elif message == "s": acts['south'] break elif message … | |
Re: or this.........[CODE] a = a= [(x+2,x*2) for x in range(1,300)] [/CODE] And plot some graph with it ;) | |
Re: You can import the wx module into you code. implemet the class of wx.grid. and call it into your Tkinter app. One thing you must be carefule is to destroy the wx.grid before you call the close/destroy else you will have a crash in your app. eg.....[CODE] def OnClose(self,event): self.grid.Destroy() … | |
Re: why dont you try pyqt forum my friend. :) | |
Re: Just save the path to the movie file into the database. Then you call the movie name from the data base by splitting the path. eg... [CODE]filename= pathtofile.split("/")[-1].split(".")[0][/CODE] Then you get the filename :) | |
Re: idle just got so many problems. Even on the linux box like ubuntu. You cant rely on idle gui. Thats a fact.! | |
Re: translate swedish to english using google translate and post that. ok? | |
Re: When lis pop. it removes the item from the stack. Take it like you got items ... [CODE] llist = [1,2,3,4,5,6,7,] llist.pop(3) ## removes : 4th item [/CODE] The pop means give out. So when you give out, you dont still have that. Like you cant eat your cake and … | |
Re: can you pls put your code into the code tags :) | |
Re: Nice one Gris. You are a teacher :) | |
Re: Here you are as you wanted buddy :) [CODE]import wx import os.path class MainWindow(wx.Frame): def __init__(self, filename='noname.txt'): super(MainWindow, self).__init__(None, size=(400,200)) self.filename = filename self.dirname = '.' self.CreateInteriorWindowComponents() self.CreateExteriorWindowComponents() self.prin=4004 def CreateInteriorWindowComponents(self): ''' Create "interior" window components. In this case it is just a simple multiline text control. ''' self.control = … | |
Re: You can also use re to remove all characters with the W flag. :) | |
Re: Gris you forgot about provideing the first word. [CODE]line[0][/CODE] Nice job mate :) | |
Re: mmmmmmmmmmmmm not bad. I jus dont see any real life need for this algo. besides There should be a better way than this. :) | |
Re: you will need pickle/anydb modules to save you words aginst a key. Thus for easy lookup. :) | |
Re: what module are you using? [CODE]self.request.get('path')[/CODE] means nothing | |
Re: [QUOTE]def on_paint(event): self.dc == wx.PaintDC(event.GetEventObject()) self.dc.SetPen(wx.Pen("BLACK", 4)) self.hangingman.Bind(wx.EVT_PAINT, on_paint)[/QUOTE] There error is this method you creadted is not part of the class without the keyword self. try this....... [CODE]def on_paint(self,event): self.dc == wx.PaintDC(event.GetEventObject()) self.dc.SetPen(wx.Pen("BLACK", 4)) self.hangingman.Bind(wx.EVT_PAINT, on_paint)[/CODE] And here you go ;) | |
Re: Pay attention to this and how its implemented please :) [CODE] element_list = ["H.jpg","He.jpg","Li.jpg"] for i in range(len(element_list)): image_id = int(i+1) image_current = wx.Image("/Applications/PeriodicTable/ButtonBitMap/%s" % element_list[i], wx.BITMAP_TYPE_ANY).ConvertToBitmap() current = wx.BitmapButton(self,id=image_id,bitmap=image_current,style=wx.BORDER_NONE) main.Add(current,1) self.Bind(wx.EVT_BUTTON,self.OnButtonClick,current) ## add thiss line def OnButtonClick(self,event): # And this is how you checked for the pressed button ButtonId=event.GetId() … | |
| |
Re: well but your code does not show where you defined 'MIMEMultipart()' but its implemented on line 30. | |
Re: This is even a basic one. Python can do almost everything you want to do. :) | |
Re: Well you can not just call your module and expect the imported modules to work right away. Say we got text.py which contains...[CODE] import socket, re, time import urllib.request, os, sys import pickle from RushFunctions impor [/CODE] to have any of the imported modules called from text.py, you must inherit … | |
Re: jsut provide the file path without the os.path.adspath call. ;) | |
Re: if i were you, i will just convert and use cpicle or anydb | |
Re: The syntax,algorithm and implementation are all diffrent. But the idea are the same. Just as we got different make of cars but they can all take you to your destination. The mechanics in the cars are somehow different but they works the same. You just have to understand how one … | |
Re: Here you go my friend :) [CODE] file1="".join('99 root S 5176 95 41.2 8.3 snmpd'.split()[5:6]) file2= "".join('99 root S 5176 95 1.0 8.3 snmpd'.split()[5:6]) print(float(file1)- float(file2)) ## output 40.2 [/CODE] Hope it helps. | |
Re: you need to add the sys path of pyqt to python 2.7 sys path . Because py2.6 syspath in not the same as 2.7 syspath.(syspath is where your python got its modules and other modules installed/saved) [CODE] import sys sys.path.append("pyqt path")## And you are set to jam! [/CODE] | |
Re: To have the values inside the tages ... you do this on line 31 [CODE] print paramkey.text [/CODE] Now using find all makes paramkey a list. Therefore you must iter. paramkey. [CODE] print([x.text for x in paramkey]) [/CODE] Hope you got the idea :) show your love.... | |
Re: [B]rscubelek[/B] strip() can save a lot when taking user inputs. Try and split() your user inputs and you have saved yourself 80% of worries. check this out.[CODE] foo=" hello" #1 foo="hello" #2 [/CODE] The 2 foos variables are not the sane from user inputs with the check of equality sign … | |
Re: Your error was very clear. the[CODE] os.stat("path to file")[/CODE] But you have only provided the file name. | |
Re: backslash is native to windows as forwardslash to linux/unix/bsd file path. if you want to write an app. for network , then your good choice shout be forwardslash. | |
Re: On my Ubuntu linux Box There is nothing wrong with your code. the underline is seen. add this line after line 24 [CODE]self.SetManubar(menuBar)[/CODE] [CODE]menuBar.Realize()[/CODE] after that. This help on windows ok. ;) | |
Re: There are 3 things going on with your script. 1. [B]a[/B] is global variable assigned the value of 10. 2. You function is a function that has a default value set. that is global a which got the value of 10. due to that [CODE]foo()[/CODE] will print the default value … | |
Re: why dont you just point him to python docs! [B] Dont give him a fish! show him how to catch one.[/B] You are not doing hime anygood. | |
Re: In python... you can even put the output of the entire app. into a variable. ;) | |
Re: You need a method/function that contain yield to yield the values. Yield will release memory after giving so there will not be any memory holding. eg..[CODE] yield d["home"]= d1.values() [/CODE] Spot on. ;) | |
Re: Very simple. You can inherit one class into another if you need its functionality. That is why we got import in python, #include<> in C,C++ , ...etc. Anytime you import.... You build your class with that module's class methods but they are not native to your class. That is without … | |
Re: on line 53.... you have wx.EXPAND flat set but you have not given the permission to expand. Change to this,,,,,,,,, [CODE]sizer.Add(myEditor, 1, wx.EXPAND)[/CODE] 1 is the proportion/permission. so change the 0 to 1 anywhere you want to expand. If you got more than one expand... Then you increase the proportion … | |
Re: yep snippsat. good job ;) | |
Re: what exactly do you want to calculate? can you be more specific? :) |
The End.