15,185 Topics

Member Avatar for
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
152
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
71
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
52
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
659
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
76
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
778
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
281
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
117
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
129
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
955
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
232
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
268
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
143
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
566
Member Avatar for memomk

hey all I've searched all over the web and i didn't get a solution! what should i do to take the text from the 'urlT' line edit? is there another way? Nameerror "global name 'self' is not defined" whats wrong with it? [CODE] from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): …

Member Avatar for memomk
0
2K
Member Avatar for CriticalError

Hi I am trying to get python to run from notepad++. When I go to run in notepad++ and select python.exe in default folder C:\Program Files\Python27\python.exe It does not execute. Nothing happens. However if I save the .py file and double click it the program will execute, why can't I …

Member Avatar for polochen
0
531
Member Avatar for utkarshsahu

I just made a small program to spell check a provided sentence and point errors in the sentence. Actually, the program creates a list by reading data from text file which contains dictionary words and from there it tells whether the inputted word/s are in dictionary or not. I would …

Member Avatar for ihatehippies
0
234
Member Avatar for TrustyTony

**_Greetings, dear Python forum users, from newly appointed moderator pyTony!_** There have been some development lock up of the Forum database occuring due to debugging process of current transition process to new Forum software. I have today been appointed as moderator and I have started to learn the processes involved …

Member Avatar for vegaseat
1
281
Member Avatar for mgunia

I'd like to say "hello" to everyone as it is my first post. I looked for the solution to my problem on the internet for over 2 hours and I didn't find anything relevant. I hope you are able to help me. I have a bunch of invoices written in …

Member Avatar for mgunia
0
520
Member Avatar for rasizzle

Here's my dilemma: I am creating a histogram through matplotlib and saving it in the same folder I'm running. There are a few image files that I can save it as, none of them being bitmap. So I'm trying to convert the image to bitmap. I've looked at WxImage and …

Member Avatar for Gribouillis
0
27K
Member Avatar for Darek6

Hi everybody, I've got a code which returns to a given text an inverse index. From a list of tokens, the function produces a list sorted by the frequency. Example: inverted_index(['the', 'house', ',', 'the', 'beer']) [('the', [0, 3]), ('beer', [4]), ('house', [1]), (',', [2])] Code: def outp(txt): ind = {} …

Member Avatar for Gribouillis
0
230
Member Avatar for sunfutbol
Member Avatar for sunfutbol
0
198
Member Avatar for Gribouillis

This python 2 code snippet uses unicode chess symbols and box drawings symbols to display a chessboard in a terminal. With a terminal profile having a monospace font of size 20 or more, it looks quite usable to play chess.

Member Avatar for Kyril
3
6K
Member Avatar for tiffanynguyen08

I want to make a trivia game in python. Let's say I have a set of 25 questions, how do I choose 10 random questions from that set without repeats?

Member Avatar for vegaseat
0
4K
Member Avatar for Wolfenstein

Hey, i appreciate anybody who use up some of their own time to help me. I'n a newbie to python and i have a couple problems. First, the score NEVER gets updated. Second, i'm unable to select the same menu option twice in a row (eg select 'letterguess' first, complete …

Member Avatar for vegaseat
0
158
Member Avatar for shean1488

Hi everybody, Can you please help me to fix this error: For exit press 'q' Please enter name :Jack London For exit press 'q' Please enter name :C.S. Lewis For exit press 'q' Please enter name :q Traceback (most recent call last): File "/home/serg/python/First/start/Q1.py", line 28, in <module> print row[0], …

Member Avatar for TrustyTony
0
261

The End.