15,193 Topics
![]() | |
Hi, I am currently undertaking an assignment for university. I've having quite a bit of trouble with this seemingly simple task, which is to import the data from 2 .txt files into 2 tables within an sql database via python. Here is what I've done so far. This subject is … | |
Hi, I've just started learning Python and for my first script I wanted to make something that would make life easier and that I would actually use, so starting small I've began working on a Torrent Search script that uses the ISOHunt API. However I've ran into a problem in … | |
hello, iam a newbie to python, i am trying to execute a shell command within python code and need the output of the shell command to be passed to the same python code for subsequent use. Here i need the value of the string "ListenPort" from the text file /tmp/file.txt … | |
Hello evryone I want to access the **key** of a **particular edge**(for example edge (1,2)) in a **multigraph**, but I am unable to do so. Please help me out here. Any help will be greatly appreciated. Thanks | |
Hi, I have a python array that is either a list or numpy array. I want to do a bitwise inversion of all the elements and was wondering what the easiest way would be. a = [0xFF,0xFF,0xFF,0xFF] invert to.... b = [0x00,0x00,0x00,0x00] What is the easiest way to do this? … | |
I upload my test_maze.txt so you can see my problem. I have some 3 unwanted $ that went up and 1 unwanted $ that went down on my path on the maze from P to T. I think the problem is in line 20 in the def main(): of my … | |
I saved some images in an sqlite database but when i tried to display them using static bitmap i get an error OnOpenEdit self.frmEdit.imageCtrl.SetBitmap((i[7])) File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line 1229, in SetBitmap return _controls_.StaticBitmap_SetBitmap(*args, **kwargs) TypeError: in method 'StaticBitmap_SetBitmap', expected argument 2 of type 'wxBitmap const &' here is a print of … | |
I would like to write Python 3.3 code on my Android Mobile Phone. Are you using any particular app to do this? Is it also possible to compile? | |
I am in a Fundamentals of Programming class which we are using Python. In the book was a simple code to solve a problem where a cook knows in cups how much he needs but we are converting it to ounces. I was playing around with that and trying to … | |
![]() | Hi I'm quite new to Python and am trying to figure out where I'm going wrong, I'm trying to use a bisect search to find :- Monthly payment made to clear loan amount using :- Monthly interest rate = (Annual interest rate) / 12 Monthly payment lower bound = Balance … ![]() |
Trying to write a code that finds out if a random latitude is north of a list of cities. I have the latitudes of the cities as was thinking to use them as the random latitudes. I know this code is wrong, it was the way I could get it … | |
Can anyone help me out here? I have little clue on a CS assignment but can't get started on it. Question states: Write a program that generates a student's username and converts a score to a letter grade. The username consist of the initial of the name and the last … | |
Hi guys, I am running a costly simulation and trying to optimize the output. I'd have a fixed range over which the parameter of interest can vary, and about 100 values it can take in between. We know the result we are looking for and want to find the parameter … | |
Hi when i ran cx-freeze on Ubuntu 32 bit everything works, but when I try to freeze the same script on Ubuntu 64-bit I get the following error. I would be very thankfull for your help: le parentModule) File "/usr/lib/pymodules/python2.7/cx_Freeze/finder.py", line 286, in _LoadModule self._ScanCode(module.code, module, deferredImports) File "/usr/lib/pymodules/python2.7/cx_Freeze/finder.py", line … | |
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. … |
The End.