15,406 Topics
![]() | |
I have a directory with many subdirectories. Each subdirectory contains a small number of image files (.jpg). I would like to accumulate all these image files in a Tkinter listbox, sort them and be able to select blocks of files and send them to another listbox. Ultimately I would like … | |
Need some help in python. How do i make the user choose wheter or not to pick it up? (i can do picking up an item from a list): [quote]objectsCarried = [] inventory = ['bat'] lengthOfInventory =len(inventory) print 'The room holds:' for item in range(lengthOfInventory): print item, inventory[item] numberChosen = … | |
I am a programmer but have just recently ventured into the realm of graphics programming using Python; what I have learned so far is fascinating. It is so thrilling to see a coded design appear on the screen in full color. But, I find, making an image appear is one … | |
I am trying to convert and sucessfully run my pettycash program in throughthe eclipse IDE in Java. First Ill show where Im at I am lost afterhere then ill show the petty cash program. I am not sure if I am on the right track and dont understand how to … | |
Is it possible to use files such as GIF files as a value in a Python Dict; that is, is it possible to use GIF files in a Dict and access them directly, rendering them to the screen via Tkinter. I have a group of GIF files I plan to … | |
Ok, so I'm gonna work on a program, and I want to enable a gui for it. I have a few questions though... Question: Are there any out there that wont need a class structure? (I;ve never gotten them, and I'm working on them right now...) Question: How about easily … | |
Hello, I am working on a project that involves modifying a pygame game of space invaders. I have been trying to change the game into a space shooter. I am currently having difficulty right now with changing the levels. If my character does not destroy all the enemies in the … | |
Hello, I am having a problem showing a popup menu in my wxpython script on fedora 5 (fc5); this problem does not occur on xp. I am using wxPython-2.6.3.2-1.fc5, unicode version. I need to add an item to a popup menu after the user selects a file using wx.FileDialog, and … | |
Hello everyone, I'm new to python, but I do have some c and c++ experience, although not extensive. I was looking through the challenges for new people that is stickied at the top of the forum, and was going to work on the * box challenge. I'm going to have … | |
Hi all, We just hit functions, and I assigned my students to write ten short functions to do things like convert Fahr. to Cels., etc. My "brilliant" :rolleyes: plan was to create a test suite and have them import their file and run the tests. Because the filename wasn't absolutely … | |
I have a data file with chemical names (one name per line) and want to load that into a Tkinter GUI listbox and then be able to select it by clicking on the line. Need some help. | |
I have the following sample code: [CODE]]import wx class TestFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title="tree example", size=(600,30)) self.tree = wx.TreeCtrl(self) root = self.tree.AddRoot("Example") items = [ "test1", "test2", "test3",] self.AddTreeNodes(root, items) self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded, self.tree) self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed, self.tree) self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged, self.tree) self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnActivated, self.tree) self.tree.Expand(root) def AddTreeNodes(self, parentItem, items): for item … | |
Hi, I've been working for the last time on a project on sourceforge called kika, that consists on a simple python script, and it's a sort of a plain text preproccessor that uses xml to define the proccessing to be done. I recently made a packaged release (deb and rpm) … | |
I am experimenting (playing around) with the Python Tkinter Gui, and wondered if there is a way to play a sound like from a .wav or .au file? | |
Hi, So it seems my self-teaching experience isnt going as well as i hoped. Every time i think im starting to understand something new pops up that halts me in my tracks :-) lol Was wondering if someone could just give me a quick pointer in the right direction of … | |
Hi i am making a simle gui using wxpython and here is the script [code] import wx class bide(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "just a test", pos=(0, 0), size=wx.DisplaySize()) panel = wx.Panel(self, -1) statusBar = self.CreateStatusBar() toolbar = self.CreateToolBar() #toolbar.AddSimpleTool(wx.NewId(), images.getNewBitmap(),"New", "Long help for 'New'") toolbar.Realize() menuBar = wx.MenuBar() … | |
I know that Pyhon compiles source code to a Byte Code before the interpreter works on it. What does this Byte Code look/behave like? | |
I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation? | |
Hi all, Platform: winxp Version: Python 2.3 I have a task of reading files in a folder and creating an one excel file with sheets, one sheet per file, with sheet named as filename. I am facing problem in handling special characters. I am using XLRD and XLW package to … | |
Which Graphics User Interface (GUI) would you recommend for a beginner? I have seen some examples of Tkinter, wxPython and GTK. | |
I have a color data file that gives the color name and its RGB values, for instance like this: [CODE] red RGB(255,0,0) green RGB(0,128,0) blue RGB(0,0,255) brown RGB(165,42,42) gold RGB(255,215,0) maroon RGB(128,0,0) [/CODE]I like to create a color dictionary from this file that looks like this: [CODE] {'red': (255,0,0), 'green': … | |
Here is my code: [php]# search for a file, and show all files found in that file's directory # delete them if wanted import os import pickle def file_find(folder): """search for a filename fname starting in folder""" for root, dirs, files in os.walk(folder): for file in files: # make search … | |
Hi everyone. Im having some real head-ache inducing issues with my code. I want to update a statictext label to display the value of a slider bar. Simple enough? Here is my code... [CODE=python]Speed_Slider_Panel = wx.Panel(Automatic_Control_Panel) Speed_Slider = wx.Slider(Speed_Slider_Panel, ID_SPEED_SLIDER, 0, 0, 10, style = wx.HORIZONTAL | wx.SL_AUTOTICKS) Speed_Slider.SetTickFreq(1, 1) … | |
When do you use a for loop and when to use a while loop. Are there other loop types in Python? Some of the slicing examples almost look like loops. | |
![]() | Another program. This one has you guess 5 letters and then gives you the word you're trying to guess as masked by -'s and has the letters you've guessed filled in. Ex: Say the word is "computer." If you guess "r," "s," "e," "a," and "m." It would say: [CODE] … |
I want to use valiable of linux system' bash by used python but I cannot do ti. when I use bash shell I can do : [COLOR=red]>echo $BASH_VERSION[/COLOR] [COLOR=#ff0000] >3.1.17(2)-release [/COLOR][COLOR=black]I want to use BASH_VERSION by use python.[/COLOR] Please answer for me THANKS. | |
![]() | So, I'm trying to make a program that works with Newton's method. I want the program to take in two formulas and a guess and then follow this pattern. This is the pseudocode/python (I kinda did both): [code] [B]def[/B] newtonIterationFunction(x) [B]return[/B] x - (function1) / (function2) get function1 get function2 … ![]() |
Hi everyone. Would really just like someone to take a look at what ive done and tell me how many horrible faux-pas ive made :-) I'm trying to teach myself the language as im going along which is making it hard to conform to any standards. I know there are … | |
I have a file of sentences similar to this: [CODE] Tom ate his Apple. Frank shoveled Snow. Henry drove a Truck. [/CODE]I would like to prosess each sentence so it only retains the capital letter in the first word, every other word in the senetnce should be lower case. The … ![]() | |
![]() | So my idea for this program was to take data from a file and compiling it into a schedule type thing.... Comments? Again...for learning purposes, I'd love to see suggestions for content, efficiency, and techniques. [php] # Get data from schedules.txt import string f = open("schedules.txt","r") schedule_rawdata = f.readlines() f.close() … ![]() |
I am trying to get to grips with treeviews in pygtk/gtk and am stuck on setting the alignment of the columns. No matter what I try I cannot change the alignment[IMG]http://ubuntuforums.org/images/smilies/eusa_wall.gif[/IMG] Here is the code I found on the web which I am using to change different lines to see … | |
Hello to all geeks out there, i was just wondering which scripting language out there is capable of achieving everything a scripting language is supposed to do. I know there is no such thing as "best" in software development circles but just wanted to know from all the experienced people … | |
hi everyone......... I have a task, I have fragmented the task into subtask. I have planned to create a class to each subclass and one parent class to handle the sub tasks. Each subclass are saved in seperate file and all my subclasses and parent class are placed in the … | |
Well, I actually succesfully completed my first complete program in python, and I didn't use the forum for help, I stuck it out and figured it out on my own. After spending about two and a half hours getting all these make shifts loops right, I feel pretty darn good … ![]() | |
When using the Py2exe program snippet given in [URL="http://www.daniweb.com/code/snippet499.html"][COLOR=#800080]http://www.daniweb.com/code/snippet499.html[/COLOR][/URL] I get the following error message: Traceback (most recent call last): File "C:/Python24/hate me/p2e_test1.pyw", line 29, in -toplevel- console = [{"script": 'hateme2.pyw'}] ) File "C:\PYTHON24\lib\distutils\core.py", line 166, in setup raise SystemExit, "error: " + str(msg) SystemExit: error: command 'C:\PYTHON24\PYTHONW.EXE' failed with … | |
Hi, I have created the following code to check a list and then determine which is true then update the variables associated with the correct if else statement. My problem is it doesn't update any of the variable even if true. As you can see, the var ch should be … | |
I like to create a structure in Python, something like: [code]solvent_name boiling_point melting_point flash_point [/code]I need to search and sort this structure. How can I best do that? | |
I have created a project using Jython (there was no bug in compling it by my IDE) I also have read the topic named [B]Py2exe help [/B](Ene Uran---Oct 23rd 2006 6:43 pm) and I can tell you that it really helped me so much. But in this project, I cannot … | |
Hi, I've just installed python & wxpython on my university computer. I went to run a script that was working just fine on my computer at home last night and i am greeted with this message: [quote] Traceback (most recent call last): File "C:\Documents and Settings\d22601\My Documents\Project_4\Python Files\Sequence Driven Controller.py", … | |
So I wanted to write some code to provide a framework for math quizzes. Among other things, I wanted to be able to show LaTeX-like output on a canvas. But first, I just wanted to get the canvas showing simple text. Part of the code: [php] def get_level_string(self): return self.f1.level_text.get() … | |
Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321. | |
My fiance is having a birthday in less than 20 days. I am therefore trying to create a program for her (trust me, it is not intended to be the only gift) to play around with, and hopefully enjoy. The only problem I am having so far, is that when … ![]() | |
Hi, I have a card class and deck class. The cards are in suitList rankList. I call the cards from a file cards.txt and split them into the above. I need to import the cards.txt and then shuffle them. I have the following code: def shuffle(self): import random nCards = … | |
I am trying Vegaseat's suggestion in one of my threads to use shuffled lists for combat in my text adventure. He suggested creating two lists, myhit_list[1, 0, 2, 0, 3, 0, 0, 1] and monsterhit_list[1, 0, 2, 0, 3, 0, 0, 1] and using random.shuffle(myhit_list) and random.shuffle(monsterhit_list) iterated with "I … | |
Hi, I finding difficult to execute this program. The wx.Notebook i created is coming on the splitted frame(self.p2). How do I that. I am started to learn wxPython, and when I run the code, the code doesnot close gracefully, it throughs me an error. "pythonw.exe has encountered a problem and … | |
Hey guys, I'm making a CMS for my website with python. I was wondering if anybody could give me some insight on (perhaps) an OS function that will copy a file from one folder and 'paste' it in another. thanks!:cheesy: Alright...I couldn't find anything as far as the os module … | |
Hi guys! Im new to this forum so go easy on me :-) I've got a background in C programming and have recently moved to Python for a GUI project im working on. So far im loving it - compared to VC++ wxPython is pure bliss. Im having a slight … | |
![]() | I'd like to flip the keys and the values in a dictionary. Say I have this dictionary: [php] positions = {'secretary' : 'Jessica', 'IT manager' : 'Matt', 'sales worker' : 'Linda', 'boss' : 'Chris'} [/php] and I want this: [php] employees = {'Jessica' : 'secretary', 'Matt' : 'IT manager', 'Linda' … |
Okay, I just learned that in order to call a program I made in python, say, myfile.pyw, into a seperate program (say, other.pyw) I would use [code]execfile('myfile.pyw')[/code] instead of [code]import myfile.pyw[/code]. I did that, and get one of those ever so helpful traceback errors saying that 'start', the user input … | |
hi, i am making a gui, which looks like excel sheets. i want to give the user the facility of adding rows/columns at the run time. there is some initial size, but that can be increased any time during the executation of the code. what i have tried, is that … |
The End.