15,406 Topics

Member Avatar for
Member Avatar for JoshuaBurleson

I'm trying to figure out how to allow users to upload images, I'm starting easy with something I know tkinter can handle with no coercion, gif files. I've figures a bit out, but I'm having issues getting the image to actually SHOW. [CODE]from tkinter import * from tkinter.filedialog import askopenfilename …

Member Avatar for TrustyTony
0
3K
Member Avatar for mahela007

hi guys. can anyone tell me why this code doesn't work? It doesn't raise any error but neither does it provide the expected results. [CODE] my_list= ['a','b'] class my_class: def __init__ (self): self.name = ' my name is hi' for a in my_list; a = my_class() [/CODE] a.name() gives and …

Member Avatar for JoshuaBurleson
0
242
Member Avatar for freebordist

Hello, I am new to this site, and new to programming. I am currently pursuing an associates in associates in programming and am taking an intro class to python, but i am having a serious issue with raw_input. For some reason i am having a hard time understand raw_input and …

Member Avatar for JoshuaBurleson
0
184
Member Avatar for MikeTheHero

I'm new to python and need help using the turtle graphics that is on python. I don't know how to start it up or anything. Python is completely new to me and so is programming.

Member Avatar for JoshuaBurleson
0
147
Member Avatar for Tomashqooo

Hi everybody, can someone help me pls finding a goot RATing tutorial for a beginner??? I wanna code a rat in python but i have no sources.

Member Avatar for JoshuaBurleson
-2
153
Member Avatar for JoshuaBurleson

How would I define the command of a given button in a messagebox window? i.e. if I were using askokcanel how would I make the ok do a certain action and cancel another?

Member Avatar for JoshuaBurleson
0
104
Member Avatar for TrustyTony
Member Avatar for CalculusG

there are xls files saved in a folder and all of them have have values in the 1st, 2nd, and 3rd columns. in the folder there are about 100 excel files, the first five number of excel file names represent the patient id.there are about 5 to 10 excels for …

Member Avatar for TrustyTony
0
209
Member Avatar for JoshuaBurleson

How would I access the string that is in the [1] position of a tuple at a given index of a listbox. What I'm trying to do is something like this:[CODE] a=Lb1.curselection()[1] a=int(a) print(Lb1[a])[/CODE] Lb1 is obviously the listbox. This particular attempt claims 1 is out of range "although I …

Member Avatar for TrustyTony
0
204
Member Avatar for TrustyTony

Roman numbers is a standard programming exercise, to give it a small twist, we input roman numeral, turn it to value and prepare minimal version of it using the substraction rule. Correctness of the input is not checked so Garbage in - Garbage out.

0
338
Member Avatar for georgeoshardo

I don't know if I can't find my problem, or I'm just getting my keywords wrong when searching for a solution, but I can't solve it. I'm getting problems with adding values to lists, here is my code: [CODE=Python]x=[] a=raw_input ("Hello, add your first database entery") b=raw_input ("Hello, add your …

Member Avatar for TrustyTony
0
166
Member Avatar for TrustyTony

While looking stuff about idlelib, I came to [URL="http://stackoverflow.com/questions/3431498/what-code-can-i-use-to-check-if-python-is-running-in-idle"]this thread in stackoverflow[/URL], so I posted own solution. I post it also here, as maybe somebody needs it (as for example \b looks ugly in IDLE)

0
259
Member Avatar for ihatehippies

I made a simple ThreadManager class that receives tasks and spawns threads to complete the tasks. Currently it keeps all the threads alive until I explicitly set threadmgr.waiting=False and all of the tasks are complete. I'm trying to eliminate the need for the former. What I would prefer is that …

Member Avatar for ihatehippies
0
177
Member Avatar for sohel807

I have run my codes (written in Python) in my Notebook (3 GB Ram, Dual-core CPU T4500 @ 2.3 GHz) and in my lab machine (11.57 GB Ram, i7-920 CPU @ 2.67 GHz). However, I have found execution time in Notebook 250.3 seconds, and in Lab machine 333.2 seconds. How …

Member Avatar for sohel807
0
88
Member Avatar for Danielle87

I would like to make a selection menue for 2 programs that i have. A menu similar to the one below. [CODE]import sys print """Menu 1) Random 2) Search""" answer = raw_input("Make a selection> ") if "1" in answer: print "This will contain program 1" elif "2" in answer: print …

Member Avatar for Danielle87
0
356
Member Avatar for Intrikate

So this is my first post and I have only begun using python. One of my first assignments is to design a program which will count the most used words in the given text file. In my case we are using the Declaration of Independence. Here is what i have …

Member Avatar for JoshuaBurleson
0
3K
Member Avatar for abders

I just finished a program, it worked perfectly, then I changed a bit of it, and now it won't work at all, even if I change it back. [CODE]self.secret_txt = Text(self, width = 35, height = 5, wrap = WORD).grid(row = 3, column = 0, columnspan = 2, sticky = …

Member Avatar for abders
0
210
Member Avatar for dustbunny000

If I have a list of strings, for example here's a small part of my list: [CODE]small_list=['HETATM 2142 O DUM 2142 -26.000 -8.000 12.300','HETATM 2143 O DUM 2143 -26.000 -6.000 12.300'][/CODE] Is there a way to remove the 12.300 from a string in this list and then replace it with …

Member Avatar for TrustyTony
0
74
Member Avatar for JoshuaBurleson

I'm having an issue displaying images in tkinter, I've tried the methods suggested by effbot and a couple other sources to no avail. Here are a couple ways I've tried so far:[CODE] gmail=PhotoImage('gmail.gif') self.glab=Label(self,image='gmail.gif') self.glab.image=gmail self.glab.grid(row=3,column=4) gmail=PhotoImage('gmail.gif') self.glab=Label(self,image=gmail) self.glab.image=gmail self.glab.grid(row=3,column=4) self.glabim=PhotoImage('gmail.gif') self.glab=Label(self,image=self.glabim) self.glab.grid(row=3,column=4) gmail=PhotoImage('gmail.gif') self.lab=Label(self,image=gmail) self.lab.image=gmail self.lab.pack() [/CODE]the last one …

Member Avatar for JoshuaBurleson
0
20K
Member Avatar for kaskoraja

Hi I have a file with format like [code] 8520,9.19E+02 8521,9.15E+02 [/code] where 9.19E+02 is equal to 918 and 9.15E+02 is equal to 915 I need import this file into another program.But it doesn't this "E" format that is generally..can anyone suggest a way to convert this entire file to …

Member Avatar for woooee
0
102
Member Avatar for hughesadam_87

Hey everyone, this should be simple, but I keep running into errors so help is greatly appreciated. I have a large class, call it class A, which has several methods. Most of these methods modify data. [CODE]ClassA() def __init(X,Y,Z) ... .. def data_mod1(): ... def data_mod2(): ... [/CODE] I'm dealing …

Member Avatar for TrustyTony
0
2K
Member Avatar for nitzanh

hello , i am using PyQt4 : QtCore and QtGui . i built a GUI with few tabs using QTabWidget(self.centralwidget) and addTab(self.device) device is a QtGui.QWidget() device is one of my tabs... i send text to this tab with self.ui.name.setText(' ....') (name belongs to this tab) how can i clear …

Member Avatar for nitzanh
0
101
Member Avatar for N1GHTS

I am designing a project geared towards business and is built in C language. The design of the various interface screens are currently in XML/CSS. The target platform is a PC running linux or windows. To compile the software, I first run a source-to-source compiler which converts the XML/CSS into …

Member Avatar for TrustyTony
0
243
Member Avatar for explorepython

I've created two dialogs in which Dialog1 is the parent of Dialog2. After navigating to dialog2 if i press close button in Dialog2, Dialog2 is closed but Dialog1 is displayed. Again i've to press the close button in Dialog1 to close the application (i know this happens coz. the close …

Member Avatar for bferg88
0
2K
Member Avatar for Vengful

hello so i have this problem that i can't solve and i need ur help. im making a program that makes the user move the fish and there is a shark at the end that he tries to avoid. here is the code [CODE] kik="b.jpg" kif="kf.jpg" kis="sss.jpg" #these are pictures …

Member Avatar for Vengful
0
150
Member Avatar for daggeras008

#! /usr/bin/python import socket import struct import sys import os import string #MADDX = '225.100.100.100' MADDX = '224.0.0.103' RAW = False #! /usr/bin/python import socket import struct import sys MADDX = '224.0.0.103' ADDR = '' #bind to address? leave blank for any DATA="414e542d534541524348204d4441502f312e310d0a3436" #the Hello ID request import binascii SDATA …

Member Avatar for TrustyTony
0
288
Member Avatar for TrustyTony

Picked up from old thread but currently applicable (the IBAN number became more widely required actually this year in Finland). The style was quite alien for modern Python coders, so I massaged the code to my own liking. I removed many temporary variables, as for my opinion they did not …

Member Avatar for TrustyTony
2
416
Member Avatar for Reverend Jim
Member Avatar for SamarthWiz

I am having trouble with the standalone builder I keep on getting this Message: [CODE] I: Dependent assemblies of C:\Python27\python.exe: I: x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none checking Analysis building Analysis because outAnalysis0.toc non existent running Analysis outAnalysis0.toc Analyzing: C:\Users\Samarth\Desktop\PYINST~1.1\support\_mountzlib.py Analyzing: C:\Users\Samarth\Desktop\PYINST~1.1\support\useUnicode.py Analyzing: C:\Users\Samarth\Dropbox\Projects\DATABANK\data-bank.py W: library coredll.dll required via ctypes not found I: Analyzing C:\Python27\python.exe …

Member Avatar for SamarthWiz
0
370
Member Avatar for theharshest

I am trying to submit the form at [B][url]http://www.harshtechtalk.com/contact-us-harsh-tech-talk[/url][/B] using the following code but no success. Please help! [CODE]#!C:/Python27/python.exe import urllib import urllib2 def main(): proxy_info={ 'user' : 'abc@abc.com', 'pass' : 'xyz', 'host' : 'xxxxxxxx', 'port' : 80 } proxy_support = urllib2.ProxyHandler({"http" : "http://%(user)s:%(pass)s@%(host)s:%(port)d" % proxy_info}) opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) …

0
122
Member Avatar for tcfersure

Hi, i need some help with a program that calculates the numeric value of a name. The value of a name is determined by summing up the values of the letters of the name where 'a' is 1, 'b' is 2, 'c' is 3 etc., up to 'z' being 26. …

Member Avatar for woooee
0
144
Member Avatar for kaskoraja

Hi.. I have a file with title output.dat.format of this file is as follows [CODE] 0 0.00E+00 0.00E+00 -2.00E-02 9.48E+02 1 0.00E+00 0.00E+00 -1.80E-02 9.48E+02 [/CODE] yes,Thats right.without any comma between.(just tab space) i need to create a file from this output.dat which has form similar to [CODE] 0,9.48E+02 0,9.48E+02 …

Member Avatar for kaskoraja
0
278
Member Avatar for felix001

Does anyone know how to use the subprocess.call to assign the ouput of a command to a string. At the moment it only assigns the return code ?? [CODE]>>> hostname = call(["hostname", "-d"]) lon3.corp.rackspace.com >>> print hostname 0[/CODE] Thanks,

Member Avatar for TrustyTony
0
119
Member Avatar for TrustyTony

By coding algorithm and using some liberal prints with small set of data, you can learn to understand the basic algorithms better than just reading about them. Here simple selection sort.

Member Avatar for TrustyTony
0
218
Member Avatar for dappe

Hey, I just started programming but im stuck. so lets say I have a wordlist with words containing 2-12 letters and I want to remove all words containing less than 3 letters or more than 7 letters. How would i do that? Another problem I have is, I want to …

Member Avatar for TrustyTony
0
8K
Member Avatar for Reverend Jim

I wrote this 3D Breakout game as a sample project to learn both Python and the visual module, vPython. It is based on a similar game I had on my Amiga back in the 80s. I don't expect that my Python is either standard or as elegant as it could …

Member Avatar for Reverend Jim
0
499
Member Avatar for TrustyTony

How about doing some effort instead of immediately voicing your desperation to Daniweb for 1001st tictactoe problem? Here is some ideas for those young spirits (I did not say newbies ;) ) 1. What is this search box here over in right hand corner? 2. What a heck is this …

Member Avatar for Azmah
4
775
Member Avatar for Wiemers11

I'm new to python and I'm trying to write a selection sort code starting with the last digit and eventually working its way to the first but I'm getting an error that the index is out of range... anyone know what's wrong with my code? inputfilename = raw_input("What is the …

Member Avatar for TrustyTony
0
212
Member Avatar for JoshuaBurleson

I hate to complain, but I'm not terribly impressed at the documentation for utilizing binding, it covers quite a bit but not common stuff, or maybe I'm just missing it. I was wondering how I could make the <RETURN> key equivalent to a <BUTTON1> click when a button is highlighted …

Member Avatar for TrustyTony
0
370
Member Avatar for mhillig1

[B]What I want on the first run thru[/B] is to ask for input, print input, ask for 2nd input, print 2nd input. End the first run, saving inputs to text file. My results are: input 1 input 1 again. input 2 input 2 again. On the 2nd time thru, it …

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for GeoBob

I want to create a function or a class method that will create a dictionary named by a variable that is passed in. By way of example, I'm creating a class method to read data from a table (in this case it's an ArcGIS table, but that's not critical) and …

Member Avatar for JoshuaBurleson
0
435
Member Avatar for imperialguy

Some system info before proceeding further: Platform: Mac OS X 10.7.1 Python Version: ActiveState Python 2.7.1 wxPython Version: [url=http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.2.1-cocoa-py2.7.dmg]wxPython2.9-osx-cocoa-py2.7[/url] I want the button label to be changed while performing a task So, here is what I did/want: [code]self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install') self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON) def OnRun(self,evt): self.run_button.SetLabel('Installing..') #call a function that does the installation …

Member Avatar for Pupo
0
322
Member Avatar for Creatinas

Hello, here is a thing, i'm beginner at wxPython ant Pyhton too. I have written small program here is a example: [CODE]import wx import urllib2 import re class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(600,400)) self.panel=wx.Panel(self) self.areaa = wx.TextCtrl(self.panel, pos=(0,10), size=(400, 20)) self.area = wx.TextCtrl(self.panel, style = …

Member Avatar for snippsat
0
1K
Member Avatar for JoshuaBurleson

I was just wondering if anybody has any ideas on how I could allow a users input to be disguised on the screen when they're entering their passwords (such as the case about everywhere on the internet) i.e. gmail's black dots in place of the actual text of a password. …

Member Avatar for Gribouillis
0
352
Member Avatar for Elektrikz

Hey guys! I started learning Python 3 four days ago and I wrote a little command line RSS Reader (~120 lines) using the [URL="http://feedparser.org/"]feedparser module[/URL]. The rss reader currently has a menu, and also receives command line arguments (run the script with "-h" or "--help" for more info). It has …

Member Avatar for Elektrikz
0
397
Member Avatar for RoqueyB

i am new to python and am working on a simple code for a project. I am to end up with and output that says: "Please enter your name: Bubba" I am to use [CODE]name = input("Please enter your name:")[/CODE] However, when I input the name "Bubba" the project says …

Member Avatar for RoqueyB
0
2K
Member Avatar for mools3

Hello there, i'm writing a program (pharmacy gestion), for my dad's pharmacy and i want to set a password when loging in to the program and have the ability to change it any time ... [B]BUT THE PROBLEM IS[/B] ... i thinkd to store the password in a text file …

Member Avatar for JoshuaBurleson
0
117
Member Avatar for philipshoe

My code is suppose to take the digits i type in my raw_input and sum up the number example: if i type 123456789 then i will get 1+2+3+4+5+6+7+8+9 = 45 as an answer but it will not stop there it will continue adding until the sum reaches a single digit …

Member Avatar for TrustyTony
0
229
Member Avatar for milil

Hello friends i am new on DaniWeb and new in Python... I have a few problems so i need help... I have a text document with a code from some web page, how can i extract some string between a two different strings in line and then that stings write …

Member Avatar for milil
0
194
Member Avatar for JoshuaBurleson

I'm trying to figure out how to deal with multiple matches in my address book, say the user has two people by the name of Bob; one is Bob Lastname and the other is Bob Namelast, how would you approach dealing with telling them to specify, and then allowing them …

Member Avatar for Gribouillis
0
232

The End.