15,194 Topics

Member Avatar for
Member Avatar for amit9876

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

Member Avatar for TrustyTony
0
31
Member Avatar for nerdnapster

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 …

Member Avatar for nerdnapster
0
120
Member Avatar for techyworld

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 …

Member Avatar for TrustyTony
0
168
Member Avatar for techyworld

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 …

Member Avatar for techyworld
0
367
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
158
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
136
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
191
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
240
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
160
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
111
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
284
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
144
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
119
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
172
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
132
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
222
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
381
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
848
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
201
Member Avatar for maurya10

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

0
52
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
220
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
115
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
250
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
157
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
209
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
68
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
47

The End.