15,175 Topics
| |
Write a program to read a list of non-negative integers, and to display the largest integer, the smallest integer, and the average of all the integers. The user indicates the end of the list by entering a negative sentinel value (use -1) that is NOT used in the calculations. The … | |
| Hey, I am thinking of making a Facebook application, where you open the app, enter your login details, and it passes the data and logs into the acc, and gets the HTML code, writes it to a .html file and opens it....I don't know how to make it pass the … |
Hey guys, I wrote a file the other day, which reads in data, adds a column, and then reads the data out to a specific file. I thought everything was working great, with all of your help; however, I am now running into another problem. The output data looks like … | |
I know how to store data into a database if I know the value of what I am storing. For example: [CODE]sql="INSERT INTO nameDatabase (name) Values('Joe')"[/CODE] However, I want to be able to store data that I do not know the value of into my database. So I can prompt … | |
So I made a combat system, and for the life of me i cannot figure out how to make it start automatically. It does run, but it ignores the function at the beginning and doesn't run it. There is a similar text adventure I looked at as an example for … | |
[code] import os import csv ifile = open("C:/Python26/testdata.csv", "r") [/code] here is the error i get: Traceback (most recent call last): File "C:/Python26/06_June_2009/testhenry.py", line 4, in <module> ifile = open("C:/Python26/testdata.csv", "r") IOError: [Errno 2] No such file or directory: 'C:/Python26/testdata.csv' I have no clue what to do. I can't read … | |
Hey everyone, I am writing a simple code, and seek to do something which I don't know whether it is possible or not. First, I have a name list: [CODE]Name_List = ["Jake", "Steve", "Adam"];[/CODE] The first thing I'd like to do is open a separate file for each name in … | |
I have a problem iterating through a dictionary where the sequence should be ACTGDEDQ..., but it includes some other stuff Biopython adds when it parses a FASTA file. If I just print seq_record.seq it prints the sequence, and does not include extra stuff. However, if I print the dictionary it … | |
I'm ready to put up my Python web server, but before I do I would like to know what security risks hosting a web server presents. And more importantly how do I make it more safe and secure? Thanks. | |
I need to change a character inside of a string in a list ex horizontal=2 across=2 List=['abcdefg', 'hijklmno', 'pqrstuv',] I would want to change just one character like the third character in the third string(but I don't know that the program will know using horizontal and across) to 'd'. if … | |
I have a textentrydialog and my goal is that the user cannot leave the the text entry blank or just empty whitespace. So the dialog should not go away until the user enters some characters in the box or hits cancel. This is what I have: [CODE]def OnNewButton(self,event): error=1 while … | |
i've been trying to make simple programs and downloaded python 3.01. unfortunately i have no programming experience, and am a bit stuck despite searching around the tutorial, library, etc. (please forgive if this question is already answered somewhere) my first attempt at a program is >>>print (hello world) hello world … | |
Is there a module for a camera in PyGame, because I want the camera to follow an image, thanks. | |
Hi i have a program that currently reads in the contents of a file and stores it in a string. Some of the files are quite large so speed is quite important. I want to print out the words that begin with capital letters and was wondering how i could … | |
Hi, my question is how I can find the centroid of group of cells that share the same value. Say I have this: [code] grid = [[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 1, 1, 0, 0], [0, 1, 1, 1, 0], [0, 0, 0 ,0, … | |
I know that, in python, to start a file with it's associated application that is located on my hard drive I can simply use os.startfile. However, I want to be able to start a file with it's associated application that is located on an ftp site. Does anyone know how … | |
Hey everyone, Here is an outline of my problem: I have a working code which defines a class, GeneDict, which reads in data from a special type of file, and stores it as a dictionary. What it is really doing is taking in millions of lines of biological data, and … | |
I have a recursive function. My base case is: [code] somemethod(somelist) [INDENT]if len(somelist) == 0[/INDENT] [INDENT][INDENT]return[/INDENT][/INDENT] ... [/code] This is suppose to return the function to the place where it was called from. [code] main() ... somemethod(somelist) ... [/code] But I get this error: AttributeError: Trie instance has no attribute … | |
I'm getting my feet wet with nodebox and Python. What is a real world way to find a library I need, download it, and move it to a directory so that the Import --some library will work? I'm having trouble getting any imports to work from within nodebox. thanks | |
To help people who come from console application and who wants to implement GUI, it is better for them to know the real world application made by available toolkit. I suggest this be the place to show real world apps doen by toolkits in Python Language Hope it will help … | |
Hi, I am new to programming with python. I want to make a image rotate dynamically corresponding to the CPU usage in ubuntu. I searched everywhere but couldnot find any post for it.All i have found is a static rotation with the PIL. If anyone could help me in this … | |
Hi! I'm about to rename a hole bunch of files in different folders and want to use Python to do it. The problem is that I want to keep parts of the file name from the old file and insert it into the new file in another location. for example: … | |
The basic set-up is: [CODE=python] class A(): def __init__(self): self.var = 1 @staticmethod def do_stuff_with_var(self): # A method which uses self.var ... class B(A): def __init__(self): A.__init__(self) b1 = B() b2 = B() list_of_B_instances = [b1, b2] for instance in list_of_B_instances: instance.do_stuff_with_var(instance) [/CODE] However the last line of code raises … | |
Hi Forum, I am a total newbie, so please be gentle!! I am trying to extract data in many text files that looks like this: 0.0 -0.9 0.3 -0.4 0.6 -1.0 0.9 0.3 These colums always appear on the same line number. What I want to do is to get … | |
hello, I wanna create a struct in python. the struct needs to have a char and an array of chars. eg. (ruby code): [code] Somestruct = Struct .new(:character, :characterArray) structure = Somestruct.new(" ", []) [/code] How do I do this. I made a Trie in ruby and now I wanna … | |
Follows, I need some help with fixing a bug in my program. I can't post the entire code here as its an on going assignment. I'm building a Tree in Python. [code] class Tree: def __init__(self, f, r): self.first = f self.rest = r [/code] This is my Tree. I … | |
I cannot seem to figure this out. This part of a larger script that I am writing. I have a list that looks like this. The fields are servername, port and program. How do I sort it to get a tally of what servers are listening on what ports. This … | |
I'm having a problem parsing a webpage to extract data from a table. Ideally I'm trying to extract the table with id="ctl00_ctl00_MainContent_PM_MainContent_gv_Portfolio" (see html below) I don't have a problem entering the website and downloading the html, it's beautiful soup that's tripping me up. My python code and downloaded html … | |
Hi guys, I'm new to programming and am trying to get better by writing "useful" things. Here is a very simple stock portfolio tracker that I started yesterday. It is not very complex and I feel like I'm not really improving my skills since it uses mostly beginner concepts, but … | |
I'm using python & i am trying to match ";" in a line: [CODE] for page in css: f = open(page, "r") lines = f.readlines() count = 1 obcount = 0 ebcount = 0 probwithfile = False for line in lines: [B]if not re.match("^{$", line) or not re.match("^}$", line): if … |
The End.