15,194 Topics
![]() | |
hi, I am developing a FIX client using python which is then meant to be executed using the "quickfixj" server. I have done the connectivity of python client with the "quickfixj" server. my roadblock : please help me how should I write the FIX protocol messages in the python client. … | |
I'm creating a simple module that have a cin and cout functions. This will accept the user input and display it afterwards. Just like this: text = napster.comein("Enter a number: ") napster.getout(text) I have a problem in the function code because I'm an amateur in python programming. This is my … | |
Hii need help for writing user input in a file. The following code is writing only the last word in a file. For example if user type "hello world", it will save only "world" in the file. I want to write the whole sentence in the file. for i in … | |
Hi, I write some data to a file called original.txt in python, then i read the file original.txt ,convert watever in the file to string(str), then write it in another file called copy.txt. Now i want to read the copy.txt and output it in python itself. It does not display … | |
How can you use a class 1's method in another class 2. Class 2 does not inherit class 1. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ? |
The End.