15,185 Topics
| |
To display system clock time in LCD format I just want to display system clock time in LCD format, also want the time to be displayed with the format of hh:mm:ss ,my code is as following ,but when I run it ,it is out of my expectaions ,so anyone can … | |
I am just back messing around a bit with programming. I am trying to clear out the mental cobwebs. I thought any non empty string evaluates to True. but according to my code, it does not apear so word = 'abc' if word is True: print 'yes' else: print 'no' … | |
class gui(): def selCon(self): print selection def create(self): inst=gui() cmds.button(l="Connect to Selected",command='inst.selCon()') I keep getting error saying name 'inst' is not defined # dont understand when method is in the same class and when I am making a call clicking the button i get this error message | |
Need some hints/help in a stupid little problem. I have a list of files in a listbox. I want to get a selection of files from the list, add them in a playlist and play it using VLC. But I dont know how to start that bit. Any help will … | |
Hi, i was having problem with a question i encountered. It was to create a life path program using python. However, i have no idea where to start. It says first to input the data for day, month and year. then it said to convert each day/month/year to a single … | |
I’m looking for a programming language that will: 1. Automate desk top processes running under Windows XP, like clearing the recycle bin & clearing recently accessed documents-programs under ‘Customize Classic Start Menu’, & 2. Open a Corel Paintshop program, run that program’s procedures & options, like optimizing photos, save the … | |
Hello everyone i am new to python and i have gone through articles but its not helping me in completing the following: I have something like this............ 10280341|2012-10-03 19:11:06.390|Sami|abc|Crossword|70 10280343|2012-10-03 19:15:32.173|Sami|aaa|Sudoku|30 10280355|2012-10-04 19:15:32.173|miami|bbb|Chaircar|15 10280366|2012-10-04 19:15:32.173|miami|bob|Avista|35 And what i want as o/p is this.......... 2012-10-03 Sami|2|100 2012-10-04 miami|3|50 | |
hey guys... I just need a little help with my encoder... this is the problem: [Click Here](http://lh3.ggpht.com/-UC0gFCTBDM0/UE9xMsYt_sI/AAAAAAAAEBw/sCXGlO4XWRQ/s1280/float%2520to%2520bin.jpg) my code: def f(byte_size,value): e=((byte_size*8)-1)//(byte_size+1)+(byte_size>2)*byte_size//2 m,b=[((byte_size*8)-(1+e)), ~(~0 << e-1)] OS= '1' if value<0 else '0' #sign I,F=str(abs(value)).split('.') I=bin(int(I)).replace('0b','') FB='' l=0; r = int(''.join(['1']*e),2)+m while l<r: B,F=str(float('0.'+F)*2.).split('.') FB+=B if F=='0': break l+=1 #print FB … | |
Hi, this is my code: def items_string(items_list): """Convert a list of Id, number pairs into a string representation. items_string(list((str, int))) -> str """ result = [] for item_id, num in items_list: result.append("{0}:{1}".format(item_id, num)) return ','.join(result) class Compound(Item): def __init__(self,item_id,name,products,items_list): Item.__init__(self,item_id,name) self.products=products self.items_list=items_list def __repr__(self): self.items_list=items_string(self) return '{0},{1},{2}'.format(self.item_id,self.name,self.items_list) class Products: def … | |
IronPython (Python running on .NET) Jython (Python running on the Java Virtual Machine) PyPy (A fast python implementation with a JIT compiler) Stackless Python (Branch of CPython supporting microthreads) Do we have to write different codes for those different python implementations (aka compilers ,right?) http://python.org/download/ << If I download windows … | |
#import libraries import random # #create empty list places = [] i = 0 # open file handle myfile = open ('places.csv') # Subsquentially read lines for line in myfile: row = line.strip().split(',') # first line of test if if i == 0: fields = row i = 1 else … | |
Hi, newbie to python here, I just wanted to ask how I can compute the after tax price and displaying only up to 2 decimal places. Like 4.1895030939393 will display only 4.18 without it rounding. Here's what I've done so far Original_Price = float(input('Please input the before-tax price : ')) … | |
How to make a common API for python toolkits like tkinter,pygtk, pyqt | |
Dear friends, I create a script to extract coordinate from the exif of a number of images and create an excel file with thumbnail, latitude, longitude and other columns. I was wondering if there was an (easy) way to find the closest placename from geonames given lat and long. Thanks, … | |
Hi, I am really new to python so please do not judge me! I want to install packages but couldnt do so. Here are the steps that I followed based on some web instructions, but I am making a mistake somewhere in the process. 1. I downloaded the setuptools 0.6c11 … | |
I have to write a program that takes a word from the user and replaces it if it is in the text file with another word given by the user. Then takes that input and writes it to a new file. The only problem is, I have to do it … | |
Details and download from http://python.org/download/releases/3.3.0/#download | |
Hello I am trying to build a function that i can use in to search for an object or item from its name, Here is what I have in **sfind.py** def findobj(searchTxt,items): """ This function will help you find an object or an item from list of items passed to … | |
I am having a really weird problem. In my program I am using a tab widget and two pages on that tab widget. Both pages contain a wxListBox widget on them. I am using wxLB_EXTENDED with both of the List boxes. The problem is that the the ListBox on first … | |
Hi, Suppose I have 3 bluetooth devices( device1, device2, device3) paired with my android phone. Is there any way to test whether the remote bluetooth device is turned on or not using python script ? | |
Hi, I want the list of paired bluetooth device list of an android device using python script. can any one please help me ? | |
so lets say you finished your program. you made the GUI and it runs fine. so everytime you want to run your program you have to go to python(or what ever you use) lauch it to see your program. my question is what code or what do you have to … | |
This is me with another project for beginners :) The Project as stated by ZZucker about 2 months ago: "Given the length of three sides, write a function that checks if it is possible to create a triangle." I could solve it with an annonymus function like this: is_triangle = … | |
I need to read and write an XML file which may contain '€' symbols. So, to start I run this code: from xml.etree import ElementTree as ET optionstree = ET.parse("test.conf") where "test.conf" is the following XML file: <?xml version="1.0" encoding="UTF-8"?> <test>12€34</test> and I get this error: File "<pyshell#7>", line 1, … | |
I've been trying to display sqlite data in wxcomboboxes but I get a type error not all arguments converted during string formatting, I'm Using a caller for the frame and it displays for about five comboBoxes but when I add more (exactly the same way as the first ones) It … | |
Hey all. I have this program where I need a variable number of for loops. For eg. the program i use to find the pythogorean triplets is for n1 in range(100): for n2 in range(100): for n3 in range(100): if n1**2+n2**2 == n3**2: print str(n1**2) + '+' + str(n2**2) + … | |
I am trying to write a program in Python that converts user input from English to Pig Latin ("Y" is not a vowel in this case, breaks off at first vowel and moves preceding consonants to the end). The end product of my program should be able to compute whole … | |
This is and answer to one of the Vegaseat's recent projects for beginners. I share my solution here because -as a begginer and do learn python as a hobby- I need your feedback. So please tell me am I doing it the right way? Thanks in advance for comments from … | |
# convert2.py # PPython Monty # Lab 2 Ch 2, PE 4 # A program to convert temperatures from Celsius to Fahrenheit and # vice versa def main(): # description of program print("This program converts Celsius temperatures to Fahrenheit and") print("vice versa.") conversion = ("C") n = eval(input("How many temperatures … | |
| Hi there, im relatively new to python and i just can't figure out parameters... Any help with this code? def main(): getInputs() answer = calculateWork() print (answer) def getInputs(a,b): num1 = int(input("Please enter your first number: ")) num2 = int(input("Please enter your second number ")) return num1,num2 def calculateWork(): return … |
The End.