richieking 44 Master Poster

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

if time > time_to_reg:
   destroyapp()

The you have the method destroyapp() coded to remove the files and other stuffs. Hope you got the idea.

richieking 44 Master Poster

Also why not create noneZero object .??
Well its a matter of design.

richieking 44 Master Poster

Too much; C-coding; richieking? ;)

print """Equations
    Enter empty line to finish the program!
"""

while True:
    d = raw_input("Number:" )
    if d is '':
        break
    d = int(d)
    print '{d} + 1 = {answer}'.format(d=d, answer=d+1)
		
## Then continue from there

its still in the blood too much
:)

richieking 44 Master Poster

look at the right -> there is up and down sign.
click on up.

richieking 44 Master Poster

well you can upvote me a little if you care to.
Thanks

richieking 44 Master Poster
print "Equations"

print "a+1 (1), a+2 (2), a+3 (3), a+4 (4)"

while True:
	d=int(raw_input("number:" ))
	if d==0:
		break;
	if d == 1:
		print a+1
		
## Then continue from there
richieking 44 Master Poster

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

richieking 44 Master Poster

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

richieking 44 Master Poster

As Gris said. I will do th same. Sometimes the problem as very coders faces is not the code but logic and with a litle thinking can help solve our problems.

You designed a very nice menu but complicated a simple exit. I just wonder how you couldnt see this little thing. Anyway thats my view.
happy coding :)

richieking 44 Master Poster

Do you have any error msgs?

please post them

richieking 44 Master Poster

Riechieking, you should test your code before posting. This can't work in python because word = wordlist[2] is not an expression but a statement. This is a C idiom, not a python one.

Grib your are right. Its a C++ style. I just send that from my htc phone and there was no time to test.
I will check it up one I get home.
Cheers

richieking 44 Master Poster
for((word  = wordlist[-2]) in ['ar','er',ir']):
    print word
richieking 44 Master Poster

well mark thread as solved ;)

richieking 44 Master Poster

item.GetParent() will do ok?

richieking 44 Master Poster

can you tell me why you inported sys module???
also break help here...

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
richieking 44 Master Poster

But that is not the logic.
You need to reset the list container or delete.

But you dont have to initialize a list in a loop.
no good ;)

richieking 44 Master Poster

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

richieking 44 Master Poster

should be the first one.

but it does not really matters. It all depends on your data.

richieking 44 Master Poster

just append your data;

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)

And you are ready to go. And dont put or initialize list in a loop ok?
;)

richieking 44 Master Poster

making things clear

#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 <<"Programe terminated by user\n";
			break;
		}
		showresult(nameTake);
	}
	return 0;
}
richieking 44 Master Poster

Try this c style

data_list = [
(1, 'Dave'),
(234, 'Einstein'), 
(100000, 'Bob')
]
print("Printing out to file 'test123.txt' ...")
with open("test123.txt", "w")as fout:
  fout.write("".join(["%10d %30s \n"%(x[0],x[1]) for x in data_list]))
  print("".join(["%10d %30s \n"%(x[0],x[1]) for x in data_list]))
###output
Printing out to file 'test123.txt' ...
         1                           Dave 
       234                       Einstein 
    100000                            Bob
richieking 44 Master Poster

sockets got nothing to do with isb. look into pyserials ok?

richieking 44 Master Poster

Another way

d = '1/2/2010'.split('/')[-1]
'2010'
richieking 44 Master Poster

yep you got it.

richieking 44 Master Poster

please put your code in the code tags

richieking 44 Master Poster

can you post again your code in the code tags please.

richieking 44 Master Poster

;)

import socket
socket.socket()

happy?

richieking 44 Master Poster

happ for you. You can mark the thread as solved.

richieking 44 Master Poster

1. The logic of writting only to row will not help you.
you need to provide to collumn info too.

import xlwt

# Create workbook and worksheet 
wbk = xlwt.Workbook() 
sheet = wbk.add_sheet('python')

row = 0  # row counter
col=0  # col counter
f = open('robert.txt')

for line in f: 
    # separate fields by commas 
    #L = line.strip()
    L = list(line)
    sheet.write(row,col,L) ## basic logic    
    row += 1
    col +=1 ## you need this i think
wbk.save('reformatted.data.xls')

You must be ok i think ;)

and try csv files for excell . They just work!

richieking 44 Master Poster

Just added tips ;)

import os
start = 'label'
for fn in (f for f in os.listdir(os.curdir) if f.startswith(start) and os.path.isfile(f)):
with open(fn) as fnFile:
  print(fnFile.read())
richieking 44 Master Poster

Use the rectangle x,y cordinates for your bitmap cordinates. simple

richieking 44 Master Poster

You will need to include this def in your Dog class.
The call it for appending
Also it will be a good idea to make self.dogApp,self.name and self.breed global variable access in the class but should work like this anyway.

def dppend(self)
   
  self.dogApp=[]
  self.dogApp.append((self.name,self.breed))
  return self.dogApp

Then call it like this

dogs= Dog(dogname,dogbreed)
dogs.dappend()
richieking 44 Master Poster

Nice stuff but what is the benefit of this app. In real life situation? Can you give more light?

richieking 44 Master Poster
assert type(number) == int

But if you want to increment number. Number is already int type.

richieking 44 Master Poster

Well Gris has cooked the food well enough for you. :)

richieking 44 Master Poster

Here you go duddy :)

dd= "this is a really long string that is completely pointless. But hey who cares!".split(" ")
dd[0]=''
print " ".join(dd)
##out
is a really long string that is completely pointless. But hey who cares!
richieking 44 Master Poster

Look first dont pass arg to the 2 functions by ref.

You misuse the ref. calls in the functions. You over write the memory

beta = new_degrees;

and alpha's ref. is never used.

Forget about ref. for not ok? Just get the grip first.

richieking 44 Master Poster

Do this........

c.execute('UPDATE objects SET created=?,modified=? WHERE id=?',
        (data1,data2,data3))
richieking 44 Master Poster

why dont you use a dict to save the name and scores? Then you can easy sort tham out.

why not make your algo. very simple for yourself?.

richieking 44 Master Poster

copy and run my code. you should be ok with that.

richieking 44 Master Poster

Yep line 36.
Assignment operator needed not comparism.

monthN = "Decemeber";

instead

richieking 44 Master Poster

Try this .........

#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;


int main()
{
    srand(static_cast < unsigned int >(time(0)));
	int lowerBound = 1;
	int upperBound = 101;
	bool done = false;
	char ans;
    int count = 0;
	//bool found = true;

do
 {

	 int range;
	 int guess;
	 range = upperBound - lowerBound;
	 guess = upperBound - (rand() % range);
	 cout << "Is your number?    " << guess << "  (l/h/y)   " << endl;
	 cin >> ans;

	 // is devidving by zero because the range is zero so must use else statement if range equals then we know the ans
	 // then output the ans------where do i put it then

	 //if anewers is l
	 if(range ==0){
		 done = true;
	 }
	 if (ans == 'l')
		{
	        upperBound = guess - 1;
			done = false;
			cin.get();
	    }

	// started trying  to select option for h ansewer
	 if (ans == 'h')
	    {
		   lowerBound = guess + 1;
		   done = false;
		   cin.get();
	    }

	 //started trying if ans inputed y
	 if (ans == 'y')
	   {
		cout << "yes!!!! i got it.   " << endl;
		done = true;


		cout << "do you want to play again? (y/n)" << endl;
		cin >> ans;

			if (ans == 'n')
			 {
				done = true;
			 }


			if ( ans == 'y')
			 {
				done = false;
			 }

		}

  count++;

 }while (!done);


cout << "Number of execution is " << count++ << " Times \n";
cout <<"Programme terminated \n";
cin.get();
return 0;
}
richieking 44 Master Poster

try this.........

string FindMax()
{
	string monthN;
	for(int i=0; i<month; i++)
	{
		if(averagedMonth[i]>highestMonthName)
		{	
			highestMonthName=i;
		}
	

	//gets the month name
	if(highestMonthName == 0)
		monthN = "January";
	if(highestMonthName == 1)
		monthN = "February";
	if(highestMonthName == 2)
		monthN = "March";
	if(highestMonthName == 3)
		monthN = "April";
	if(highestMonthName == 4)
		monthN = "May";
	if(highestMonthName == 5)
		monthN = "June";
	if(highestMonthName == 6)
		monthN = "July";
	if(highestMonthName == 7)
		monthN = "August";
	if(highestMonthName == 8)
		monthN = "September";
	if(highestMonthName == 9)
		monthN = "October";
	if(highestMonthName == 10)
		monthN = "November";
	if(highestMonthName == 11)
		monthN == "Decemeber";

	return monthN;
}
}
richieking 44 Master Poster

I hate long file.............oopsss !

richieking 44 Master Poster

And note that .project is a hidden file. you need to turn on view hidden file to see it ok?
:)

richieking 44 Master Poster

Go here for what you needhttp://pyqrcode.sourceforge.net/

richieking 44 Master Poster

ow sorry... do this.....

result = []
for x in range(len( Flist1)):
     result.append(Flist1[x]-Flist2[x])
richieking 44 Master Poster

Convert the list values to int/float data type. Then it will be easy to work with them. Eg....

Flist1 = [float(x) for x in f1]
Flist2 =[float(x) for x in f2]

Now you can check for the diff. Btwn the lists.

result = []
for x in len( Flist1):
     result.append(Flist1[x]-Flist2[x])

Coming from my htc phone. Hope you get the idea :)

richieking 44 Master Poster

Like snippsat said. If you need to parse html/php page you will need beautifulsoup or the hard way using regex.
The choice is yours. :)

richieking 44 Master Poster

well explained buddy. :)