sockets got nothing to do with isb. look into pyserials ok?
WaltP commented: Students are not allowed to "look int vectors" until the instructor teaches them. -3
BirdaoGwra commented: I solved my problem bcos of his help +2
sockets got nothing to do with isb. look into pyserials ok?
Another way
d = '1/2/2010'.split('/')[-1]
'2010'
That says the dragon
add some check to name.
if (name.empty()){
cout <<"You entered nothing..."<<endl;
}
indent the second loop ;)
yep you got it.
please put your code in the code tags
print(["/".join(date.split("-"))])
2011/03/03
from my htc phone ;)
can you post again your code in the code tags please.
;)
import socket
socket.socket()
happy?
happ for you. You can mark the thread as solved.
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!
canyvr i think tonyjv's link got a cooked dinner for you ;)
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())
Use the rectangle x,y cordinates for your bitmap cordinates. simple
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()
Dlink router or what?
First you need a good organized class to control the menu levels. This shoud at least give you an idea.
1. You need the menu navigation class (a,b,c,d) etc menus
2. You need menu level navigation class inheriting the menu class. (Back,forward,up,down) etc
3. You need action class inheriting the menu level navigation class. (And action of any kind) etc
Draw you thinking on paper first, have a working idea before you even try to hit your keyboard.
Adios !
Nice stuff but what is the benefit of this app. In real life situation? Can you give more light?
A loop to do what? You must explain better. The best way to get people to assist you is how you ask your assistqance. At least you must provide enough information if you so care about your assistance.
assert type(number) == int
But if you want to increment number. Number is already int type.
Well Gris has cooked the food well enough for you. :)
You're kidding, right? What is the Total, Average, and Mean of a list of names? :icon_rolleyes:
mmm WaltP are you following the show??
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!
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.
Start looking into vector ok?
its more flexible and a template. This mean you can extend your code to other data types.
understand that 21.43 is a positive number. Well the compiler will save you from that but the user will not be happy with the result as there will be data truncation.
Do this........
c.execute('UPDATE objects SET created=?,modified=? WHERE id=?',
(data1,data2,data3))
Cast to string...
you need to cast it to string like this...
getRow = "// " + str(ligne[0]) + " " + str(ligne[2]) + "\n\n" + str(ligne[1])
And you are ready to go
:)
under normal python way of sqlite select.... This should do.
The easier way.
c.execute('select titre, code, date from codes where id=?',idrow )
That is it :)
acehigher where did you get the above code from?
Try set.
Look into set module. its very simple.
:)
how much are you planing to spend on that.??
$???
I need the drive :)
yea
def main()
it inactive..
Slate Every data is a candidate for database insertion.
Data does not have to be in some sort of order. You do that job.
Aftert all that is what programing is all about. ;)
And dont forget to do before complain python idea.....
Always use try and catch for streams . :)
well if you are happy with my help. Then try and upvote me a lil ok?
Thanks and happy coding :)
what do you mean by list command?
Normally, ftp client will read the data of the connected address in a list form.... is that what you want?
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?.
Well britanicus option is good for large files or an unknown size.Other than that...
You just do it the easy way. Just readin and repalce what you need.
Simple. :)
But in the future use some organized data storage system. at least anydbm,pickle or sqlite my pick!.
why dont you only read the lines into a list and slize it???
The increment the index to get what you want?
listc = [x.split() for x in f.readline()]
## now you get the data like
ins =0
ins2 =0
for x in listc:
print listc[ins:ins2+1],listc[ins+2:ins2+3]
ins+=3
ins2+=4
something like this. coming from my HTC fone.
hope you get the idea
Can you please post the part of your code where you think you have errors?
I hate long codes :)
tk tk.... what about wx????
can you post your code so far. :)
copy and run my code. you should be ok with that.
Yep line 36.
Assignment operator needed not comparism.
monthN = "Decemeber";
instead
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;
}
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;
}
}
I hate long file.............oopsss !