611 Posted Topics

Member Avatar for ub007
Member Avatar for shiningstar100

[Code]s = "abc def ghi jkl" Print("\t".join(s.split())[/code] Or [CODE]print("Hello \t world")[/CODE]

Member Avatar for richieking
0
80
Member Avatar for jordan0420

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 …

Member Avatar for jordan0420
0
159
Member Avatar for dos_killer
Re: cgi

You must chmod cgi scripts to 0755. Cgi's only works with that permission. ok? :)

Member Avatar for richieking
0
278
Member Avatar for Dane2259
Member Avatar for dythanor

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....

Member Avatar for dythanor
0
471
Member Avatar for Geemon

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 …

Member Avatar for griswolf
0
209
Member Avatar for ramesh125

or this.........[CODE] a = a= [(x+2,x*2) for x in range(1,300)] [/CODE] And plot some graph with it ;)

Member Avatar for TrustyTony
0
175
Member Avatar for hogdogjr

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() …

Member Avatar for richieking
0
218
Member Avatar for blenkhn
Member Avatar for jordan0420

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 :)

Member Avatar for jordan0420
0
914
Member Avatar for scru

idle just got so many problems. Even on the linux box like ubuntu. You cant rely on idle gui. Thats a fact.!

Member Avatar for richieking
0
235
Member Avatar for suri94
Member Avatar for richieking
0
92
Member Avatar for razax

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 …

Member Avatar for razax
0
217
Member Avatar for ytrewq1
Member Avatar for gunneronaspooky
Member Avatar for rebo544
Member Avatar for sohel807

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 = …

Member Avatar for richieking
0
424
Member Avatar for pythonn00b
Member Avatar for aint
Member Avatar for aint
0
135
Member Avatar for jamd200

mmmmmmmmmmmmm not bad. I jus dont see any real life need for this algo. besides There should be a better way than this. :)

Member Avatar for jamd200
0
346
Member Avatar for kitjo
Member Avatar for benqb

what module are you using? [CODE]self.request.get('path')[/CODE] means nothing

Member Avatar for GDICommander
0
228
Member Avatar for owilliam

[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 ;)

Member Avatar for richieking
0
107
Member Avatar for owilliam

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() …

Member Avatar for richieking
0
98
Member Avatar for ShadyTyrant
Member Avatar for lewashby
Member Avatar for mbox_96

well but your code does not show where you defined 'MIMEMultipart()' but its implemented on line 30.

Member Avatar for mbox_96
0
4K
Member Avatar for -ordi-

This is even a basic one. Python can do almost everything you want to do. :)

Member Avatar for richieking
0
175
Member Avatar for zizuno

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 …

Member Avatar for zizuno
0
175
Member Avatar for rhuffman8
Member Avatar for iwanttolearnc
Member Avatar for Ashena
Member Avatar for Ashena
0
413
Member Avatar for vbx_wx

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 …

Member Avatar for bumsfeld
0
74
Member Avatar for rssk

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.

Member Avatar for snippsat
0
193
Member Avatar for Tommymac501

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]

Member Avatar for Tommymac501
0
2K
Member Avatar for meensatwork

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....

Member Avatar for richieking
0
213
Member Avatar for rscubelek

[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 …

Member Avatar for rscubelek
0
597
Member Avatar for danholding

Your error was very clear. the[CODE] os.stat("path to file")[/CODE] But you have only provided the file name.

Member Avatar for griswolf
0
384
Member Avatar for rhuffman8

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.

Member Avatar for richieking
0
403
Member Avatar for sohel807

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. ;)

Member Avatar for richieking
0
281
Member Avatar for vbx_wx

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 …

Member Avatar for vbx_wx
0
102
Member Avatar for Boubakr

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.

Member Avatar for -ordi-
0
92
Member Avatar for Brickmack
Member Avatar for richieking
0
173
Member Avatar for mossa

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. ;)

Member Avatar for richieking
0
287
Member Avatar for iwanttolearnc

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 …

Member Avatar for iwanttolearnc
0
173
Member Avatar for felix001
Member Avatar for ShadyTyrant

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 …

Member Avatar for ShadyTyrant
0
473
Member Avatar for ilikepaste
Member Avatar for rssk
Member Avatar for rssk
0
120

The End.