611 Posted Topics

Member Avatar for pelin
Member Avatar for richieking
0
114
Member Avatar for Tcll

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 …

Member Avatar for JoshuaBurleson
0
2K
Member Avatar for vegaseat

I like one-liners but jureslak one-liner for third pseudo is not good for readability and maintainance :)

Member Avatar for Skrell
1
4K
Member Avatar for TrustyTony
Member Avatar for Azmah
4
775
Member Avatar for flebber

nice one. list comprehension gives python the style and beauty with smooth power to do great tasks easy.

Member Avatar for richieking
0
156
Member Avatar for Mike_11

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 …

Member Avatar for richieking
0
758
Member Avatar for maf_9000

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]

Member Avatar for Gribouillis
0
1K
Member Avatar for heavy.is.happy

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.

Member Avatar for richieking
0
66
Member Avatar for debasishgang7

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]

Member Avatar for vegaseat
0
157
Member Avatar for yuvalm2
Member Avatar for Shane the House

should be the first one. but it does not really matters. It all depends on your data.

Member Avatar for vegaseat
0
121
Member Avatar for Eric Noa
Member Avatar for hughesadam_87

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 …

Member Avatar for hughesadam_87
0
98
Member Avatar for Venku Tur'Mukan

try simplify the logic and what you want to achieve. This could be done in well optimised way.

Member Avatar for vegaseat
0
44K
Member Avatar for rrlogu
Member Avatar for sinatra87

And also try and look into switch statement ok? Its more robust and easy to use. Besides its more easy to extend and debug. ;)

Member Avatar for sinatra87
0
2K
Member Avatar for e-papa
Member Avatar for South

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

Member Avatar for South
0
116
Member Avatar for imperialguy

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]

Member Avatar for richieking
0
245
Member Avatar for TwistedVelocity

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.

Member Avatar for richieking
0
145
Member Avatar for parijat24

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

Member Avatar for richieking
0
182
Member Avatar for kacieh80
Member Avatar for e-papa

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.

Member Avatar for e-papa
0
164
Member Avatar for adam80

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 …

Member Avatar for adam80
0
2K
Member Avatar for xxhellothere
Member Avatar for jice
0
163
Member Avatar for ThePythonNoob
Member Avatar for richieking
0
123
Member Avatar for comSysStudent
Member Avatar for sbiren
Member Avatar for dustbunny000

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

Member Avatar for jice
0
232
Member Avatar for rssk
Member Avatar for Atistus

if its in console, Then you just get the user input and check the value. Then instruct your system based on that choice.

Member Avatar for Atistus
0
176
Member Avatar for Tamlyn
Member Avatar for spe_eddy

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]

Member Avatar for spe_eddy
0
145
Member Avatar for blacknred

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

Member Avatar for TrustyTony
0
164
Member Avatar for scyonto

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

Member Avatar for TrustyTony
0
115
Member Avatar for blacknred

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.

Member Avatar for richieking
0
83
Member Avatar for stan2000

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]

Member Avatar for richieking
0
3K
Member Avatar for ahappysadface
Member Avatar for griswolf
0
112
Member Avatar for Khoanyneosr

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.

Member Avatar for Khoanyneosr
0
280
Member Avatar for jambul_16
Member Avatar for G_S
Member Avatar for G_S
0
23K
Member Avatar for linuxoidoz
Member Avatar for joeywheels

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]

Member Avatar for richieking
0
2K
Member Avatar for stefh
Member Avatar for parijat24

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

Member Avatar for richieking
0
167
Member Avatar for spe_eddy

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

Member Avatar for TrustyTony
0
3K
Member Avatar for Archenemie
Member Avatar for richieking
0
133
Member Avatar for Marcial

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 …

Member Avatar for Marcial
0
205
Member Avatar for bpatt22
Member Avatar for kinto

on line 7, your [CODE]def _init_(self)[/CODE] must be this ->[CODE]def __init__(self)[/CODE] a double underscore! :)

Member Avatar for kinto
0
232

The End.