User Profile
Collapse
-
Yes - this is what I'm saying - you have a problem compiling python itself which I can't help you with but answers may be found on a forum dealing with uclinux. Sorry. -
I think the compilation of python did not convert the binary to a FLAT format binary. I think your make has gone wrong somewhere. Apparently the compiler (gcc) needs a "-Wl,-elf2flt" option on the final gcc/ld
lines. Perhaps you have to rerun configure ?
I'm no expert on compiling packages for uclinux so you'll have to google for info for the os and microprocessor options.
In fact I got the above information...Leave a comment:
-
Also you really need to look into breaking out of the loop when a divisor is found. Maybe there is a simple statement to break out of a while loop ? When approaching a problem like this it helps to work the logic out in English (sometimes called pseudo code) first so for the loop part:
...Code:while divisor is less than or equal to the square root of number: test if number mod divisor equals zero: yes soLeave a comment:
-
I'm not sure what is this site's policy on giving URL's so I'll just say if you were to google "python411" you will find a site with loads of tutorials/books/links etc for python.
Read up as much as you can but always have a python interpreter fired up to play with ! You will learn much more by experimentation of concepts.
At the python prompt you can type :
to get...Code:help(xrange)
Leave a comment:
-
Well going through your code - here are some observations.
Firstly you do not accumulate the numer of heads and tails occurring so you have no count to show. Secondly, as stated, if you are simply doing something a set number of times in a loop a 'for num in xrange(loops)'
is the simplest construct.
Even if using a while loop as you have, you don't need an infinite loop and a break, in your case "while...Leave a comment:
-
Were you using the same numbers file across your tests ? Looks like the numbers file that is failing has a blank or empty line after the last number. Try removing it with a line editor like Vim/ed/pico to make sure no extra line feeds or empty lines exist..
Just as a tip - try this slight addition to the script :
...Code:import sys sum = 0 while True: try: line = raw_input() except EOFError:
Leave a comment:
-
You're using slicing incorrectly. The format is string[X:Y:Z] where X=start position (starts from 0), Y=non inclusive end position and Z=step.
So :
string="THISISA TESTISNTIT"
string[7:11]="TEST
Check out slicing in the docs..
You could use :
if "TEST" in string:
to just test for the existence of "TEST" in the string.Leave a comment:
-
OK - so you have the libs -and LD_LIBRARY_PATH set - weird. I have been googling around for you and found the same question on Linux Questions - is that you ? If not it may be worth keeping an eye on the thread - Will keep you posted if I find out any more.. sorry nothing more to offer right nowLeave a comment:
-
It seems you don't have libmysqlclient. so.15 - have you tried Googling to see where it is ?Leave a comment:
-
Have you looked at freeze - it should come with Python. My version is in the python site-packages directoryLeave a comment:
-
Have a look at the copy module
Code:import copy help(copy) print copy.__doc__
Leave a comment:
-
Just to contribute...
OS: Slackware Linux v12 and 11, KDE 3.5.4 WM, QT v3, Eric 3 IDE, QTDesigner 3.38, Eclipse 3.3.0 with Pydev and SqlExplorer plugins, MySQL 5.0.37. -- Oh and python 2.4.3 on one box and version 2.5 on another (Slackware 11 and 12 defaults).....
BTW My linux boxes are multiple boot WinXP, Vista, PCLinuxOS and LFS but I rarely boot to another OS besides Slackware. Variety is the spice of life and...Leave a comment:
-
Hey thanks for the quick reply. I have heard of Boa but not looked into it. I shall now.
I have not had much success with my trials of Unix ODBC and ended up using JDBC instead - however its early days yet!
Shame your preferred solution has gone commercial but I suppose the company now offer support if needed for their product.
Anyway - thanks again for the information. Bye for now .....Leave a comment:
-
Pyton/Linux/Database/Gui programming
Hi to all. I have been spending a lot of time trying out various combinations of tools/libraries etc with a view to developing applications for Linux (KDE so preferably QT based) with a Mysql backend. So far I have looked at QTDesigner with pyuic, dabo, wxwidgets, eclipse with pydev and even OpenBase/Kexi as a way of creating a development environment of database applications on the Linux desktop addressing a 'client server' (presently MySQL) backend....
No activity results to display
Show More
Leave a comment: