15,185 Topics
| |
Hello, I have a wxPython interface to an application (.pyw). I want to be able to run the application also from commandline to start the application as a batch procedure with the desired parameters. If the application runs and parameters are available (sys.argv), I run, from the commandline without the … | |
Hi all, i need help on how to change a grid line((x1,y1), (x2,y2)) to another color. I have a 6 * 6 grid(black lines), made using pygame and i want to change the colour, with response to a mouse click on the coordinates. Is this possible? Below is the code … | |
I am trying to write a program to do the hill cipher technique of encryption. I am stuck trying to break the large array of numbers representing letters etc. into multiple smaller arrays with one column and two rows does anyone know how this could be done?? Here is the … | |
I'm writing part of a program that involves writing user generated information to a text file. [code]class MonsterStats: def __init__(self, name): self.__monName = name def setName(self, name): self.__monName = name def fileWrite(self): monFile = open('MonsterFile.txt', 'w') monFile.write(self.__monName) monFile.close() [/code] I wrote this to test it out: [code]import MonsterClass name = … | |
I'm not really to sure with using python and its object oriented features as Im better with java. Im not sure whether to put the functions inside the classes as i can't really seeing this making a difference. I will apply my code and any changes or guidence would be … | |
Hello to whom ever can help me out there. I have created a game where the player selects on a suit to bet. this suit will be shared among three dice. if the player gets his symbol shown up on all the dice he wins three times the bet amount, … | |
Well I decided to work on a GUI for this because I need the practice. However I ran into this weird problem. If I change line 67 from 1000 to 100 my program prints two of the last letter... [url]http://pastebin.com/d656cfd09[/url] (with 1000) [url]http://www.grabup.com/uploads/195f84b4dab3...f199.png?direct[/url] with (100) [url]http://www.grabup.com/uploads/8fd5d3d988ec...b568.png?direct[/url] That just makes no … | |
Hi, there I have been confused about format control of List. My problem is that I get strange format when exchanging List[-1] with List[-2] using a middle variable. My code is to handle a text file. Old code in a For loop is: [QUOTE]sinf.write('*element,type=s4r,elset=WSLAB\n') path4b2_value[0]=str(int(path4b2_value[0])+100000) path4b3=','.join(path4b2_value) sinf.write(path4b3)[/QUOTE] which produces a … | |
I'm having a little trouble running wxPython. I did a little Googling and didn't find a whole lot though. Here is a sample of what I'm trying to run... [ICODE]import wx app = wx.PySimpleApp() frame = wx.Frame(None, wx.ID_ANY, "Hello World") frame.Show(True) app.MainLoop()[/ICODE] This code is straight from the tutorial provided … | |
hi there, i'm using the PyArg_ParseTuple() function in my python bindings for some C code. the code i'm wrapping has two functions, one that returns a default value instead of an error if an error would have occurred, and one that returns an error. i simply want to use one … | |
How does one do the equivalent in Python of GridView in VB? I have a project with hundreds of different info cards with about several individual pieces of data to be tracked on each card. example of card: card 1 name: Zeus image: img1.png level:5 heirarchy:0 type: diety now imagine … | |
hey everyone, does anyone know the python command that forces the interpreter to go interactive? the situation i'm talking about goes like this: [LIST] [*] run script from command line [*] let all kinds of complicated nonsense execute [*] script runs the "go interactive" command [*] python dumps you in … | |
My friend and I play call of duty 4. He pwns me. I'd like to disable his keyboard in the middle of playing. | |
How do I take randomly generated numbers and print the average of the numbers? And how do should I go about printing how many even and odd numbers that were generated? Thanks | |
I created a little script using the datetime functions in python and am trying to convert this to a .exe using py2exe. When I try running this from someone else's machine I get an error message about calendare module not found This is the python [code]import datetime import calendar no_of_days … | |
Hi everyone. I need some help with a subprocess. My Python script uses the os.popen2 function to spawn a non-Python subprocess. Now it needs a way to send a Ctrl-C interrupt or something equivalent to the subprocess. Does anyone know how to do this? Thanks in advance! | |
hey all, I'm trying to integrate sqlalchemy into my project build rather than install it separate. so in my project i have "<project_dir>/lib/sqlalchemy/*" i put a the __init__.py in "lib" but when i try to do [icode] from lib.sqlalchemy import * [/icode] i get: [quote] --------------------------------------------------------------------------- ImportError Traceback (most recent … | |
First of all, forgive my naivete - I'm new to programming and trying to teach myself Python with the aid of the Internet and a book or two. My current problem that I can't find a solution to is hard for me to explain. First, I'll give the code I … | |
Greetings; Please, is there a 'python tool' of sorts (ide or whatever) that will convert [U]Python code to 'C' code[/U] . Thanks! | |
I'm having trouble with my programs for class. Program 1 Write a function that receives a list as its parameter and returns a list with the length of each element. In the main function print the returned list. [CODE]def elementLength(list): list = raw_input("enter list") return len(list) print elementLength(list)[/CODE] What it … | |
Hi. I have an xml file like this: [CODE=xml]<tree> <category title="Item 1">item 1 text <subitem title="subitem1">subitem1 text</fileitem> <subitem title="subitem2">subitem2 text</fileitem> </category> <category title="Item 2">item 2 text <subitem title="subitem21">subitem21 text</fileitem> <subitem title="subitem22">subitem22 text</fileitem> </category> </tree>[/CODE] I use ElementTree to parse this file and this works okay, however, I now need to … | |
So, for my assignment I have to make an image look like part of it was a green screen or blue screen or whatever you want to call it (what they use for things like weather forecasts on tv). So that means turning certain pixels blue/green/whatever. I can that much. … | |
Hi all! I have an drawing area inside a scrolled window. I use the following to redraw my drawing area: [CODE] myDrawingArea.connect("expose-event", self.view_expose) [/CODE] In function view_expose the redrawing is carried out. When I open my window the view_expose function is called all the time and my processor goes crazy! … | |
Hi, there I have resource lines and target lines here below resource lines: 1 J=2,7183 SEC=CON450X450 NSEG=2 ANG=0 56 J=7224,164 SEC=CON450X450 NSEG=2 ANG=0 Target lines: *element,type=b31,elset=CON450X4501 *element,type=b31,elset=CON450X45056 "elset=CON450X4501" in the target lines come from a combination of "1" and "SEC=CON450X450". Similarly, "elset=CON450X45056" in the target lines come from a combination … | |
Hi, there Thank you so much for reading my question. I have apart of a text file with a structure as following: LOAD NAME=LIVE TYPE=UNIFORM ADD=110 UZ=-4500 ADD=113 UZ=-4500 ADD=114 UZ=-4500 ADD=120 UZ=-4500 ADD=121 UZ=-4500 NAME=SIDL TYPE=UNIFORM ADD=110 UZ=-850 ADD=113 UZ=-850 NAME=CLADDING TYPE=DISTRIBUTED SPAN ADD=15470 RD=0,1 UZ=-4500,-4500 ADD=15471 RD=0,1 UZ=-4500,-4500 … | |
I can't seem to figure out what's wrong with this simple code. I have a user input and if it matches prints out 'That's good', if not prints out 'Too bad' but how can I get the input to ignore being case sensitive? [code] ans=raw_input("Are you feeling well today? ") … | |
[B][/B]Hello to all. I am getting more hurdles while trying for the validation for the login from. I did a small project , but i am unable to set the validation for the main login form. I am using some simple logics. [COLOR="Green"][B]try: import os import MySQLdb,md5 import bz2 import … | |
the topic is writing/reading text files, but i got this simple question. how do i make this program so it will look like this: [url]http://i39.tinypic.com/5554wi.jpg[/url] i can't figure it out. - to make it keep looping and asking "enter your name or break to exit" continue the question until the … | |
| hi again! at school we were learning about perfect numbers and i thought it would be useful to write a program to find them i currently have this code: [ICODE]b= 1 h= 1 factors = [1,] n = float(raw_input("what is the number?")) while h < n: if h*b == n: … |
Hi all, Is it possible to copy an object (instance) and manipulate the copy without affecting the original one. I mean, Suppose: D.node = 'Node' and D.child = {0:'child1',1:'child2'}. Now, copy D to D_c and put D_c.child={}. So, D should be kept as it is originaly, which means D.node = … |
The End.