15,181 Topics
| |
Hi. I'm a retired computer programmer learning Python to use with my graduate studies in cognitive science and artificial intelligence. Specifically I am looking for the application of Python in Natural Language Processing, per the Natural Language Tool Kit, per [url]http://www.nltk.org/download[/url] I'll be taking a course in Natural Language Processing … | |
Hi I am new to this forum so please excuse me if am not following the etiquette. I am a beginner in wxpython. For a project I need to create a color palette. Please check and tell me what I am doing wrong. Any help,suggestion,code snippet is welcome. [code] import … | |
Does anyone know where I can find some sort of UML (unified modeling language) tool for python? I think it might help me understand OOP a little better, but I don't really know, I just read about UML and that's all I know. Thanks. | |
I've been trying to read up about how tkinter (or more accurately Tk) works on windows AND linux. Here's what I've understood so far. Tk is a predefined set of widgets. That is stuff like text boxes, check boxes, drop down lists etc. Tkinter is just a way of translating … | |
I have the following code: but for some reason it just won't work if I touch the i the query self works, cause if I just do .Append(str(i)) without the split strip it returns all the tables.. [code=python] def mysql_table(self): self.list_box_3.Set([]) try: self.cursor.execute("SHOW TABLES;") self.query = self.cursor.fetchall() except: self.log("error") for … | |
I have been contemplating on what would be best, when it comes to learning. What I mean by that is, I have a certain job. The goal in that job is to learn python, because the job uses python django and a few other languages to complete websites. I do … | |
My mission is to reproduce the "print screen" button. Must be in memory(no saving the file...). [CODE] import PIL import ImageWin as IW import ImageGrab import win32clipboard, win32con img=ImageGrab.grab() img=IW.Dib(img) win32clipboard.OpenClipboard() win32clipboard.SetClipboardData(win32con.CF_BITMAP, img) win32clipboard.CloseClipboard() [/CODE] [COLOR="Red"] raises TypeError: expected a readable buffer object! [/COLOR] I tried using the tostring method. | |
Hello, I've stumbled upon question I can't solve on my own. What I need is to write a program in python that would perform selection sort, but here's trick - it has to be recursive. So, for example I have l = [3,2,1] after using sort(l), l = [1,2,3] I've … | |
So for one of my university projects we have been assigned a problem to complete. I have the code working fine for the example output provided however I just need some help regarding a few errors that need fixing with different inputs. I am not asking for you to do … | |
Hello, I've been downloading my news for offline use with this script: wget -r --no-parent -Q4096m -U Mozilla A.stm -erobots=off [url]http://news.bbc.co.uk/2/hi/business/default.stm[/url]' But it dumps it into one folder, and the titles are numbered. Is there any regular expression or other command I can use to seperate them into folders by … | |
For those of you that are familiar with wx... I'm just dipping my toe into the world of wxPython and I've been trying to put together a very simple Wizard app. Right now I have code that is working properly, but I'd like to know how I can change the … | |
Writing my own turtle class (I understand that Python has it's own turtle class, but this is for an assignment) with an imported graphics.py to draw a koch snowflake and c-curve. What I have came up with so far are all the functions I need. I just need some assistance … | |
have code snippet.any ideas? for clust in clusters: #for each name in a list of names i have outNM = "fam" + str(count) + ".mcl.fas" #a series of files i want written to outFL = open(outNM, 'a') for c in clust: #for each letter in my list of names that … | |
I know it seems that everyone is writing a 'backup' program these days. I started working on this a couple weeks ago and now my dream just keeps growing. I have written a script that uses rsync to backup selected files and folders in my home directory to an external … | |
Okay, here's my issue. I want to take a message a user enters, and then take it and convert it to a number, the standard a-z = 1-26, with space equaling 0. I haven't put in any punctuation yet. Anyways, I think I needed a loop, and I made this … | |
I have 2 frames in my wxpython program, MyFrame and OptionFrame if I start my program it shows MyFrame, and if I end it, the frame disappears and the program stops. If I start my program and choose to show the option frame, it will show it, but if I … | |
This snippet defines a function [b]chmod[/b] which uses symbolic strings to represent the mode (eg [b]u+rwx[/b]) like the shell command 'chmod'. | |
I want to add a bunch of tags similar to *BTAU1293812 to the end of a bunch of strings (eg ">ASIOHDA87982374:r:23423:2342: 2342 known" i have : count = 0 ....then i open the file and the handle for line in fi: if line[0]==">": handle.write(line +"*" + "BTAU1293812" +str(count) + "\n") … | |
I am currently a student in computer Information Technology and I would like to ask those of you who are experienced working in this field. I didn't really know what forum to post this, so I am posting in Python because I love the language and have posted here before. … | |
Hi everyone. I have a problem with a GUI application i have written with wxPython when i run it under windows. The strange thing is that the code runs exactly as expected in Linux... What the code does: It calculates the area of bars of reinforcement and it checks if … | |
I have a hmwk assignment that i'm stuck on....It calls for a while loop so I need to basically repeat this 4 times but I cannot for the life of me figure it out....any help would be great I narrow the code down so it works when I input the … | |
i want to write a simple app which does nothing else except that you can drag an image in a window(simply clicking somewhere on the screen and moving mouse while holding the left button down). The problem is that my image moves only once and only a little bit and … | |
In the following program, how does the value of [COLOR="Red"]crit_name[/COLOR], end up in the [COLOR="Red"]self.name = name[/COLOR] value? Is it because it's passed to that class and name is the only value in the [COLOR="Red"]__init__[/COLOR] parameter that has no default value? Thanks. [CODE]# Critter Caretaker # A virtual pet to … | |
Hi, I am trying to write a snippet of code that checks if the user entered a valid color from an imported file called graphics.py. [code] # Get a valid color value from the user. color = raw_input("Enter a color: ")[/code] graphics.py contains a huge list of built in color … | |
I've got a bit of a problem. I've got a test tomorrow in python programming, and I've been learning the language using 3.1. The computers we're taking the test on all have 2.6 installed. They're Linux (not very familiar with Unix). Obviously this is troublesome. I don't want to spend … | |
Hi there My Algebra 2 class just started matrices, and I don't want to go out and pay $100 for a graphing calculator, just for the matrices, when I can code one myself. So... this is my code, and I can do it without classes, but I decided to make … | |
I have written two scripts in python. When I run the two scripts as individual programs they run correctly. But when the second script is run as a module within the first by importing it, an image file is not recognised. I have tried calling the full pathwayof the image … | |
Hi, I've been using Komodo Edit for my Python the past few weeks. I wanted to be able to use the F5 key like in idle. So I did a keybinding to F5 with this command: [CODE]%(python) %F[/CODE] That works well. Then I wanted to be able to hit F4 … | |
I'm wondering if it's possible to change the border color of a tkinter entry widget border. I don't think it is, because no such option exists in relevant documentation. You can change the width, but that just results in the whitespace being recessed - creating a raised 3d border. If … | |
hello, i'm a great beginner in Python. But now my problem is that i have to model the growth of plant development using L-system.... but where to start this?? please, i need your advices otherwise i m lost.... please. i hope to hear from your very soon....thx |
The End.