15,406 Topics

Member Avatar for
Member Avatar for TrustyTony

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 …

Member Avatar for TrustyTony
0
298
Member Avatar for TrustyTony

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.

1
275
Member Avatar for lushys

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. …

Member Avatar for lushys
0
402
Member Avatar for frivolous

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 …

0
79
Member Avatar for floatingshed

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 …

Member Avatar for floatingshed
0
114
Member Avatar for tony75

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 …

Member Avatar for TrustyTony
0
240
Member Avatar for b.prog

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?

Member Avatar for TrustyTony
0
125
Member Avatar for indiang

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 …

Member Avatar for TrustyTony
0
243
Member Avatar for indiang

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 …

Member Avatar for TrustyTony
0
160
Member Avatar for abhilam

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 …

0
73
Member Avatar for fatalaccidents

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 …

Member Avatar for Gribouillis
0
145
Member Avatar for KY_Fan

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 …

Member Avatar for sneekula
0
201
Member Avatar for eReBoS

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 …

0
122
Member Avatar for ido098

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 …

Member Avatar for TrustyTony
0
138
Member Avatar for pythonbegginer

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 …

Member Avatar for snippsat
0
6K
Member Avatar for abhilam

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 …

Member Avatar for TrustyTony
0
183
Member Avatar for Niner710

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 …

Member Avatar for Lucaci Andrew
0
677
Member Avatar for Lomholdt

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 …

Member Avatar for Lucaci Andrew
0
268
Member Avatar for heinlein_

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 …

Member Avatar for vegaseat
0
251
Member Avatar for 4evrmrepylrning

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 …

Member Avatar for 4evrmrepylrning
0
1K
Member Avatar for Alexispap

%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: …

Member Avatar for TrustyTony
0
1K
Member Avatar for marcin19962

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

Member Avatar for marcin19962
0
400
Member Avatar for zaphoenix

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() …

Member Avatar for HiHe
0
154
Member Avatar for cyberbemon

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 …

Member Avatar for cyberbemon
0
1K
Member Avatar for satnav_8

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] …

Member Avatar for TrustyTony
0
2K
Member Avatar for ericstern

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 …

Member Avatar for ericstern
0
248
Member Avatar for brandonhorst

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. …

Member Avatar for zaphoenix
0
576
Member Avatar for fatalaccidents

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 …

Member Avatar for fatalaccidents
0
381
Member Avatar for abhilam

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 …

Member Avatar for snippsat
0
733
Member Avatar for hughesadam_87

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 …

Member Avatar for snippsat
0
189
Member Avatar for CoatsyJnr
Member Avatar for TrustyTony
0
58
Member Avatar for Transcendent

I'm trying to learn python and is looking for sites to learn it from so if you know a site please comment.

Member Avatar for vkaravir
0
225
Member Avatar for treyb

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 …

Member Avatar for treyb
0
156
Member Avatar for vegaseat

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 …

Member Avatar for leong87
2
8K
Member Avatar for chophouse

Has anybody written or know of a log parser I can use to parse Shoutcast (v2) logs?

0
74
Member Avatar for dspjm

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

0
54
Member Avatar for graydog8josh

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 …

Member Avatar for graydog8josh
0
675
Member Avatar for giancan

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) …

Member Avatar for giancan
0
1K
Member Avatar for xav.vijay

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.. >>> …

0
78
Member Avatar for ndoe

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 …

Member Avatar for munna03
0
2K
Member Avatar for TrustyTony

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: …

0
786
Member Avatar for crag0

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.

Member Avatar for TrustyTony
0
299
Member Avatar for neojiphre

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 …

Member Avatar for HiHe
0
11K
Member Avatar for unigrad101

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 …

Member Avatar for HiHe
0
121
Member Avatar for memomk

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??

0
131
Member Avatar for memomk

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 …

Member Avatar for memomk
0
963
Member Avatar for treyb

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 …

Member Avatar for treyb
0
234
Member Avatar for frivolous

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 …

Member Avatar for frivolous
0
270
Member Avatar for chophouse

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 …

Member Avatar for chophouse
0
145
Member Avatar for memomk

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 …

Member Avatar for memomk
0
572

The End.