15,406 Topics
![]() | |
Sometimes we want to tackle some problem specifying properties of sequence of numbers consisting the integer. Then it is usefull to have function to join many integers to make a long integer. Most efficient way for tight loops is to stay in integers domain and not go through the string … | |
Finding efficiently primes, whose begining numbers are also primes. See the thread http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c in C++ forum for discussion on topic. | |
Hello, I've found quite a few answers on this site. I was a network admin, however these days you have to wear multiple hats and as such I'm learning Python at work and my main source for answers when stuck is of course, the net. So here is my problem. … | |
i made a music player with a playlist but the songs in playlist are not playable because only the name of song is going in playlist not a complete mp3 file. can you tell me how to handle this problem?? here is my code from Tkinter import * import mp3play … | |
I have no idea where to start with this, a few pointers and a kick in the right direction would be much appreciated. I run a radio station. All our music is in folders representing music styles. From time to time I want to print out a complete library. Printing … | |
Hi ! I have books.txt and it contain 20 books with author,the books.txt look like so.. Mark Lutz/learning python James payane/Beginning Python Noah gift/Python for Unix and Linux System Administration If user search for book it just print book and author if user search for author print (“you cannot search … | |
So, my problem is that I want to run a process every 5 minutes, however I also want a console input which can modify its preferences and call functions depending console input. How can this be done system-independently? | |
I try to understand the regex in python. How can i split the following sentence with regular expression? "familyname, Givenname A.15.10" this is like the phonebook in python regex http://docs.python.org/library/re.html. The person maybe have 2 or more familynames and 2 or more givennames. After the familynames exist ', ' and … | |
Hi to everyone. I am new here and i try to learn python3. For this reason i try to implement a problem with the following characteristics: A class Room with atrributes(building,floor,number) and a Class occupant with attributes(familyname,givenname,room). Next the program will read a text file line by line. each line … | |
Dear all, I have the data like this, Truely saying i have data like this with more than 50 column and more than this rows. I am tryng to plot these data. 1 23 123 2 12 124 3 15 125 4 18 135 5 19 137 6 12 141 … | |
Hey everyone, I'm trying to install numpy on a 64 bit SUSE linux (HPC) machine that I don't have root on. I've tried about a hundred different ways of doing it off of google and all seem to be failing at one stage or another. I'm starting by installing lapack … | |
I have tried to figure this out on my own forever now. I have been getting hint from the net but can't figure it out. So I figured I would admit defeat and see what you guys could show me. I need the three numbers entered into this program to … | |
Hi, I have an application that converts the ascii characters within the excel file into hexa conversion ie. à to & #x00E0; but my application has one strict requirement and that is the excel file must be properly encoded in UTF-8. I have noticed that simply saving the excel file … | |
I'm trying to write a video streamer using Socket and ImageGrab modules in Python. so far I've got a streamer that can send pictures of the desktop from one computer to another over a TCP connection, but as you probably can guess, the frame rate is very low so what's … | |
I have a text file named "multipoles.txt", i took a screen shot of it ( [url]http://img193.imageshack.us/i/textf.jpg/[/url]) so i can explain myself better. Ok so I basically want to go in the file and get the data from the third column below the text that says Electronic Charge Electrons. The numbers … | |
Dear all, I am using python and trying to plot the large scale of data as follows. A B C D E 1 2 4 5 6 2 3.1 5 1 8. 3 5 5 6 10.1 4 8 9 7 13 5 11 13 12 6 18 19 Just … | |
I am trying to use the mechanize module to automate a task on the web. I am able to get the first form to submit correctly. After I submit the first form I would like to take the data from the second website(or form) I am taken to(after I enter … | |
![]() | Hello. I recently finished my 1. semester in Computer Science, and got a good fundamental idea on programming in Python. Our exam assignment whas to create a game where we had to smash robots by clicking around with the mouse. The GUI was provided by our instructor. Now we newer … |
I have a script where text is inserted into a scrolledText widget, using Pmw megawidgets. A tag is assigned to the text, and when you click on it, the text is hidden, that is, it changes color to the background color. To unhide it you click it again. What I … | |
Hi I am trying my hand at GUI using Python and Tkinter. I know there are probably better options out there but I only have access to Tkinter here at work. My question is this. I have written this: #!/usr/local/bin/python2.6 from Tkinter import * import os root = Tk() root.title("EIMA … | |
%author: Alexis Papathanassopoulos from Tkinter import * import Image, ImageTk import os import glob import time top = Tk() c=Canvas(top,width=800,height=400, bg='lightblue') c.grid(row=0,columnspan=2,sticky=N+E+W+S) pdict={} class Flow: def __init__(self, clickfunc): self.cfunc = clickfunc def goto(self, canvas, nr): global velocity,autorotate clickeditem = canvas.find_withtag("pic_" + str(nr)) tagsofitem= canvas.gettags(clickeditem) oldcenteritem= canvas.find_withtag('center') if clickeditem: if oldcenteritem: … | |
https://dl.dropbox.com/u/21125662/compilation/OsuModTool.txt It doesn't really work - text didn't change - why it doesn't work? It doesn't give me any error (but print prints what it should) https://dl.dropbox.com/u/21125662/compilation/post_adder_win.txt I call function through keyboard event | |
Hello, I am new to python and i am having problems in the output format of "for" "in" loop example the code below # A word count programme # Author why jay def main(): import string word=0 line=0 letters=0 asd=raw_input("Enter file here : ") f_name=open(asd,'r') for why in f_name: see=why.split() … | |
Note: This is a server that is going to be used on a build farm, So 3rd party libraries are no use here. I've been working on writing a python script that can be used to POST files on to a tomcat server (java), I finished writing the servlet and … | |
So i've found this HTTP downloader in python, and I wanted to modify it. I've been trying to add a ttk progressbar, to no avail, but I have no idea why it isn't working! Here is my code: import urllib2 import Tkinter import ttk url = 'http://kharg.czystybeton.pl/pendulum%20-%20%5B2005%5D%20hold%20your%20colour/05.%20through%20the%20loop.mp3' file_name = url.split('/')[-1] … | |
![]() | Hi, I am learning python coming from a C background and I am trying to understand how python lists work. I took a look at the built in methods, and I am wondering if they are implemented like a linked list. The reason I am wondering this, is because I … ![]() |
Hey Folks. I'm writing a Python app using wx and I'd really like the ability to block the Capslock key at certain times. My current system has some unfortunate toggling of Hotkey Bindings and uses SendKeys, which results in some ugly keyboard light flashing and some seemingly random infinite loops. … | |
Hey guys, I'm trying to install my own version of python on an HPC without root access so I can use my own packages. So far I am banging my head against the wall and getting nowhere. I actually had my own version of python, numpy, ipython and a couple … | |
EXPERIMENT : KSAS1201 SG CLIMAT CHANGE DATA PATH : C:\DSSAT45\Sorghum\ TREATMENT 1 : N.American SGCER045 @ VARIABLE SIMULATED MEASURED -------- ------- -------- Panicle Initiation day (dap) 62 -99 Anthesis day (dap) 115 -99 Physiological maturity day (dap) 160 -99 Yield at harvest maturity (kg [dm]/ha) 8478 -99 Number at maturity … | |
Real quick question. If I have a string 'hi my name is bill' and I want to reduce this to a list of letters, with no whitespaces (eg ['h', 'i', 'm', 'y'] as opposed to ['hi', 'i', ' ' , 'm', 'y', ' ', 'n'...]), is there a really quick … | |
| |
I'm trying to learn python and is looking for sites to learn it from so if you know a site please comment. | |
The script I have been working on cleans up ftp images from a bunch a cameras and does this everyday. It deletes directories older than 14 days. The issue I am running accross is that even though there is typically 15k images in each directory, it takes WAY to long … | |
This code snippet allows you to list the files in a folder sorted by "last modified date". The tuple returned by the os.stat() function contains amongst other things the last modified date, which is then converted by the time.localtime() function to a tuple that is ideal for sorting. You can … | |
Has anybody written or know of a log parser I can use to parse Shoutcast (v2) logs? | |
Suppose I wrote a code like this from pylab import * t1 = text(1, 1, "Hello") draw() t1.remove() draw() How do I suppose to show t1 again in my figure? Thanks for help | |
In Tkinter, I am trying to make the askdirectory menu more user friendly. Is there a way to center the focus of the window on the last folder opened, both vertically and horizontally? I don't want my users to have to scroll right when they get deep into subfolders. def … | |
Dear Friends, I'm having some troubles in my script connected with special characters. I built a program that is supposed to process some images in a folder and give back some files (xls and txt). Everything is fine in most of the cases, but if in the path (including filename) … | |
okay.... I have been trying this stuff for a couple days and I think I have completely lost my way. I am trying to read data from an excel and import it into a MySQL DB. When I fetch the data from the cell, this is what I get.. >>> … | |
how to compare string in file e.g i have file with name data.txt with file like this 123456 abcdef 456897 asdffg 789654 gfdsah the question how to compare that file and i now that string with content alphabet or number and i want make make new file data2.txt from data.txt … | |
We can run Python2 script in most simple cases if we just use the 2to3.py script found in recent Python versions: F:\Python27\Tools\Scripts>copy \test\output_window_tk.py \test\output_window_tk2.py 1 tiedosto(a) on kopioitu. F:\Python27\Tools\Scripts>2to3.py -w \test\output_window_tk.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: … | |
I am a beginner to pything and I am looking to monitor a directory and run a script everytime something is input into the directory. I am wondering the best method for doing this using python? Any point in the right direction I would appreciate. | |
So I'm trying to create a simple game, and right now the interface for the game requires a grid of buttons to be created based on a number required by the user. Currently I have a scale widget which a allows a user to choose a grid size, and a … | |
Write a function named centeredSquares() that draws a set of squares of different size around a common center point. centeredSquares() takes four parameters. The first parameter is the length of the side of the first square to draw. The second parameter is the number of squares to draw. The third … | |
what QObject: Cannot create children for a parent that is in a different thread. (Parent is QTextDocument(0x905b660), parent's thread is QThread(0x8efc560), current thread is flooderthread(0x8efc548) error means ? and how to solve it?? | |
hey i have this error The debugged program raised the exception unhandled RuntimeError "underlying C/C++ object has been deleted" the code is: class qthread(QtCore.QThread): def __init__(self, x, y, z): self.x=x self.y=y self.z=z self.name="" self.m=hashlib.md5() def changeresultsig(self, text): self.emit(QtCore.SIGNAL("changeresult(text)"),text) def conssig(self, text): self.emit(QtCore.SIGNAL("cons(text)"), text) def enablesig(self): self.emit(QtCore.SIGNAL("enable(")) def disablesig(self): self.emit(QtCOre.SIGNAL("disable()")) def … | |
I have been running a script that will will delete archive folders that are older than 14 days. I have been doing created. However there are times when the script will not run and my boses want the folders deleted but the name of the folder. The folders names are … | |
i want to find mfcc of each frame of a song. can you tell me how to find mfcc. i found this code but unable to understand what is it doing. this code is printing an array and duration and period. But i heard that mfcc gives you some co-eficient … | |
I'm writing a script to populate a list with the last 5 albums frm a list of what's about to play. My query works in terms of retrieving the values, but the list populates with a set of parens and an extra comma added to each returned value. Any ideas … | |
ok now lets say we have this code import hashlib,itertools,string m=hashlib.md5() s=string.printable it=itertools.product(s,repeat=1) for i in it: ij="".join(i) m.update(ij) print ij+" "+m.hexdigest() >> 0 cfcd208495d565ef66e7dff9f98764da 1 96a3be3cf272e017046d1b2674a52bd3 2 d2490f048dc3b77a457e3e450ab4eb38 3 eb62f6b9306db575c2d596b1279627a4 4 4100c4d44da9177247e44a5fc1546778 5 d6a9a933c8aafc51e55ac0662b6e4d4a 6 124bd1296bec0d9d93c7b52a71ad8d5b 7 2e9ec317e197819358fbc43afca7d837 8 22975d8a5ed1b91445f6c55ac121505b 9 781e5e245d69b566979b86e28d23f2c7 a 343817fa02440513ce03e9d1f1e44dc7 b b60c52bf4849067f0b57c8bd30985466 c 2d31d97199fb287d6fcb4f82ebd1b3f2 d … |
The End.