15,175 Topics
| |
I am sorry, I had a thread similar to this, but I have encountered a different bug. [CODE=python]def rm_b(acts): print("DINING ROOM") print(descriptions.dining) acts={"north":no_exit, "east":rm_c, "south":rm_e, "west":rm_a, "sandwich":'inv_add(sandwich, acts)'} prompt(acts)[/CODE] The "sandwich":'inv_add(sandwich, acts)' will not work. Same for all of the items I wish to allow the player to pick up. … | |
I would like to destroy the second button by clicking the first I have also tried "return but2.Destroy() but everything returns an error message. Can anyone help? [CODE]import wx class DestroyButton(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "title") panel = wx.Panel(self) but1 = wx.Button(panel, label = "click me") but2 … | |
Hi there, I was wondering if anyone can give some advise/tips on this. My goal is to figure out the broadcast address. The way I think I should do is: [LIST] [*]get/detect the IP address and the subnet mask or CIDR [*]convert the mask to binary form [*]count the number … | |
Hey guys, So me and my friend are starting up a simple Text-Based-Post-Apocalyptic-Role-Playing-Game. Both of us have had 2 or so months of experience, we are no experts. So, I will appreciate any tips. I have been lurking these forums for a little while now, and decieded this is the … | |
im new to cgi scripting...im using python...and ubuntu... i changed apache2's default file to set the cgi directory to /var/www/cgi-bin...and there i i uploaded my simple cgi file...the cgi file runs perfectly fine when run through terminal...which means there is no error...but when i try to access it through a … | |
Could someone explain to me why this code will not print the 10th prime number? It says there is a syntax error on the fourth line (the x = range(3, math.sqrt(test_num)). It also says there is a syntax error on the sixth line (while prime_count < 10:). [code]import math test_num … | |
Hi there, I have a set of coordinates (data points) that I want to use Python3 to fit an exponential decay curve to. I've used this resource [URL="http://mathworld.wolfram.com/LeastSquaresFittingExponential.html"]here[/URL] as a base for building my program. The problem is, no matter what the x-value I put in is, the y-value ALWAYS … | |
The title explains most of it. at the point in the code where this frame gets created it immediately opens, closes, then segfaults, and the whole program dies. the program worked find before this frame was added and the only code using this frame from outside of it is the … | |
Hi so I made a program that uses 'Pygame', 'WxPython', and also I required a module from PyGame website which helps make a menu easier in pygame. I am knew to Py2exe and heard its the best one out there to make your .EXE file. I heard there are problems … | |
I learned Python and understand the mechanics to write scripts with functions and classes, etc. Most of my scripts run via the interactive prompt but I've done a little GUI programming to create some menus and buttons. I don't understand how larger programs are put together on a high level. … | |
Hi I'm using pysnmp 4.1.1.4a (yes, I know there's a newer version but it has the same behavior) and py2exe. When I execute a pysnmp oneliner, like this: [CODE] errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().nextCmd( cmdgen.CommunityData('my-agent', 'public', 0), cmdgen.UdpTransportTarget((self.IPaddress, self.Port)), self.keydict[ key ][0] [/CODE] I get this output: [CODE] File … | |
| I am using a Pwm TextDialog (which inherits from ScrolledText which inherits from Text). It is being used as a real time status pop-up window. A good deal of the status messages use a carriage return ('\r') at the end of the message as a way of conserving vertical space, … |
Hi I am new to the forums, and somewhat new to python. I'm trying to make a Text Based Adventure game. I don't have an error, but a bug. This is the code: [code]import descriptions inventory = [] gold = 0 acts = {"north":"hi"} def start(acts): print(descriptions.start) rm_a(acts) def rm_a(acts): … | |
Hello experienced python programmers! I come here in humble request of your guidance on my latest python endeavor. I'm writing my first program to make heavy use of lists within lists, and i've run into a rather unexpected problem. just for practice, I'm writing a program that simulates a simple … | |
Hi, I want to launch a java app from within python, and read back the test the java app writes in a command window. This is using python on windows. So, I have a basic java app which brings up a cmd.exe widow, and prints "hello world", waits for 5 … | |
I am using the following code to create a set of radiobuttons. The radiobuttons are created fine, but when it comes time to delete them, the buttons and text persist on screen. How do I go about ensuring that the radiobuttons get deleted? [code] import Tkinter class App(): def __init__(self): … | |
How to store a set of cooordinates , let us say 300 to array | |
ok. i am making this program called Human_Data to store peoples info on your computer. bwahaha. i need help with opening and reading peoples info, stored in a profile class. i am also confused with instances of classes. here is the code. [CODE]#----------------------------------| #Copyright Muffinware 2011 | #Human Data and … | |
Hi! I'm in the Environmental Horticulture department at the University of Florida and I'm trying to build an online, multiple-entry key to help students identify the plant families. I have permission to modify and build on a similar script that was written at Colby College, but the computer people there … | |
I can print whatever I want (definitely texts) by using following "Printer" class. However, it prints only in Black and White mode regardless original color of texts. Is there any way I can print color texts? [ICODE]#License: MIT import wx from wx import Printout, PrintData, PAPER_LETTER, PrintDialogData from wx import … | |
Hello, I am new to the programming game and have a question for you seasoned veterans: I have a data collection device whose API is c++ based. When I want to write a program whose first step is to initialize the system, I write "InitializeSystem(); " In a C++ IDE … | |
Im trying to call the two functions from the numbers class but it returns an error even tho i believe i have coded it correctly. i have played with the code but cant seem to get it working. [CODE] class main(): num1 = input("please enter a number") num2 = input("please … | |
Just curious how you got started. For me it was science class that used Python as the main tool. | |
I am working on a python application where most of the GUI is written in TKinter, but I need a data grid control like Excel. I know tktreectrl is supposed to do this but I am unable to get the latest version to compile. What I want to know is … | |
Hello! I need help to construct a regular expression in Python that will help me get the file name of a include directive in C++. I think that regular expressions are a good way to solve this problem, but I'm open to new ideas. Consider these following includes: [CODE] #include … | |
basically my application will move in 3d space based on input from the user. the model cannot be a simple shape so using vpython alone is not really possible. any other libraries you might suggest sirs? | |
[CODE]import os import fnmatch for l in os.listdir("C:\Bilder"): if fnmatch.fnmatch(l, 'IMG*'): l.replace(l, "HH") print l[/CODE] I am trying soemthing like this, but it is not working. Can anybody help me? Cheers | |
Hi, I can connect to an energy-meter (Baudrate 300!) and the logfile with 228 lines comes slowly in.[code=Python]line = ser.readline(eol='!') print line [/code] If I use the above code, the complete logfiles is shown. And if I parse separatly saved logfiles with match, it sorts out the right values into … | |
file transfer can be easily done with python xmlrpc. it is very simple and spans a very few lines of code.. :) pls [URL="http://1024bitez.blogspot.com/2011/02/simple-ftp-program-with-python-xmlrpc.html"]check this link to see how i done it...[/URL] | |
Hi, I recently set about making a simple application using python with some 3d components, i switched from PyOpenGL, because it was a little bit to complex for what I wanted to do, to VPython, which based on the YouTube video's looks very easy and simple... which is exactly what … |
The End.