15,179 Topics
| |
Here improved example based on MITx course of using the bisection method for root finding. | |
Hi guys, I've downloaded 2 cached_property implementations from the internet and both did not work correctly for my programs. Does anyone here used a cached_property function that works really well and could share with me? | |
I am exploring some of the PySide (PyQT public) widgets like the combo box, and how colors are applied ... | |
I am trying to make an input output file using inFile and outFile.write and got a character buffer object error how do I fix this? | |
This Python code shows you how to get a current list of currency values (Canadian Dollar = 1.00) via the internet. | |
I'm fairly new in python. This code is supposed to create an Operand class where the function is take a string like 563b9, split it so that the integer is 563 and the base is 9 and then convert it to decimal. All I have done is split the string … | |
Hi, I have a csv-file with Date in first column, pressure in second and temperature in third (a lot of data). Small example below: 08/08/2012 09:26:01,14.334,26.379 08/08/2012 09:26:02,14.329,26.376 08/08/2012 09:26:03,14.337,26.394 08/08/2012 09:26:04,14.324,26.421 I want to extract from t1 to t2 and then calculate the elapsed time (t2>t1). My code so … | |
Hi, This is my code: def update_cost(self,newcost): if self.view.curselection() == (): tkMessageBox.showerror(None,'No Item Selected') else: for key, value in self.products.mydict.iteritems(): check1=self.products.mydict[self.select_id()].get_depend() if check1==[]: v=self.products.get_item(self.select_id()) v.set_cost(int(newcost)) self.write() else: tkMessageBox.showerror(None,'Cannot Update Cost Of Compound Item') def select_id(self): index = int(self.view.curselection()[0]) item = self.view.get(index) return item.split()[0] view is just a class which inherits … | |
I have a test.txt like this: GCOORD 5.98400000E+03 1.19901791E+01 8.29785919E+00 -1.10000002E+00 GCOORD 5.98500000E+03 1.25401793E+01 8.84785938E+00 -6.59999990E+00 GCOORD 5.98600000E+03 1.30901794E+01 9.39785957E+00 -1.21000004E+01 BNBCD 3.66000000E+02 6.00000000E+00 4.00000000E+00 4.00000000E+00 4.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 BNBCD 4.17000000E+02 6.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 BNBCD 5.16000000E+02 6.00000000E+00 1.00000000E+00 1.00000000E+00 1.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 BNBCD 5.58000000E+02 … | |
I am trying to get the md5 hash of a file. It seems the md5 I am getting from the script is different than the actual md5. If anyone could point me in the direction needed it would be great. for dir, dirs, file in os.walk(path) if file == (filename): … | |
Hi, I write some data(Hello) in a file copy.txt. I read from the file copy.txt to convert the text "hello" to ASCII and then i store it in another file copy1.txt. It saves the ascii like this in the file copy1.txt: 104101108108111. Below is the ascii of each character: 104 … | |
Hi, I'm new to python and I am trying to write a 'Guess the number program'. I am however getting the following error message: Traceback (most recent call last): File "C:\Users\fdama\Documents\python\GuessMyNumber.py", line 8, in <module> guess = false NameError: name 'false' is not defined I don't know why I am … | |
Hey there, I need help writing a python program that takes your input and gives it back in a pig latin type way. This is what i got so far: [code=python]running = True while running: word = raw_input("Enter word:") if word[0] in "aeiou": print word + "way" else: print word[1:] … | |
How do i write a python code so that my list of numbers can be updated within an elif cause? I start off with an empty an empty list then from there i have to ask the user how many new scores they want to add to the list then … | |
Hello guys, I have a program created that opens a program and execute it as well. For example: filename = raw_input('Input a valid NAPS filename -> ') execfile(filename) I put my file helloworld.naps (my file extension) And it execute smoothly. Now my question is, how to verify the user input … | |
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 … |
The End.