14,945 Topics

Member Avatar for
Member Avatar for sneekula

I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation?

Member Avatar for bumsfeld
0
127
Member Avatar for katharnakh

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 …

Member Avatar for bumsfeld
0
148
Member Avatar for sneekula

Which Graphics User Interface (GUI) would you recommend for a beginner? I have seen some examples of Tkinter, wxPython and GTK.

Member Avatar for vegaseat
0
431
Member Avatar for sneekula

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': …

Member Avatar for sneekula
0
182
Member Avatar for Matt Tacular

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 …

Member Avatar for sneekula
0
154
Member Avatar for MarkWalker84

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

Member Avatar for vegaseat
0
319
Member Avatar for sneekula

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.

Member Avatar for fireworks-style
0
183
Member Avatar for Mouche

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

Member Avatar for vegaseat
0
10K
Member Avatar for mushroom_jar

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.

Member Avatar for bumsfeld
0
46
Member Avatar for Mouche

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 …

Member Avatar for Mouche
0
208
Member Avatar for MarkWalker84

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 …

Member Avatar for bumsfeld
0
113
Member Avatar for sneekula

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 …

Member Avatar for Mouche
0
119
Member Avatar for Mouche

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

Member Avatar for Mouche
0
187
Member Avatar for pachjo

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 …

Member Avatar for pachjo
0
181
Member Avatar for katharnakh

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 …

Member Avatar for vegaseat
0
185
Member Avatar for mruane

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 …

Member Avatar for Mouche
0
109
Member Avatar for mruane

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 …

Member Avatar for mruane
0
145
Member Avatar for macca1111

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 …

Member Avatar for vegaseat
0
127
Member Avatar for sneekula

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?

Member Avatar for jbennet
0
230
Member Avatar for Gorilla

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 …

Member Avatar for bumsfeld
0
174
Member Avatar for MarkWalker84

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

Member Avatar for bumsfeld
0
115
Member Avatar for jrcagle

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

Member Avatar for bumsfeld
0
92
Member Avatar for sneekula

Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321.

Member Avatar for ghostdog74
0
460
Member Avatar for mruane

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 …

Member Avatar for Mouche
0
278
Member Avatar for macca1111

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

Member Avatar for macca1111
0
179
Member Avatar for mruane

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 …

Member Avatar for vegaseat
0
109
Member Avatar for katharnakh

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 …

Member Avatar for vegaseat
0
135
Member Avatar for DarkFlash

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 …

Member Avatar for Ene Uran
0
92
Member Avatar for MarkWalker84

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 …

Member Avatar for MarkWalker84
0
431
Member Avatar for Mouche

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

Member Avatar for Ene Uran
0
199

The End.