473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

gdesklets ?

hi,

I'm wrinting a gdesklet (gdesklets.gnome.org).. Excuse my ignorance
this is my first ever python script...so on the question :

why I should write :
self.__percent = int((float(self.__diff) / float(self.__max)) * 100)

instead of just :

self.__percent = int((self.__diff / self.__max) * 100)

it took my one hour experiment to find it :"(
Do I have to do always typecasting... or this is some special case.

tia
Jul 18 '05 #1
0 1062

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: francisl | last post by:
I just discover this, I don't know I look like if I where stepping out of a long sleep and everyone knew it, But still I find it pretty nice and decide to share it : I dont know if it is enterly...
0
by: Cameron Laird | last post by:
QOTW: "n other languages, by the time you get the bloody thing working it's time to ship, and you don't have to bother worrying about making it optimal." -- Simon Brunning "One of the best...
0
by: none | last post by:
I found that gDeskCal is also written in Python. So if I have a theme used by gDesklets, how can I make the whole thing standalone so that it can be similar to the case of gDeskCal??
1
by: dataangel | last post by:
I'm writing a python app that works as a replacement for the menu that comes with most minimalist wms when you right click the root window. It's prettier and written completely in python. I'd...
0
by: Thomas Dybdahl Ahle | last post by:
Hi, I'm writing a gdesklets control, that dynamicly uses __import__ and getattr to get the right classes based on userinput. The problem is, that my control is somehow being run from somewhere...
0
by: Flavio | last post by:
Hi, sorry for posting here, but the forum in the projects page is not working. Maybe there is a gdesklet developer lurking... :-) I cant import anything from a script, it gives me a runtime...
9
by: Skye | last post by:
What is this doing? print >fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks!
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.