15,190 Topics

Member Avatar for
Member Avatar for cruze098

How can you use a class 1's method in another class 2. Class 2 does not inherit class 1.

Member Avatar for Gribouillis
0
155
Member Avatar for mohsin.javaid.73

Hello Everybody. I am using Python for my code. I am trying to create folders at the end of a path. My path is /xxx/xxxx/xxxx/TEMP. I want to dynamicaly create folders after this path in my program. I want something like: /xxx/xxxx/xxxx/TEMP/Folder1. /xxx/xxxx/xxxx/TEMP/Folder2. /xxx/xxxx/xxxx/TEMP/Folder3. At the moment I am using …

Member Avatar for mohsin.javaid.73
0
134
Member Avatar for krystosan

Hello, I want to know and understand how and when do we need to implement classes in our code, I have written a program in python just using functions but never feel the need of using classes, so I was thinking when we can create something without classes why do …

Member Avatar for krystosan
0
190
Member Avatar for snakesonaplane

One thing I have been struggling with is moving from developing in Python to utilize Python on the web. All my web is currently handled with php, mainly through easy to install scripts/cms's such as Drupal, Wordpress and Joomla. Why? Because it is easy and they do 95% of what …

Member Avatar for snakesonaplane
0
239
Member Avatar for fml2012

Hello, I'm new to python and would really appreciate your help. for j in range(0,13): if files.startswith(name + ' ' + str(j)): do stuff This works for j= 0-9, but for j = 10, 11, 12 etc, it just sees the first numerical digit (eg.1). I assume I don't want …

Member Avatar for TrustyTony
0
158
Member Avatar for chao.lee.927

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 …

Member Avatar for chao.lee.927
0
394
Member Avatar for shanenin

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' …

Member Avatar for Gribouillis
0
108
Member Avatar for krystosan

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

Member Avatar for vegaseat
0
282
Member Avatar for mohsin.javaid.73

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 …

Member Avatar for glenwill101
0
143
Member Avatar for jaynew

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 …

Member Avatar for jaynew
0
117
Member Avatar for stevelll

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 …

Member Avatar for tutux
0
171
Member Avatar for vivsshake

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

Member Avatar for TrustyTony
0
131
Member Avatar for Tcll

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 …

Member Avatar for Tcll
0
220
Member Avatar for cruze098

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 …

Member Avatar for Gribouillis
0
378
Member Avatar for silvercats

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 …

Member Avatar for Gribouillis
0
158
Member Avatar for mbh1992

#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 …

Member Avatar for mbh1992
0
843
Member Avatar for hotblink

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 : ')) …

Member Avatar for TrustyTony
0
200
Member Avatar for maurya10

How to make a common API for python toolkits like tkinter,pygtk, pyqt

0
51
Member Avatar for giancan

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, …

Member Avatar for M.S.
0
219
Member Avatar for jacarandatree

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 …

Member Avatar for Gribouillis
0
114
Member Avatar for zeeters

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 …

Member Avatar for zeeters
0
3K
Member Avatar for TrustyTony
Member Avatar for vegaseat
0
241
Member Avatar for krystosan

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 …

Member Avatar for krystosan
0
155
Member Avatar for mohsin.javaid.73

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 …

Member Avatar for mohsin.javaid.73
0
208
Member Avatar for supravat

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 ?

0
67
Member Avatar for supravat

Hi, I want the list of paired bluetooth device list of an android device using python script. can any one please help me ?

0
45
Member Avatar for tammy12w

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 …

Member Avatar for TrustyTony
0
161
Member Avatar for M.S.

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 = …

Member Avatar for M.S.
0
251
Member Avatar for jakehardy

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, …

Member Avatar for Gribouillis
0
308
Member Avatar for lancelot626

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 …

Member Avatar for lancelot626
0
296

The End.