15,190 Topics
![]() | |
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 … | |
Hi I get a littel problem to read,sort,count and remove punctuation marks from text file. data="""I love the python programming How love the python programming? We love the python programming Do you like python for kids? I like Hello World Computer Programming for Kids and Other Beginners.""" ##f = open … | |
Hi, it's been a while since I have used Python and I am very rusty. I have a problem with a piece of code and I can't for the life of me figure out what is wrong. Basically I need a piece of code that prints 'to cold' if the … | |
Hi, I am looking to write a internet scraper, and have considered the following languages: Python C++ Java The scraper will need to: - Retrieve HTML code from a page - Select a link, name and description from a section of the page - Ask for user confirmation (non gui … | |
Hi, I'm having trouble trying to figure out a code that converts negative decimal numbers to binary, as well as specifying the number of bits. For example. convert -18 using 8 bits. This should come out as 10010010 doing it manually, I think. I'd appreciate the help, thanks. | |
Hi - I have a project I am going to be working on which will be a python gui. After meeting with the user yesterday I have found out that the computer this application will run on will not have internet access always. Which brings me to my question, how … | |
Hello everyone, I'm a beginner in programming languages and in Python. I came across this error and I don't khow if it is a logical error or a design error. The problem is with class_average a = {1:[1, 2, 3], 2:[3,4,5], 3:[6,7,8] } b = {1:[3,7,4], 2:[8,2,9], 3:[3,6,3] } c … | |
Hello, I am wondering what I am missing. Keep getting a syntax error at the chara on Line 8..... def main(): print('WELL! Hello. Thank you for choosing your path to'\ 'righteousness! bahahaha!') chara = raw_input(str('Please input your character name: ')) #print the welcome for user print('Ok,'chara,'This is just protype son … | |
Hi i am trying to parse a *large xml* file and printing the tags to a output file. I am using *minidom*, my code is working fine for 30Mb files but more than that its getting memory error.So i used buffer reading the file but unable to get the desired … | |
Hi, I have downloaded a code for Speech Recognition using Windows API (SAPI 5.1). In this part of code: `class ContextEvents(win32com.client.getevents("SAPI.SpSharedRecoContext")):` I get this error: class ContextEvents(win32com.client.getevents("SAPI.SpSharedRecoContext")): TypeError: Error when calling the metaclass bases cannot create 'NoneType' instances I checked and found that `win32com.client.getevents("SAPI.SpSharedRecoContext")` returns `None` I did search all … | |
file_name = raw_input('Name of the file you will use to encode the your data \n') file_name = file_name+'.txt' fp = open(file_name, 'r') text = fp.read() #create a string that is just the first letter of every word in the sentence then close file output = "" for i in text.split(): … | |
Hi again I’m working with the text file and I need suggestions about 2,4,5? and mybe about 1 and 3 also. For example I have this text. “I love the python programming How love the python programming? We love the python programming Do you like python for kids? I like … | |
I have been working with numbers in tkinter using operators but I'm unsure on how to process the input and using maths on them. I also wouldn't mind knowing how to use words either for future reference. Reply if you know anything. | |
Here is my line of code: class Rectangle(object): def __init__(self,x,y): self.x=x self.y=y def Area(self): return self.x*self.y def Perimeter(self): return self.x*2+self.y*2 def main(): print "Rectangle a:" a = Rectangle(5, 7) print "area: %d" % a.area print "perimeter: %d" % a.perimeter #print "" #print "Rectangle b:" #b = Rectangle() #b.width = 10 … | |
well basically i have to draw a stick figure for which is my first question... i cant figure out how to draw a horizontal line and also a line at a angle for the legs... here is the code for the first one def drawStickFigure(): from graphics import * win … | |
I'm currently working on an assignment for my intro python class in school. The program is a "guess my number" variant, but its focus is on global variables and the try/except operation. I've managed to figure out most of it, but I'm having trouble calling my function that gives a … |
The End.