15,190 Topics

Member Avatar for
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
326
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
186
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
48
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
210
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
115
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
120
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
188
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
184
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
199
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
111
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
146
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
133
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
176
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
116
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
462
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
300
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
142
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
291
Member Avatar for mruane

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 …

Member Avatar for Ene Uran
0
133
Member Avatar for JyotiC

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 …

Member Avatar for JyotiC
0
84
Member Avatar for macca1111

Hi, I have a class for Cards, that the suits and ranks are placed in suitList = ("Hearts","Diamonds"... rankList = ("","Ace","2"... however I need to read these values from a file instead. Once I read the file I need to be able to sort the suits and ranks then print …

Member Avatar for macca1111
0
105
Member Avatar for macca1111

Hi, I need some help on how to read a file 2 h 3 s 6 d Ace s ... Importing this into Python and then sorting and printing in order. I have done some work, yet I can never seem to get the data to Python and split it …

Member Avatar for macca1111
0
309
Member Avatar for macca1111

Hi, I have the following code working fine. What I would like to try is when n cards are randomly selected, to print the cards in a graphics window. I want to add a new class draw(self,win,center) that displays the card. I have a set of bmp cards. [php]# Import …

Member Avatar for Zonr_0
0
1K

The End.