15,406 Topics

Member Avatar for
Member Avatar for theweirdone

Hi, I'm trying to get a list of the subjects that I'm getting from emails in gmail. I can get the subjects, but I can't seem to get them into a list. Here's my code so far: [CODE] #! usr/bin/env python import imaplib M=imaplib.IMAP4_SSL('imap.gmail.com', 993) M.login('user@gmail.com','password') M.select() typ, emails = …

Member Avatar for slate
0
137
Member Avatar for gangster88

I need the function to be able to walk in all four directions with equal probabbility and return the distance away from the starting point. The function below only takes steps forwards and backwards? [code] def main(): numWalks, numSteps = getInputs() averageSteps = takeWalks(numWalks, numSteps) printExpectedDistance(averageSteps) def getInputs(): numWalks = …

Member Avatar for thecheesewheel
0
106
Member Avatar for sentinel123

hi guys is there a way to refer to every 2nd symbol of a string? example: [CODE] mystring = 'bananasplit' [/CODE] i want to refer to every 2nd and every 3rd symbol of any string the user types in. in this case the 1st symbol is 'b', the 2nd is …

Member Avatar for sentinel123
-2
4K
Member Avatar for d8m9

Hi, Iam new in python (1/2year) and here is the thing: I made a small text editor with tkinter and I want to generate web page from the text editor (from formated text). To web page generating I will use the HTMLgen module. So it must be created another python …

Member Avatar for d8m9
0
185
Member Avatar for funfullson

I wrote a gui with qt and converted it into python.it came below. know I want to use the information witch user entered.for example the text boxes text or want decide around the buttons clicked or any thing else.at all how can i manage my qt forms data in my …

Member Avatar for funfullson
0
157
Member Avatar for Inkoosikas

Hay, I am a noob, to the programing world, so i need a little help with lists. My problem is; I would like to create a list that contains the percent that each number of the first list is of sum of the firs list list. so like this. [CODE]first_list=[1,2,3,4,5] …

Member Avatar for Inkoosikas
0
104
Member Avatar for Dmc15

Im trying to create a python program capable of solving a maze. I need it to be able to solve a maze that is any number of rows in height and any number of columns in width. I need the maze itself to be brought in as input from a …

Member Avatar for slate
0
201
Member Avatar for klackey19

This program is supposed to add, subtract, multiply, and divide complex numbers and doubles as well as complex numbers against complex numbers. When i try to run it, I get a syntax error at line 59 and cannot figure out why. Any help/advice/pointers would be greatly appreciated. [CODE]class complex: def …

Member Avatar for woooee
0
107
Member Avatar for No Sam

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 …

0
23
Member Avatar for MSV22

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 …

Member Avatar for MSV22
0
461
Member Avatar for lewashby

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.

Member Avatar for ShadyTyrant
0
90
Member Avatar for mahela007

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for Kruptein

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 …

Member Avatar for Kruptein
0
87
Member Avatar for Democles

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 …

Member Avatar for slate
0
284
Member Avatar for need help!

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.

0
74
Member Avatar for kvard

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 …

Member Avatar for vegaseat
0
436
Member Avatar for Garee

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 …

Member Avatar for masterofpuppets
0
142
Member Avatar for npn_

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 …

Member Avatar for slate
0
122
Member Avatar for mn_kthompson

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 …

Member Avatar for mn_kthompson
0
140
Member Avatar for MRWIGGLES

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 …

Member Avatar for Lardmeister
1
153
Member Avatar for paulgerard11

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 …

Member Avatar for jlm699
0
92
Member Avatar for coffeebox

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 …

Member Avatar for ov3rcl0ck
0
209
Member Avatar for hondros

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 …

Member Avatar for jlm699
0
151
Member Avatar for Kruptein

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 …

Member Avatar for jlm699
0
103
Member Avatar for Gribouillis

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

0
509
Member Avatar for EvaDo

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

Member Avatar for vegaseat
0
101
Member Avatar for Tech B

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

Member Avatar for Tech B
0
93
Member Avatar for pmav99

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 …

0
73
Member Avatar for kaydub123

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 …

Member Avatar for masterofpuppets
0
742
Member Avatar for ahspats

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 …

Member Avatar for masterofpuppets
0
384
Member Avatar for lewashby

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 …

Member Avatar for masterofpuppets
0
125
Member Avatar for MRWIGGLES

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 …

Member Avatar for woooee
0
142
Member Avatar for Yeen

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 …

Member Avatar for Yeen
0
155
Member Avatar for hondros

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 …

Member Avatar for hondros
0
120
Member Avatar for Elvedon

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 …

Member Avatar for vegaseat
0
153
Member Avatar for Vector_Joe

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 …

Member Avatar for jlm699
0
161
Member Avatar for lrh9

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 …

Member Avatar for Ene Uran
0
12K
Member Avatar for tonywacu

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

Member Avatar for Gribouillis
0
37
Member Avatar for jayjay85

i need to fade a picture into another picture.i need to use crossfade function to to this. i need some help please, i am new at this. any help would be great. i have done a program than makes a double image but this need to happen slowly.

Member Avatar for jayjay85
-1
136
Member Avatar for vulcanfire

Hi, trying to learn recursion right now. I'm trying to write this program where it will tell the position of the letter if found in the list. I'm trying to not use the in function or the .index() function to find the position. I got everything except the position. Any …

Member Avatar for masterofpuppets
0
74
Member Avatar for uv2009

Hello all, I would be grateful for your advice regarding something I tried to do using unique() but it didn't work. I have a two dimensional numpy array that looks like that (but much larger): >>> pop_A1 array([[10, 2, 10], [10, 9, 10], [10, 9, 10], [10, 9, 10], [10, …

Member Avatar for uv2009
0
149
Member Avatar for goisagi

Hi, there! I'm pretty new to the programing world and I have a question. How can I write this code so it returns to surv1.set_sex = raw_input? after the "not in sex statement"? It's really confusing maybe I should try and write it in someother way? I don't quite understand …

Member Avatar for goisagi
0
78
Member Avatar for Dokino

hello, I'm writing calculator with Python and i came across few problems. First problem is that if user enters letters it would ask him to reenter them i thought i could do it like this [code=python]try: class num: x = float(raw_input("number\n")) numb = num() except: bull = False else: bull …

Member Avatar for Dokino
0
130
Member Avatar for EvaDo

Hi!totally new, i did an undergrad in non-python related science, and I'm trying to move into incorporating python into my postgrad, so my questions right now are fairly basic. I basically want to run muscle (a sequence alignment tool) on a large number of files.how do i start a python …

Member Avatar for Gribouillis
0
182
Member Avatar for lewashby

In the following code, could someone please explain these if statements? elif 5 <= unhappiness <= 10:, & elif 11 <= unhappiness <15:, they have two arguments, one on each side which is something I haven't seen before. Also, what the one to the far right for anyway? Also, this …

Member Avatar for masterofpuppets
0
154
Member Avatar for kaydub123

I need to write: Starting weight of food (in lbs:ozs)=8:9 into a python 3.0, I'm very new to this and what I came up with was: Starting_weight_of_food_in_lbs{:}ozs=input("Enter Starting_weight_of_food_in_lbs{:}ozs") print("Starting_weight_of_food_in_lbs{:}ozs entered=", Starting_weight_of_food_in_lbs{:}ozs) and I belive i'm way off....any help would be great!

Member Avatar for masterofpuppets
0
136
Member Avatar for Gribouillis

Joining together ordered sample points (xi, yi) when ths xi's are different yields a piecewise linear continuous (P1) function. This snippet defines a handy class to manipulate these functions. It allows computing the value and the slope of the function at each point, arithmetic operations, absolute value, truncation and linear …

Member Avatar for Gribouillis
1
598
Member Avatar for rajeshwari_ib
Member Avatar for patriciuuu

I'm trying to make a SMTP Checker using Python. The checker will do the following things: The code will take a list of smtps accounts (ex: host,user,pass) and will try to send an email to a email you will specify in the code. If it's successful (the send of the …

Member Avatar for nure
0
392
Member Avatar for vegaseat

This program uses the Python win32 extension module to get information on disk or flash drives for Windows machines. Specify the drive with its letter. If no drive letter is specified, the current drive is applied.

Member Avatar for Gribouillis
4
3K

The End.