15,175 Topics
| |
Hi Guys, I urgently need help with this python project I'm really stuck with it, finding it very confusing at this stage. If anyone could offer me any help I'd really appreciate it!! Heres the question- Data mining is the process of sorting through large amounts of data and picking … | |
Ok, so my program's input is the number of days someone worked. They earn .02 a day. Each day they work after the first, their pay doubles...(.04, .08, .16....) my code below displays the days worked and the money earned each day. I think i did it the hard way … | |
Im doing this game for school and it's supposed to be finished real soon and then of course al the problems start coming up, the game now crashes, sometimes after a few seconds and sometimes directly on start. Don't really know why, a thought is that its doing to much … | |
I'm trying to take a file that looks like this: >taxon1 ACCGTGGATC CCTATTGATT GGATATTATC >taxon2 TTCATATGTA GGATTTCATA GATGGCCCCC And get it to look like this taxon1 ACCGTGGATCCCTATTGATTGGATATTATC I'm using a python script, so far this is what I have: #!/usr/bin/python import sys if len(sys.argv) < 2: print "usage: finalmyscript.py infile.txt" … | |
how do you write a code that calls the newline() funtion? | |
this time I have only one textfile and I want to remove all duplicate lines so that each and every single line in it is unique unto itself. with open("textfile") as w: for line in w: W = line with open("textfile") as d: c = 0 for line in d: … | |
class Frame(Widget): def __init__(self, master=None, cnf={}, **kw): what is the meaning of **kw in this function, and what does it represent? | |
hello, before people start saying what have i tried, i have not got a clue where to start if i'm honest with you and was wondering if someone could point me in the right direction. i need to create an application which stores information about people(age,name etc),should also be able … | |
I have a data set like this data=[{u'a': u'D', u'b': 100.0, u'c': 201L, u'd': datetime.datetime(2007, 12, 29, 0, 0), u'e': datetime.datetime(2008, 1, 1, 6, 27, 41)},{u'a': u'W', u'b': 100.0, u'c': 201L, u'd': datetime.datetime(2007, 12, 29, 0, 0), u'e': datetime.datetime(2008, 2, 4, 6, 27, 41)},{u'a': u'W', u'b': 100.0, u'c': 202L, u'd': … | |
Hello all! I was able to make a program that writes random numbers to a file depending on how many the user requests. I now need to write a program that read those numbers...prints them... then at the end adds all the numbers from each line together and adds them. … | |
Ok thank you in advance for any help! The problem: Write a program that asks the user for the name of a file. The program should display the contents of the file with each line preceded with a line number followed by a colon. The line numbering should start at … | |
Hello , I am asking about how to create a cickable Area in a Tkinter windows , or if i can make a label Clickable ? this is how the labels are defined : for z in rows: distligne = 15 + distligne a = (z[0].strip(),z[1].strip(),z[2].strip()) print z[0] print a … | |
textfileA = one word per line textfileB = multiple words per line textfileC = words that I have manually found already if words from textfileA also exist in textfileB, I need to replace the words in textfileB with "error" and write the replaced words from textfileB to new lines in … | |
Hello , I am asking about houw to get a hand form of the mouse when it is over a "Label" , this Label is Clickable and defined like this : def callback(event): print "clicked at", event.x, event.y Interface1() lab1dep = Label(interf1, text="Departement Informatique" ,bg = "blue" ,font=("times",12, "bold"), fg … | |
A simple test of PySide's QFileDialog widget and its method getOpenFileNames. Use method getOpenFileName if you want just one file name. | |
Has anyone installed tkinter 8.6 on windows ? There is a known bug in filedialog.askopenfilenames which properly returns a tuple of file pathnames under linux, but returns a string under windows. Typical windows return string (should be tuple): C:/testdir/AnotherFile.txt {C:/testdir/This is file with spaces.txt} {C:/testdir/z_last-file test.txt} I'm curious if tkinter … | |
Hello Team, I've been having a wierd problem with 2 of my scripts and I now know the problem was in my if statements. code=sys.argv[1] phone=sys.argv[2] message=sys.argv[3] if code == 949: servId='62000001760' elif code == 947: servId='62000001840' else: servId='90928' print servId I run this script as: sudo python printserv.py 949 … | |
Ok, so i have the loop that creates the shape below, but instead of spaces, it has solid # signs. I can't figure out how to just get the design I showed below. Where am I going wrong in my code? NUM_STEPS = 6 def main(): for r in range(NUM_STEPS): … | |
How could I pass value entered by user, using tkinter’s Entry to another object? I manage to print it, but couldn’t sent it further… Here are parts of the code: def novo_vreme(): vreme1 = Vreme() root1 = Toplevel(root) root1.title("Vreme") naziv = "Vreme" L1 = Label(root1, text="Zadržavanje: ") L1.place(x=10, y=30) E1 … | |
Hi, Actually I am developing an application in python in which I want a feature by which the application can detect whether any name is male or female name. I did Google search on this, but could not find any algorithm/code by which I can do it. So finally I … | |
hi there! is it possible to writte a python program that transfer a sentence in the form of SVO (Subject Verb Object) into the form of SOV (Subject Object Verb)? Example: input: John eat bread output:John bread eat the sentence may be a complex sentence. | |
I am trying to find the max flow of a flow network and the final pattern of the network. But the program is giving me 1 answer and when i try and do it on paper i get a different answer, not sure if one is right or both is … | |
my question is, how do i use python to check a web site to see if it has an rss feed link and return that link | |
**I am Proggraming in python however i have come to a slight glich which i cannot solve! The issue is that when it prints out in a text files it only prints one line of the whole ouput! Otherwise it works! Please i need help to make this work! ** … | |
Hi, I am trying to write a python func. which can replace nth occurance of any substring present in any string. For example: main_string = "badZZZZZZZZZZZZZZZZZZbadZZZZZZZZZZZZZZZZZZZZzbadZZZZZZZZZZZZZZZZZ" If I wanna replace the 2nd occurance of string "bad" with 'good' i will pass customreplace(main_string,'bad','good',2) So the Function should return badZZZZZZZZZZZZZZZZZZgoodZZZZZZZZZZZZZZZZZZZZzbadZZZZZZZZZZZZZZZZZ I have … | |
just wrote a snippet that return true if whole image sequnce exist else returns false, import os def sequenceExists(seqPath,firstFrame,lastFrame,sep=None): """ Checks if sequence exist on disk. seqPath = image sequence path example: J:/Footages/33x01_02a/33x01_02a.%04d.sgi where %04d can be any number like 0001, 231 but not KFd001 string change buildPath at line … | |
I'm soliciting advice for performace improvements for creating a weak checksum for file segments (used in the rSync algorithm) Here's what I have so far: def blockchecksums(instream, blocksize=4096): from hashlib import md5 weakhashes = [] stronghashes = [] for chunk in iter(lambda: instream.read(blocksize),""): a = b = 0 l = … | |
Hi I wonder How I can add version detection to port scanning? from socket import * ip = raw_input("Enter IP to scan : ") start=input("Enter start port number : ") end=input("Enter end port number : ") print "Scanning IP: " , ip for port in range(start,end): s =socket(AF_INET, SOCK_STREAM) if(s.connect_ex((ip,port))==0): … | |
is it any different to use with in python 2.5, becuase at work i wasnt getting error, but now i am implementing the logic at home on python 2.5 i am getting error from __future__ import with_statement import nuke grp = nuke.toNode("Group1") with grp: nodes = nuke.allNodes() for node in … | |
Dear friends, I have a problem that I don't seem to be able to solve... so I ask for your help! It is basically a math problem, not so much a python, but possibly there is an easy python solution. My problem is the following: I have to know the … |
The End.