611 Posted Topics
| |
Re: MAy be converting the c++ script to python wont be that easy. I just tried and i think is insane idea. whops! Look why not write a python script to implement the same functionalities. May be the interfaces of this C++ will not be the same but at least will … | |
Re: I like one-liners but jureslak one-liner for third pseudo is not good for readability and maintainance :) | |
Re: what a nice piece of article tony. you got talent my friend :) . | |
Re: nice one. list comprehension gives python the style and beauty with smooth power to do great tasks easy. | |
Re: Check this out. 1. You will need 2 frame for that. or 1 dialog box and a frame. Its your choice. 2. overide the wx.App() and in the oninit method, call the dialog box/frame. 3. Dialog box/frame must be a main frame. Once the check is ok..., the the dialog … | |
Re: Grib. SlowFile.readline was not called therefore the delay will not work. it should be like...... [CODE] def main(): ftp = FTP(HOST, USER, PASSWD) try: name = "foo.txt" src = SlowFile(name, "r", delay = 0.2) ftp.storlines("STOR " + name, src.readline()) # this part.... finally: ftp.quit() if __name__ == "__main__": main() [/CODE] | |
Re: Hello. 1. Can you explain yourself very well about your ie6 and what you want to achieve. 2.Python got a webbrowser module. Just import and use. This will use your native default browser on your system. | |
Re: Try this [CODE] >>> print "\n".join([x for x in "dog,cat,bird,good,bad,blah,blah,blah".split(",")]) dog cat bird good bad blah blah blah >>> [/CODE] | |
Re: should be the first one. but it does not really matters. It all depends on your data. | |
Re: what a teacher your are Snippsat. impressed! | |
Re: The bases of inheritance makes it clear .... that is if you inherit from a class you will have its methods into you new derived class. But and only but ....! you will not be able to genericaly call those methods in the parent class if you have the same … | |
Re: try simplify the logic and what you want to achieve. This could be done in well optimised way. | |
Re: And also try and look into switch statement ok? Its more robust and easy to use. Besides its more easy to extend and debug. ;) | |
Re: That mean you got a logic error. check your while and if loops well. | |
Re: [QUOTE=South;1536528]For some reason it just jumps to the else statement instead of going to if and elif. Any input would really be apreciated. [CODE]a=raw_input( "What is your name: ") b= int(raw_input( "What year were you born: ")) c= int(raw_input( "What year is it now: ")) print "Hello",a,"you are",c-b,"years old." class … | |
Re: Go here[URL="http://www.blog.pythonlibrary.org/2011/01/04/wxpython-wx-listctrl-tips-and-tricks/"]http://www.blog.pythonlibrary.org/2011/01/04/wxpython-wx-listctrl-tips-and-tricks/[/URL] | |
Re: I dont really like idle. Python is a great language but idle is like ????? pydev or geany will do. try them out. Also to you [B]Twisted velocity[/B] , Try and simplify what you want to do. Always think abut the easiest way in solving a problem. | |
Re: yea check line 36 of your code. what are trying to achieve? Btw on *nix platforms cd~ will take you to the user dir. Why do you need double cd~/~????. try that with only one cd~ ok? cheers | |
Re: wx the best of all. lets start the Gui wars ! | |
Re: Google for pyaudio. Also if you want a linux native app, there are other libs for banshe,audacious, in pytyon that you can use then it will use their audio engine respectively. | |
Re: That is a piece of logic here. 1. You create your app 2. You create another script to execute if the time for purchasing your app has reached. that is.................. [CODE] if time > time_to_reg: destroyapp() [/CODE] The you have the method destroyapp() coded to remove the files and other … | |
Re: [CODE]print(["/".join(date.split("-"))])[/CODE] 2011/03/03 from my htc phone ;) | |
Re: Or this snippet .;) [CODE]while range(9) in guess: break[/CODE] | |
Re: Also why not create noneZero object .?? Well its a matter of design. | |
Re: or [CODE]print(int(i)+1))[/CODE] | |
Re: [CODE]protein="GWEIQPYVWDECYRVFYEQLNEEHKKIFKGIFDCIRDNSAPNLATLVRVTTNHFTHEQAMMDAVKFSEVLPHKKMHRDFLEKLGGLSAPVDNHIKGTDFKYKGKAKNVDYCKEWLVL" pp="LLCCCCCCCCCCCCCCCCCCHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHCCCCHHHHHHHCLLLCCCCCHHHHHHHHHHHHHHHHHHHCCCCCCCCCCCHHHHHHHHHHHHCCL" gor="cccccccccccchhhhhhhhhhhhhhhhhhhhhhhccccccccceeeeecccccchhhhhhhhhhhcccchhhhhhhhhhhhhccccccccccccccccccccccceeceeccceec" aber="CCCCCCCCCCCCHHHHHHHCCHHHCHHHHHHHHHHCCCCHHHHHHHHHHHCCCCCCHHHHHHHCCCCCCCHCCHHHHHHHHHHCCCCCCCCCCCCCCCCCCCCCCCCCHHHHHHHCC" for i in range(len(protein)): print i+1,protein[i], pp[i], gor[i], aber[i] ,"\n" [/CODE] This wil give you one check on each line. If you want the result to be what you have pasted up there, then your code is entirely wrong. | |
Re: put your code in the tags ok.?? once you do, i will help | |
Re: if its in console, Then you just get the user input and check the value. Then instruct your system based on that choice. | |
Re: Do you have any error msgs? please post them | |
Re: Always do a logical known check first [CODE]trainingDays = trainingData.getMeasurements() for i in range(pDaysRange,32): for day in trainingDays: if day[i].condition == "Fog": prevDaysF += 0.5 if day[i].condition == "Snow": prevDaysS += 0.5 if day[i].condition == "Rain": prevDaysR += 0.5 if day[i].condition == "None": prevDaysN += 0.5 print prevDaysF[/CODE] | |
Re: [QUOTE=tonyjv;1511709]Or [CODE]tosearch ='my text' try: print(next(line for line in open('myfile.txt') if tosearch.lower() in line.lower())) except StopIteration: print('Text %r not found in file' % tosearch) [/CODE] If you prefer clean code ;)[/QUOTE] tony did you try your code.??? Next come with a yield iter and calling next without any import or … | |
Re: 1.Make a list of your vowels. 2.Read the text file 3. Read character per character 4.Check if the char is in the vowels. Job done :) | |
Re: CSV is better with a dict, I wrote some script here in daniweb. search for it. The dict with incremental keys that will help with your rows and columns. | |
Re: try this [CODE] void rec(int &right,int&left){ for(int x =0;x<right;x++){ for(int i=0;i<left;i++){ cout <<"*"; } cout <<"*\n"; } } int main(){ int l=10,r=20; rec(l,r); return 0; } [/CODE] | |
Re: [B]ahappysadface[/B] can you help yourself so that we can help you ok? | |
Re: try const with the types [CODE]int game(const string &soFar, const string &THE_WORD, const int &MAX_WRONG,const int &wrong,const string &used);[/CODE] You have mixed them up. const variable into a non const method values. | |
Re: you do you intend to do?? any plans? | |
Re: [CODE] for((word = wordlist[-2]) in ['ar','er',ir']): print word [/CODE] | |
Re: well then he can try and except the error gracefuly cant he? | |
Re: can you tell me why you inported sys module??? also break help here...[CODE] while True: words = text.lower().split() for word in words: word_count = len(word) word_list.append(word_count) break; print word_count,word_list [/CODE] | |
Re: item.GetParent() will do ok? | |
Re: [B][COLOR="Green"]parijat24[/COLOR][/B] You just need to look into sets very well. set can work on tuples and list but cant mix them . The data must be one thus a list or a tuple. Set checks the data type also. | |
Re: just append your data; [CODE]testingdays = testingData.getMeasurements() dayValues = [] for day in testingdays: dayValues.append(day.tempMean) dayValues.append(day.tempMax) dayValues.append(day.tempMin) dayValues.append(day.dewPoint) dayValues.append(day.humidMean) dayValues.append(day.humidMax) dayValues.append(day.humidMin) dayValues.append(day.pressure) dayValues.append(day.meanWindSpeed) dayValues.append(day.maxWindSpeed) dayValues.append(day.maxGustSpeed) dayValues.append(day.visibility)[/CODE] And you are ready to go. And dont put or initialize list in a loop ok? ;) | |
Re: i was wondering what was the point of checking main in counteven at all?? | |
Re: making things clear[CODE]#include <iostream> #include <string> using namespace std; void showresult(string name){ string take; if("rose" == name){ cout <<"name found...... Access granted\n";} else{ cout <<"Alarm alarm !!\a\n"; }} int main(int argc, char *argv[]){ string nameTake; while (true){ cout << "enter your name plz or enter to quit\n"; getline(cin,nameTake); if(nameTake.empty()||nameTake=="quit"){ cout … | |
Re: on line 7, your [CODE]def _init_(self)[/CODE] must be this ->[CODE]def __init__(self)[/CODE] a double underscore! :) |
The End.