15,194 Topics

Member Avatar for
Member Avatar for newtri13

[CODE]I want to download attachments from email and search through them for a string of characters such as http://. The attachments will be in many formats, .doc, .html, .pdf. I am unfamiliar with mime and wanted to know if there is a way i can parse through the mime to …

Member Avatar for TrustyTony
0
117
Member Avatar for obscurecoder

I recently tried to run some scripts in Python on my .db file, but whenever I try to establish a connection, I get the following error: [code = python] >>> conn = sqlite3.connect('C:\Users\1545User\Documents\SEETA\ShruthLaikh\dict2. db', isolation_level=None) Traceback (most recent call last): File "<stdin>", line 1, in <module> sqlite3.OperationalError: unable to open …

Member Avatar for TrustyTony
0
74
Member Avatar for bettersaid

i want explore the use of PIL but my first try got me this error : ImportError: " No module named ImageGrab " i tried it in terminal by typing 'python -v', 'import Image' but im broke. please help! thanks[CODE] import ImageGrab capture=ImageGrab.grab() capture.save('screen.png')[/CODE]

Member Avatar for TrustyTony
0
144
Member Avatar for Anteater7171

Is there any way to get a border like this in Tkinter? Notice how it lacks the buttons on the top right. Also I don't want this program to show in the task bar. This is in windows 7, btw.

Member Avatar for TrustyTony
0
65
Member Avatar for bob47910

If I created Tkinter window with some text that filled the whole window and now wanted to replace the window with a new text, is there a way to refresh the window? For Example: a= 100 win= Tk() win.geometry("500x300") while a > 0: if a%2 == 0: lbl = Label …

Member Avatar for TrustyTony
0
11K
Member Avatar for Stefano Mtangoo

Just a curious Question, Is there a way of putting Vpython in wxpython as we do in case of wx.MediaCtrl and other stuffs?

Member Avatar for isabel puchoc
0
433
Member Avatar for wolfeater017

Can someone tell me how to display an image with pygame. By the way I am using python 3.x.

Member Avatar for vegaseat
0
2K
Member Avatar for patkeraudren

In my projet, I can't find how to determine which image and pixel coordonate at clicking image in different ScrollArea. The result was showing in statusBar() area. (See screenshot) I put a code in txt file with 2 jpg use with it. Thanks in advance.

Member Avatar for patkeraudren
0
101
Member Avatar for wolfeater017

Please help me with this bug. I have python 3.0 and I was using pygame and for some reason it isn't reconizing [CODE]windowSurface[/CODE] here Is the code Im having problems with and thanks in advance. [CODE]import pygame, sys, random from pygame.locals import * #*******************************************SETUPVAR************************************************** BLACK = (0, 0, 0) WHITE …

Member Avatar for tbone2sk
0
218
Member Avatar for parijat24

I have this sequence in the text file >sp|P20905|5HT1R_DROME 5-hydroxytryptamine receptor 1 OS=Drosophila melanogaster GN=5-HT7 PE=2 SV=1 MALSGQDWRRHQSHRQHRNHRTQGNHQKLISTATLTLFVLFLSSWIAYAAGKATVPAPLV EGETESATSQDFNSSSAFLGAIASASSTGSGSGSGSGSGSGSGSGSYGLASMNSSPIAIV SYQGITSSNLGDSNTTLVPLSDTPLLLEEFAAGEFVLPPLTSIFVSIVLLIVILGTVVGN VLVCIAVCMVRKLRRPCNYLLVSLALSDLCVALLVMPMALLYEVLEKWNFGPLLCDIWVS FDVLCCTASILNLCAISVDRYLAITKPLEYGVKRTPRRMMLCVGIVWLAAACISLPPLLI LGNEHEDEEGQPICTVCQNFAYQIYATLGSFYIPLSVMLFVYYQIFRAARRIVLEEKRAQ THLQQALNGTGSPSAPQAPPLGHTELASSGNGQRHSSVGNTSLTYSTCGGLSSGGGALAG HGSGGGVSGSTGLLGSPHHKKLRFQLAKEKKASTTLGIIMSAFTVCWLPFFILALIRPFE TMHVPASLSSLFLWLGYANSLLNPIIYATLNRDFRKPFQEILYFRCSSLNTMMRENYYQD QYGEPPSQRVMLGDERHGARESFLD I want to split this into list as [[COLOR="Red"]'[/COLOR]>sp|P20905|5HT1R_DROME 5-hydroxytryptamine receptor 1 OS=Drosophila melanogaster GN=5-HT7 PE=2 SV=1][COLOR="Red"]'[/COLOR],[COLOR="Red"]'[/COLOR]MALSGQDWRRHQSHRQHRNHRTQGNHQKLISTATLTLFVLFLSSWIAYAAGKATVPAPLV EGETESATSQDFNSSSAFLGAIASASSTGSGSGSGSGSGSGSGSGSYGLASMNSSPIAIV SYQGITSSNLGDSNTTLVPLSDTPLLLEEFAAGEFVLPPLTSIFVSIVLLIVILGTVVGN VLVCIAVCMVRKLRRPCNYLLVSLALSDLCVALLVMPMALLYEVLEKWNFGPLLCDIWVS FDVLCCTASILNLCAISVDRYLAITKPLEYGVKRTPRRMMLCVGIVWLAAACISLPPLLI LGNEHEDEEGQPICTVCQNFAYQIYATLGSFYIPLSVMLFVYYQIFRAARRIVLEEKRAQ THLQQALNGTGSPSAPQAPPLGHTELASSGNGQRHSSVGNTSLTYSTCGGLSSGGGALAG …

Member Avatar for parijat24
0
141
Member Avatar for Krstevski

Hello friends, I have a small problem with printing/getting exceptions in 3.1 version. My code is: [CODE=Python] try: # bla bla... except Exception, e: # here I got error message "Invalid Syntax" in the comma self.setError(e) return False [/CODE] What is the correct syntax in python 3.1 to get the …

Member Avatar for Krstevski
0
343
Member Avatar for jrthom444

Hi Everyone, Thanks in advance for any help. I am fairly new to programming python, and I and another person are developing a simple educational (graphical) tool that shows variable referencing for any python code that I run in my own defined local and global name spaces. The problem I …

Member Avatar for jcao219
0
220
Member Avatar for bettersaid

anyone knows how to launch an application, for example, a .exe, in mac?? this code works for me in ubuntu, i tried it in mac but its not working: [CODE]os.system('gnome-open ' + path)[/CODE]

Member Avatar for TrustyTony
0
157
Member Avatar for pyprog

I am wondering how to write a function that prints values of tree nodes from a root to a lowest child. If the tree looks like [CODE] 1 2 3 4 5 6 7 8[/CODE] then the output should be 1 3 6 8. My function is [CODE]def traverse(node): if …

0
85
Member Avatar for bpatt22

How would you modify this gui code to designate only certain spots on your canvas to drop your image? Like when your playing solitaire and the game only allows you to drop your card in a certain spot. [URL="http://www.daniweb.com/forums/post1111987.html#post1111987"]http://www.daniweb.com/forums/post1111987.html#post1111987[/URL]

Member Avatar for bpatt22
0
649
Member Avatar for ultimatebuster

Is there a way to accomplish the following in python? [CODE=javascript] try{ // something } catch (e) { // display e.message, e.name, e.linenumber } [/CODE]

Member Avatar for Gribouillis
0
213
Member Avatar for andrewtrench

Hi, First off, I'm a real greenhorn so please forgive me asking questions which may be bleeding obvious, but I have searched and searched and cannot find an answer to my problem. I'm trying to import a CSV file into sqlite3 database in python. The CSV file has 56 columns …

Member Avatar for TrustyTony
0
582
Member Avatar for bpatt22

What approach should I use to return all dict keys that have the maximum value. The code below outputs 1, but I would like for it to return 1, 2. [CODE]import operator d1 = dict() d1[0] = 1 d1[1] = 2 d1[2] = 2 maxValue = max(d1.iteritems(), key=operator.itemgetter(1))[0] [/CODE]

Member Avatar for TrustyTony
0
8K
Member Avatar for basgen

Ive been trying to make a simple program that if i press the 'TAB' button it automatically presses 'Alt' (in a loop) Also i want it to work when python isnt the main program im using, like say a macro program. import pygame while True: if pygame.K_TAB: ye nvm im …

Member Avatar for basgen
0
117
Member Avatar for kshw

Hi, I'm using BeautifulSoup to parst html pages. I wrote a recursive function to traverse the parsed tree and extract NavigableStrings, add them to a string. Then return the string. The problem is my recursive skills sucks. I know I'm initializing the (Text) string each time the function is called. …

0
40
Member Avatar for bettersaid

im a newbie to python, still learning as of today. as a part of my 'self-training' i listed some topics to practice every week but i was not able to run it successfully and im stuck. what i wanted with my activity is for it to read a .txt file …

Member Avatar for woooee
0
180
Member Avatar for G_S

Hello people, I am currently working on a program for comparing texts. Everything is working fine thanks to your help. However, I would like to have my program resize everything when the player resizes the main Window. I have managed to do so, but something feels amiss... Can you help …

0
73
Member Avatar for G_S

Hi, a simple question: how do I enable deleting inside a python program? I have a python program that asks for user input, users write some words and then press enter. The problem is they can't use backspace or supr to delete anything, instead, the program prints ^? each time …

Member Avatar for G_S
0
205
Member Avatar for kshw

I'm writing a code that should extract tags from an HTML code (I'm skipping parts about parsing and stuff). I'm testing it using a simple fixed string however, it doesn't remove this <div> tag and I have no idea why... Thanks... [CODE]import re RegExpression_Tags = r"<.*?>" html = """ <div …

Member Avatar for kshw
0
101
Member Avatar for Tech B

This bot has some common functions, along with some not so common. I've been using this code to text my wife from work when my phone dies. Requirements: [LIST] [*]Gmail account (for texting) [*]xgoogle (for lang translation) [/LIST] I know it is messy, and the variables are named poorly; sorry. …

0
482
Member Avatar for thekilon

Are they any tool that can help build nice looking , easy to use installer, that will be strictly GUI based, no command line magic, for my end user for a programm I am building. If it is possible I would like to bundle inside my installation python and pygame, …

Member Avatar for thekilon
0
194
Member Avatar for lewashby

[CODE]from Tkinter import * import tkMessageBox import pygame.mixer # create GUI window app = Tk() app.title("Head Frist Mix") sound_file = "50459_M_RED_Nephlimizer.wav" # start the sounds system mixer = pygame.mixer mixer.init() # create function def track_toggle(): if track_playing.get() == 1: track.play(loops = -1) else: track.stop() # create function volume def change_volume(v): …

Member Avatar for vegaseat
0
276
Member Avatar for gunbuster363

I want to crawl my gf's xanga's post into my computer for better reading but it require me to login before viewing the post I am wondering ,can python crawl this password protected webpage? I already have the id and password, because that is my id. the login webpage, for …

Member Avatar for gunbuster363
0
681
Member Avatar for parijat24

hey, thanks to all of them who helps me in learning this language, again there is one text file file 1.txt >[B]sp|P81928[/B][/B]|140U_DROME 67 198 Tim17 8.9e-19 No_clan >[B][/B]sp|P20905|5HT1R_DROME 179 507 7tm_1 1.1e-97 CL0192 >sp|P28285|5HT2A_DROME 243 805 7tm_1 3.2e-73 CL0192 >sp[B][/B]|P28286|5HT2B_DROME 107 588 7tm_1 7.2e-82 CL0192 * here the number represents …

Member Avatar for jcao219
0
198
Member Avatar for linuxoidoz

Hi, I have a window and open another window with a button. Then, when the other window is closed I need to update some fields in the first one. Here's what I currently do: MainWindow: [code=python] ... self.connect(self.actionCustomFactors, SIGNAL("triggered()"), self.OnCustomFactorsTriggered) ... def OnCustomFactorsTriggered(self): self.customWin = CustomWindow(self.factorsFile) self.customWin.show() self.connect(self.customWin, SIGNAL("destroyed()"), self.OnCustomWinClosed) …

Member Avatar for linuxoidoz
0
13K
Member Avatar for ultimatebuster

something like this: open red box with key or open red box to be broken down to open as .group("verb"), red box as .group("object"), with as .group("preposition"), and key as .group("indirectobj") my current pattern is [icode]"^(?P<verb>open)\W*(?P<object>\w*\W{1})\W*(?P<preposition>with|\Z)\W*(?P<indirectobj>\w*)"[/icode] it's not working, and i'm kinda out of ideas.

Member Avatar for ultimatebuster
0
133
Member Avatar for job2

So, I have this code snippet where I read a text from a TXT-file: [code] file = open('test.txt', 'r') content = file.readlines() file.close() print(content) [/code] The printout: [code] ['My name is x.\n', 'I am 45 years old.\n', '\n', 'My girlfriends name is y.\n', 'She is way too old for me.\n', …

Member Avatar for TrustyTony
0
140
Member Avatar for TrustyTony

Check this out: [URL="http://www.lfd.uci.edu/~gohlke/pythonlibs/"]Unofficial Windows Binaries for Python Extension Packages[/URL]

0
92
Member Avatar for Anteater7171

I put in a partially transparent PNG image in Tkinter and all I get is what is in the attached image. How do I make the dark triangle on the right clear? (like it's supposed to be) This is python 2.6 on Windows 7, btw.

Member Avatar for ultimatebuster
0
74
Member Avatar for SoulMazer

Hi, I've just finished writing a Pong game with Python and pygame and thought it would be cool to make it multiplayer over the net with a friend. So, I changed my old asynchat-based instant messaging server into a server for this multiplayer Pong game. The only bad thing about …

Member Avatar for ultimatebuster
0
140
Member Avatar for ultimatebuster

I'm kind of confused over the iterator object/concept and the yield statement and its usage. According to my understanding, all the python sequence are iterators, as they don't need the classic [icode=java]for (int i=0; i<list.length; i++)[/icode] to iterate through lists/arrays. Am I correct over this? Am I missing anything? Also …

Member Avatar for ultimatebuster
0
101
Member Avatar for wolfeater017

Im having troubles learning how to make an executable so can someone show me what Im doing wrong [import time from cx_Freeze import setup, Executable setup( name = "hello", version = "0.1", description = "the typical 'Hello, world!' script", executables = [Executable("hello.py")]) [GO AHEAD AND IGNORE THE REST OF THE …

Member Avatar for wolfeater017
0
1K
Member Avatar for prashanth s j

Hi all, I wanted to write the following line to the file. [code] sys.stdout.write("123: The metro polis\n") [/code] But the line that was written is: [code] sys.stdout.write("100: The metro polis ") [/code] How do I get the \n to be written in the text form to the? file(ie it should …

Member Avatar for TrustyTony
0
102
Member Avatar for Tommymac501

When I read a record, no mater what switch I use in the Open, large numbers are converted to scientific notation. These numbers are for mailing, so it's a combination of a zip, plus4, delivery point, etc. I need to keep the number intact Is there some way to read …

Member Avatar for Tommymac501
0
2K
Member Avatar for jazzvibes

Hi Daniwebers I'm trying install pygame into my Python 2.6 installation. I'm running Windows 7 64bit. I had everything working before, but I was trying to install pygame into a into a Python 3.1 installation and i kept getting an error, so I thought i'd uninstall everything and try again. …

Member Avatar for jazzvibes
0
410
Member Avatar for Dragazarth

Okay I was just mucking around on python. I have no programming experience at all, and I havent yet finished school anyhow, but I was interested in python and many say that it is great and everything... So I was trying to make a code that would solve this problem …

Member Avatar for Dragazarth
0
163
Member Avatar for AlanWilhelm

Hello, I put together a small tutorial that I wanted to share. I found only scattered information on this and put a more complete tutorial together with code and comments. [URL="http://blog.ajwilhelm.net/archives/7"]Parsing Excel files with Python[/URL]

1
89
Member Avatar for wolfeater017

[This is a really long code so im just going to put the traceback part in and where I think the problem is] [def directions(): enter=0 nwscreen() Font1 = pygame.font.SysFont('ActionIsShaded', 25) d1 = basicFont.render('Directions',False,WHITE,BLACK) d2 = Font1.render('Directions',False,WHITE,BLACK) d3 = Font1.render('ALL ANSWERS MUST BE LOWERCASE',False,RED,BLACK) d4 = Font1.render ('Press enter to …

Member Avatar for TrustyTony
0
185
Member Avatar for matto.g1456

I was hoping some one could help me out, I need to search a column in .csv and.las files, return the maximum and the corresponding value in another row. Thank you

Member Avatar for TrustyTony
-1
127
Member Avatar for kumarantechie

Hi, I want to decompile an python application which consits of pyc files. Since i am working in a conversion project .. from python to java i need to decompile pyc files to py files. The application contains number of pyc files. Any decompiler or free decompiling source available in …

Member Avatar for kumarantechie
0
155
Member Avatar for GrahamAddy

Hi I'm having a problem with PyQt QProcess taking over. I want it to run several process one after the other and return each time so that I can refresh the display with the information that the process has finished. Here is the code:- [CODE] def _writeCDtoDatabase(self): Dic = {} …

0
81
Member Avatar for GrahamAddy

The solution to my problem is probably very simple, but I am having great problems solving it. I have a [B]MainWindow[/B] Class calling a [B]Dialog[/B]. I send the contents of a list from a loop to the Dialog lineEdit for a user to accept or change as required and return …

Member Avatar for GrahamAddy
0
1K
Member Avatar for gunbuster363

I am crawling a website I found out that the source code of the website is different to the content of the website. obviously the content were generated through some script, does anyone know how to simulate the action and get the content of it? For example, there is a …

Member Avatar for gunbuster363
0
110
Member Avatar for wolfeater017

I've heard of the working file in python before and was just wondering what it was and where I can find it in python

Member Avatar for vegaseat
0
138
Member Avatar for ganeshredcobra

hai, i want to create a code to searcha big document in text format and sort one word say "error" and need to print that whole line ....how can i implement this simply in python openfile = open('/home/space/Desktop/test.txt', 'r') data=openfile.read() words=data.split() #print words if "error" in data:

Member Avatar for TrustyTony
0
149

The End.