15,175 Topics
| |
I am in the process of learning python, but I have a problem some one gave me last week that I wouldn't mind solving before I get to where I actually learn about it. I think python is the best choice. I need to generate a txt file by inserting … | |
I have finished the code, but I can not for the life of me figure out why I am not getting any output. Any help would most appreciated. #!/usr/bin/python import apsw import random class NonRepeatingRandom(object): def __init__(self, maxvalue): self.maxvalue = maxvalue self.used = set() def next(self): if len(self.used) >= self.maxvalue: … | |
This example program of using the multiprocessing is crashing my i7 4 core windows7 64 bit computer (32 bit enthought Python 2.7), but is running fine in virtual machine Ubuntu with 4 cores assigned. Can anyone run it in their commputer in Windows7. My system memory (8 GB) is totally … | |
Hello All, I am trying to access files which are on a shared network file system, but not sure which python API I should be using. Description: For example the IP address of the file system is 10.10.10.1 1. From windows if i want to access this server i simply … | |
Santa just brought me a fancy notebook computer and I want to know if anyone has some experiemce with accessing that little camera with Python code? | |
anytime i add a directory in a .pth file of my c:\python30\Lib\site-packages folder on windows and i try to import from the listed directory in my .pth files, i get an import error that the module does not exist and after importing sys on the windows command line interface and … | |
Hi guys, I am working on a text based adventure game in Python and I am constantly getting this error: **There's an error in your program: return outside function(g.py, line 179** Here is the code http://www.mediafire.com/?4ga0weu4ifc6s1u | |
Hi, I'm trying to make a slider, but for some reason all the numbers of the slider get in left corner of the frame, all at the same position(instead of the 1;left,the position of the slider;middle and 100; right). Also see added File Here is my code: import wx class … | |
| Hello, I am a new to python. I need to solve 5 exercises. Any help would be very much appreciated!! thank you! 1.Write a program dotplot.py That takes as input a fasta file with two sequences A scoring matrix and sliding window, such as: dotplot.py fasta.in score.mat 11 and prints … |
Dear Friends, I have a sequence of two values as the following: 00001.doc d:\pathtofile\image50.jpg 00002.doc d:\pathtofile\image38.jpg 00003.doc d:\pathtofile\image40.jpg ... I would like to add the values to a list, sort the list by second value and rename the first value accordingly. For example, the following steps: Step 1 '00002.doc', 'd:\pathtofile\image38.jpg' … | |
What is the best way to use a dictionary within a class. Do I have to assign the dict within the class ? Thanks | |
Hello Everyone! I am a beginner user of Python without IT background (I am interested in IT developing my knowledge step by step). So far I did simple scripts in Python and I encountered a problem. I was looking on Google, however I didn't find the satisfactory answers which would … | |
I have a question on how to slice a dataframe. Below is a row in my dataframe. I just want to get the list under column C. I saw that I could use df.get_value(), but I'm not sure what to put for index. Is this the right way to return … | |
I need help figuring out how to fix my code. Every time I run the code its traceback is to this part of it. My code is Unbound Local Error for 'result'. Please see code below: def Level1(self): sql = "SELECT easyhint, gps, qrcode FROM gamedb WHERE quad = 1 … | |
Traceback (most recent call last): File "C:/python files/USACO/crazy/crazy.py", line 87, in <module> grid.plot(x,y,"F") File "C:/python files/USACO/crazy\grid.py", line 63, in plot self.g[(x,y)] = replace TypeError: unhashable type: 'list' You see, I'm hashing a string with the key bing a tuple. This is using my own 2d grid data structure. | |
Hello, I have been working on a code to simulate wind turbines. However, I can't seem to rotate the wind turbine. Here is the code. import pygame ############################################# # Written by P****** ******* and V***** *** # # Copyright 2012 # ############################################# pygame.init() # Gets Information humidity = float(raw_input("Enter Humidity … | |
I am learning re module for practice I have taken an export of my phone addressbook which is a comma seperated text file, containing "First Name","Mobile Phone","Home Phone","Company","E-mail Address","Company Main Phone","Business Fax","Birthday" as of now I am more interested in First name , mobile phone number and email address. in … | |
Hi guys, So I have a list of objects, each which belong to a particular subclass. I am trying to calculate a running standard deviation as follows: Label = [] Resistance = [] m = 0 i = 0 j = 0 for row in Reader: if len(row) == 0 … | |
Hey I am having trouble with a tic tac toe game and I could really use some help. My if statement(line 51) is underlined, says its invalid syntax, and I cant fix it no matter what I do. Here's my code: http://pastebin.com/UtVTz4gg | |
While I know some Python language I just can seem to make thi work: So I have this script that when you post a command: -ytb [search terms], it would look up the video in an atom feed from yuotube, could you tell me what I have wroong here? Because … | |
This small python script invokes the [Treeline](http://treeline.bellz.org/index.html) tree visualizer to display xml files in a pleasant way. ![viewxml](/attachments/large/1/viewxml.png "viewxml") | |
I am new to python web frameworks. I am using web.py because I like how raw it is. I am wondering though, how one can produce pages and scripts efficiently when being restricted to sending output through the return keyword? It seems like for any python module you can only … | |
Dear list, i am new to python as well as new to programming with no previous programming experience, i have to design GUI in python and implement multithreading in it, and also perform multithreading at servers in query handling. I checked so many web pages and tried to learn basics … | |
Hey, Guys and Gals. For some reason the variable text_list seems to be modified after the variable final has been modified. text_list is a list of text :) Full code is below. Any other hints and tips would be great Thanks a bunch. decode_list = [] key = 0 final … | |
I'm trying to make a calculator with Tkinter but I'm having trouble using a for loop to make the number buttons. I'm using a for loop as they are nearly identical. Here's the loop: class Calculation: def __init__(self,master): i=1 rowi=1 columni=0 self.num = "" self.button = [] frame=Frame(master) frame.grid() self.returnScreen … | |
I'm making a little program with tkinter and trying to get this timer to work. I'm getting a "'float' is not callable" error. Does anyone know what I'm doing wrong? The error happens when it tries to call 'self.clock_start()' def create_widgets(self): #create the main frame self.root = Tk() self.root.title("Learning Timer") … | |
| When using this code to insert 5, then 18, into a binary search tree, the data value 18 is placed as the left child of the root instead of the right child. The statement if data < node.val: (in the insertR method) doesn't seem to be working correctly. Can someone … |
Hi all, I seem to be having problems with summing all the values in a .csv file with the following format: 3.2323232312 7.5345345675 3.3423565624 etc... I have opened this with a spreadsheet at it seems the floats are all in column[0] and each number is on a different row. with … | |
Hello everyone, I am trying rotate in pygame, but I can't. What would be the best way to rotate something around its own center?? Thanks | |
I am importing a library into a script that is being used in a php document, but for the script to run, I need to import a library that is rather large. Is it possible to permanently import the library so I do not need to load it up each … |
The End.