15,179 Topics

Member Avatar for
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
777
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
280
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
518
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
260
Member Avatar for efth

I'm very new to all of this, here's the code. f="/home/name/Desktop/text.txt" fil = open (f,"r") data = fil.read() i=int(data) fil.close() import os os.remove(f) i=i+1 inp=file(f,'w') inp.write(i) inp.close() I'm pretty much trying to make the value in the text file increase by one each time the script is run. I realize …

Member Avatar for TrustyTony
0
169
Member Avatar for happyhd

A console chess program that features normal chess rules including Castling, En Passant and promotion by choice. Detects draw if only kings are left, no moves possible and not in check or 50 consecutive moves without movement of a Pawn or a capture. Detects check/mate (obviously). Would be glad if …

Member Avatar for s.v.pavani
0
10K
Member Avatar for HTMLperson5

Ok, for some strange reason I cannot move from the "Python27" folder: I have tried this... Python 2.7.3 (default, Apr 10 2012, 23:31:26) Type "help", "copyright", "credits" or "license" for more information. >>> from os import system >>> system('cd') C:\Python27 0 >>> system('cd ..') 0 >>> system('cd') C:\Python27 0 It …

Member Avatar for Gribouillis
0
189
Member Avatar for HTMLperson5

Is it possible to make a Python program which checks if a file exists, maybe like: #!/usr/bin/python if exist 'File.txt': print "File.txt exists!" else: print "File.txt does not exist :-(" Obviously the `if exist` code will fail, as it is not a python command, but is there anything like the …

Member Avatar for HTMLperson5
0
2K
Member Avatar for arunpawar

I am trying to build a simple app that calculates the farenhit to celsius converter. Here is my code.. from gi.repository import Gtk, GObject class DemoWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Demo Example") self.set_size_request(300, 400) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) self.add(vbox) self.entry = Gtk.Entry() self.entry.set_text("Enter Farenhit") self.button1 = Gtk.Button(label="Calculate") self.button1.connect("clicked", self.on_button1_clicked) vbox.pack_start(self.entry, True, …

Member Avatar for arunpawar
0
250
Member Avatar for fatalaccidents

Hey guys, I'm trying to use mpi4py on my mac but I'm running into some problems. I'm just trying to get it up and running by running a simple helloworld program that runs on different processors. When I run the command 'mpiexec -n 2 python helloworld.py' I'm getting a very …

Member Avatar for fatalaccidents
0
543

The End.