611 Posted Topics
Re: I dont see why you cant change that. You extended the wx.Frame class so you can overide methods and variables in your calss if you want. The only problem i see is your gridsizer not well coded hence breaks apart when expanded. ;) | |
Re: i will wait till you put your code in the code tag tomorrow before i comment. ;) | |
Re: well this is a way to atleast find a word and its position out. [CODE]from __future__ import print_function list= ["gene","fooo","spam","spat","foo","gene","geni","spilat"] print([(count,gene) for count,gene in enumerate(list)if gene=="gene"], end="") ##output [(0, 'gene'), (5, 'gene')] [/CODE] Hope it helps ;) | |
Re: This thread is off the hook. Is this about reordering a dict in order(sorting) or printing and finding some words and their locations + ordering them ???? ???? ;) | |
Re: i am going to install this graphics module now. ;) | |
Re: Call the function where needed to perform its duties. ;) | |
Re: And what is the data type of indata? | |
| |
Re: Sometimes binding 2 events need a skip() function. eg. [CODE] def more_proc(self,event): """do your stuff here and call the skip() after that.""" skip() ## needed so that the event fall through to another event [/CODE] Try including that. ;) | |
Re: gethostbyname / gethostbyaddress will always provide the main ip. That is if the sever is a shared hosting type. Why not simply provide the ip address you want to bind to? | |
Re: That shouldnt be hard. How exactly is your text formatted? can you shoe a copy of that? or is the same as what you got up there. [QUOTE]This code would loop through 60/2 data combination (1 combination = TEXT + BINARY DATA). What I tried, was to read the entire … | |
Re: Well get a pencil and a notebook. Always write down what you want your application to do and arreange them how they should work step by step. Is a good idea to understand what you want to do. Dont rush with big tasks. Design by divide and conquer. Meaning make … | |
Re: can you give more idea what your code is supposed to do? | |
Re: Novice20 just doesnt want to do or take advice. ;) | |
Re: Because gap is always greater than 1 so the if text never get executed. ;) | |
Re: Why not just provide text to every field what sort of inputs acceptable.... Won't that be more robust? ;) | |
Re: I think he ment printing image just like printing plain txt files. No you cant print image like that. Thay can be worked on and as Gribouillis stated. You can read in work on it, then save the image. Using PIL module or Image module will give you very interesting … | |
Re: I realy dont get what you want but i just optimised your code. Hope it helps[CODE] def getScores(totalScores, number): score = input('Enter their score: ') while score <=0 or score >=100: print'You must enter a number between 0 and 100' score = input('Enter a number between 0 and 100:') for … | |
Re: Start reading python ftp lib. Connect via ftp then you get access to the remote system. bingo ;) | |
Re: your paste came with line numbers. who wrote this class? repaste again well... ;) | |
Re: [B]or this[/B] [CODE]from __future__ import print_function products = ["YELLOW,SMALL,STRETCH,ADULT,T21fdsfdsfs", "YELLOW,SMALL,STRETCH,ADULT,Tdsfs", "YELLOW,SMALL,STRETCH,ADULT,TD"] print([this.split(",")[0:-1] for this in products],end="") ##output## [['YELLOW', 'SMALL', 'STRETCH', 'ADULT'], ['YELLOW', 'SMALL', 'STRETCH', 'ADULT'], ['YELLOW', 'SMALL', 'STRETCH', 'ADULT']] [/CODE] | |
Re: Just look for close thread button and use it to close the thread.;) | |
Re: Try this..... [CODE]import re WORDPERFECT="\x0a" with open(wordsearch,"rb")as word: buff=word.read()# You can also just read a small buffer to check. word.read(10) if re.search("^(\\x0a)$", buff,re.M ): print("Wordperfect registered") print(buff.find(WORDPERFECT))[/CODE] | |
Re: I dont know about Multiprocessing but i know that threading+socket will do this job without any issues at all. ;) | |
Re: just close the thread will you ? ;) | |
Re: Do you want to strip all spaces ??? This will join all the text together. New line is also counted as space so what are you realy looking for? ;) | |
Re: With image stuff. Try and refresh after update. This will show image nicely else the output of your image will differ from OS to OS and you dont need that do you ? :) | |
Re: There are several ways to achieve this. You can define enumration of colors. These color got id which are int. eg.[CODE] RED=200 BLUE=300 YELLOW=400 PINK=500 [/CODE] Then import random to rand the range from 200-500 by 100 (100,500,100) Then provide the result in the bind method to set the color … | |
Re: [B]Polanski[/B] rstrip()/strip() methods only strip well only on inputs. To make things simple. if you recieve input from the user, then use the r/strip(). You can not use the strip only mechanism to strip a text file which is already formatted. Also strip() methods will only strip the buffer provided. … | |
Re: well you can try this ok? GPL feel free to use it ;) [CODE] from __future__ import print_function import re with open("frisky.py","r") as file: real_value=[ re.sub('[_\W]*', "", value) for value in file] #I could make all one-liner but i thought you may want to extend on the code. wont you? … | |
Re: Tkinter not that matured for game. very limited.... | |
Re: I think you need a GUI script. That will be more handy. Writting a recursive script to recurse through your entire file system is not that good on resources. Think about it. ;) | |
Re: Hi, on #35 you provided a return statement. That is good but return will not print a value. you must either use a print there or use a print on #14 on the function. Mixing print and return can get confuse noob. optimise that part. ok ? ;) | |
Re: Use the style wx.TE_RIGHT ok? eg [CODE]wx.TextCtrl(self,-1,style=wx.TE_RIGHT)[/CODE] | |
Re: [B]Gribouillis updated[/B] Information like this will always need a callback into action. Therefore i thought of updating your script a little. [CODE] with open("logfile.txt","a+") as logfile: logfile.writelines(str(stdout_value)+"\n") # To get the newline. easy to work with that [/CODE] In the end. You can read-in your data for further manipulation if … | |
Re: [B]Favolas[/B] Try this ok.?? [CODE] sd=[] sd.append("b"*2) for x in range(3): sd.append("a"*5) sd.append("b"*4) df=sd[0:-1] df.append("b"*2) print(df) ## output ## ['bb', 'aaaaa', 'bbbb', 'aaaaa', 'bbbb', 'aaaaa', 'bb'] [/CODE] Hope it does work | |
Re: Improve over this script. This should work for you. [CODE]from __future__ import print_function words=["happy",'monty python',"hello","zombi","bone","monty"] def word(words): for x in words: if x.endswith('y'): #get the ends f=[y for y in x] #strip to list for easy slicing fex1=f[0:-1] #take the end away fex1.append("ier") # append your wish print("".join(fex1)) #convert to … | |
Re: Another easy way is formating as [B]woooee[/B] just stated. Here format so that your data show on line by line. So lets say you have the whole time stuff on line 5. You just replace all line 5 with your new time stamp. Always think about future and updates. Planing … | |
| |
Re: i Just voted for wxpython baby <-_-> ;) | |
Re: Do you want a consul script or GUI??? be specific plz ;) | |
Re: Well you can also place your loop in a function then use threading. With this you can manage the flow of your programme and CPU usage. use modules sys,os,thread and time together. Why am i saying this?... you can check with the CPU percentage or even give one core of … | |
Re: You need the API of the client eg. Yahoo or msn or google then you ceck if there is python wrapper to that. Start looking into the API of the client and google around for any python module to start from there :) | |
Re: try this [CODE]import time, a = 0 b = 0 FirstRun = True while 1: a = a + 1 #Adds one second if a > 59: #Accounts for minutes b = b + 1 a = a - 60 print("The current time is %d :%d"%( b ,a)) time.sleep(1) [/CODE] … | |
Re: There are several ways to achieve this. I will talk about 2 of them. 1. You can have a script to create a mail account on your server eg.like gmail,yahoo. The user get created account with the pop/smtp client once signed up. 2. You cant jest create a php/mysql backend … |
The End.