15,406 Topics

Member Avatar for
Member Avatar for pymatio

I have this html: [CODE] <html> <body> <form action='super.py'> <input type=text name=person value="New User" size = 15> <input type=submit></form> </body> </html> [/CODE] & this python script: [CODE] <html> <body> <form action='super.py'> <input type=text name=person value="New User" size = 15> <input type=submit></form> </body> </html> matio@matio-desktop:~$ cat /var/www/py/super.py #!/usr/bin/env python import cgi …

Member Avatar for shadwickman
0
154
Member Avatar for JDCyrus

Hi. I'd like some help with a program that runs over a network. My program uses queue-based distributed computing. Because the computers are all on a LAN and differ greatly in processing power, they receive objects to process only when they request them. (Some can process more than one object …

0
61
Member Avatar for sravan953

Hey, I have a simple progam at hand....what I need now is a WYSIWYG(What You See Is What You Get) GUI Editor with which I can create good user interfaces without(or with very less) coding! Any ideas for such a program? Thanks

Member Avatar for sneekula
0
2K
Member Avatar for gudivada213

[code] #!/usr/bin/env python import MySQLdb file=open("capgps.txt",'r') #Open database connection db = MySQLdb.connect("localhost","root","8868","myproject") # prepare a cursor object using cursor() method cursor = db.cursor() #line is like below #$GPRMC,111503,A,0833.6323,N,07652.7685,E,0.1866,256.540,220609,,*2A for line in file: data=line.split(",") if data[0]=="$GPRMC" and data[2]=="A": if data[4]=="N": latitude=str((data[3])/100.0) else: latitude=str((-data[3])/100.0) if data[5]=="E": longitude=str(data[5]/100.0) else: longitude=str((-data[5])/100.0) linedata = {'time':data[1], …

Member Avatar for gudivada213
0
5K
Member Avatar for bryancan

I have a potentially very large csv file that I need to read in and display, but only a few records at a time. I want to be abe to page thru the file using offset and records variables. What I have is the following, but it really doesnt work …

Member Avatar for jlm699
0
149
Member Avatar for dantheman3141

Hello. I have come across many scripts for rebooting remote computers using python, but what about the computer the script is running on? If possible, I would also like my script to run in the background so the little cmd box is not visible. Thanks in advance for your help.

Member Avatar for dantheman3141
0
886
Member Avatar for shadwickman

If anyone is still interested in those old, nostalgic text-based games to run in the console, there's Python Universe Builder by Joe Strout. Yes, it's a dead project as the last release dates back to 2006, but it still works fine if anyone is interested. On the [URL="http://py-universe.sourceforge.net/"]Sourceforge page for …

1
116
Member Avatar for rasizzle

Hey all, Here is what I'm trying to do. I have a list whose output is: [['4/18/94', '29.125', '442.46'], ['4/19/94', '29.336', '442.54'], ['1/20/04', '75.175', '1138.77'], ['1/21/04', '75.711', '1147.62'], ['1/22/04', '75.595', '1143.94']] Item [1] in each list, the middle item, is the number I want to focus on. Currently, I have …

Member Avatar for rasizzle
0
104
Member Avatar for hughesadam_87

Hey guys, I have been trying to search for this answer on online tutorials, but cannot figure out just what I am doing wrong. I have a list of names, and some of them have the character '/' For example: [CODE]list = [adam, bill, jon/juan][/CODE] Because later in my code, …

Member Avatar for hughesadam_87
0
131
Member Avatar for happymadman

Is there an easy way to handle input from an entry box, in my project I am working on I have to call functions twice which ends up making a large mess of everything. Like if I call the [code=python] import tkMessageBox from Tkinter import * def yes_no_ask(answer): guidisplay.actiondisplay.configure(state=NORMAL) guidisplay.actiondisplay.insert(INSERT, …

Member Avatar for woooee
0
180
Member Avatar for sravan953

Hey guys! I just wanted to make a simple Python Keylogger to know whether some on is fiddling with my laptop while I'm away or not...also, I want it to write the keys pressed to a file... Oh, and, do to this is pyHook easier or Threading? And, BTW, what …

Member Avatar for sravan953
0
270
Member Avatar for happymadman

So I have this simple list and scroll bar combo and I have been trying to make it stay at the bottom of the scroll bar as the text is added so it looks like the scroll bar is just to look back over the previous text. Like in a …

Member Avatar for kolosick.m188
0
108
Member Avatar for txwooley

I have written a poker game in Python and have it fairly well finished. My hang-up now is an option to play again. Most of the game is in a function called playHand() which re-runs as long as you still have money, but if you lose all of your money, …

Member Avatar for txwooley
0
332
Member Avatar for MONODA

Hello, I am not sure if anyone will understand what I am asking for, but here goes anyway: I am looking for a way to generate a list of tuples with random values; something like the range function except I want to have a list of tuples rather than integers. …

Member Avatar for MONODA
0
10K
Member Avatar for hughesadam_87

Hey everyone, I tried a site search but it turned up cold. Has anyone here ever written a small method to take a list of names and sort them in alphabetical order? If so, would you mind posting it up, or directing me to a tutorial that would explain this …

Member Avatar for lllllIllIlllI
0
96
Member Avatar for Jintu

Write a Python program to show the temperatures starting at zero degrees Celsius, up to 100 degrees Celsius, in steps of 2 degrees, with the corresponding Fahreneit temperature shown in the next column. Temperatures should be shown as floating point numbers to two decimal places. Use a for loop for …

Member Avatar for vegaseat
0
233
Member Avatar for sedampatil

I am new to python program, don't know much about the syntax of python. I have written a program which will extract the csv data as below. <html> <body> import csv, sys filename = "inputfile.csv" reader = csv.reader(open(filename, "rb")) #rownum = 0 try: for row in reader: #if rownum == …

Member Avatar for shadwickman
0
196
Member Avatar for bluetie

Hi, i would like to know if someone can help to sort out a doubt aboty python, first of all i'm pretty new to python. [B]Problem description:[/B] the programs i wrote do not run in the same way in console than script, if i type the whole program in the …

Member Avatar for vegaseat
0
77
Member Avatar for funfullson

hello all. I have python 3 and want use mysql but i dont find mysqls modouls please say me a link.

Member Avatar for Stefano Mtangoo
0
88
Member Avatar for sravan953

Hey guys, I use Python 2.6.2, and have made a program; here's the code: [CODE]import subprocess import time def open_program(): time.sleep(s) print 'Opening the program...' subprocess.call(c) h=input("Time: ") c=raw_input("Enter the full location of the program you want to open after the desired time: ") s=(h*60*60) open_program()[/CODE] I also have some …

Member Avatar for Stefano Mtangoo
0
232
Member Avatar for rasizzle

Hey guys, I'm trying to create a buy and sell program where I have two lists of numbers. Eventually I want to shorten the lists so that the program buys at a lower number, and sells at a higher number, ignoring all other numbers in between. The solution would be …

Member Avatar for shadwickman
0
316
Member Avatar for Nidhi G

Hi I wish to write a program that will perform some action on a key press event but if there is no key press in a certain period of time say 10 seconds, it should display an error message and exit. I am working on windows and am using the …

Member Avatar for Hummdis
0
320
Member Avatar for harsha_kusam

Hi All, We have beenn migrated from 9i to 10g and one of our python script is still pointing out to 9i libraries [B]import cx_Oracle[/B] when it's trying to import this library my script is failing ImportError: ld.so.1: python: fatal: libclntsh.so.9.0: open failed: No such file or directory Could some …

0
73
Member Avatar for harsha_kusam

Hi All, We have beenn migrated from 9i to 10g and one of our python script is still pointing out to 9i libraries [B]import cx_Oracle[/B] when it's trying to import this library my script is failing [B]ImportError: ld.so.1: python: fatal: libclntsh.so.9.0: open failed: No such file or directory[/B] Could some …

Member Avatar for harsha_kusam
0
112
Member Avatar for tomtetlaw

i am making a game and i am getting a strange error heres the relevant code [code=python] items = {'sword':['sword', 3, 15], 'axe':['axe', 5, 25], 'bow and arrow':['bow and arrow', 4, 20]} for item in items: print items[item[0]] print '\tprice:' + items[item[1]] print '\tdamage:' + items[item[2]] [/code] Heres my error: …

Member Avatar for woooee
0
137
Member Avatar for Kenny.Devon

Hi forum, I'm a very old dog trying to learn some new tricks, and could use some help. I want to do some sophisticated web page scraping which involves, among other things, analysing the [U]format[/U] attributes of web page text. The formating of course can be specified inline using HTML …

0
49
Member Avatar for reedie

All, i have a pretty simple task but for some reason i cannot for the life of me figure out how to do it in Python. I have a matrix of numbers, this matrix has a variable number of rows depending on the dataset but always 30 columns. first things …

Member Avatar for sneekula
0
139
Member Avatar for MONODA

Hello, I am writing an application which uses the trig functions of the math module in python but for some reason, the float values that some of the calculations return are obviously incorrect. for example [code=python]math.cos(90*math.pi/180)[/code] returns 6.1230317691118863e-17 rather than 0. Does anyone know of a way which I cant …

Member Avatar for MONODA
0
306
Member Avatar for Zaffron

So I have been playing with classes, seeing that they are more efficient than globals, and I wrote this hopefully simple test program to see if I properly reverse engineered tetlaw's simple rpg. For the life of me I cannot figure out what is wrong with it. If an expert …

Member Avatar for Zaffron
0
103
Member Avatar for abhigyan91

hey i just started python.. i know this is a useless stupid program but i still cant get it right..:( here i want the user to enter date in dd/mm/yyyy fashion and return the date in words. eg. 12/12/1912= 12th December,1912 but it doesnt work.. it only works for 29 …

Member Avatar for sneekula
0
108
Member Avatar for jcmeyer

Let's say a user of my application opens two or more MDIChildFrames. How can I get access to any one of the child frames? If I keep track of the names of the child frames in a list is there a way to use the name to call upon a …

Member Avatar for jcmeyer
0
89
Member Avatar for jcmeyer

When I run this code: [CODE]sql = "SELECT Name FROM nameDatabase" self.cursor.execute(sql) list=self.cursor.fetchall() print list[/CODE] I get: >>> [(u'Joe',), (u'Katie',), (u'Bob',), (u'Ian',)] However, if I try to make a SingleChoiceDialog with wxpython it does not like that list. Is there any way to get those values in a so it …

Member Avatar for jice
0
112
Member Avatar for rustysynate

I tried the first post on wxpython by fuse. The code is as follows # import wx # # always add this line, or your code won't compile - the wx module contains the GUI code you'll use # """The start of our wxPython GUI tutorial""" # # app = …

Member Avatar for rustysynate
0
176
Member Avatar for besktrap

Hi all. Is there any way that if I give python a string, it can convert it into code? Example, say I am given this string: [CODE=python]string = "Class( 0,100 )"[/CODE] Now I want to convert it into code: [CODE=python]Class( 0,100 )[/CODE] Any ideas? Thanks.

Member Avatar for abhigyan91
0
12K
Member Avatar for rupeshpradhan

I am using an array 'array_studentDetails'. This array will be used by other functions after it is initialized. Should I make it a global array as I have done in this example OR should i return the array to the calling function and pass it on to the other function …

Member Avatar for shadwickman
0
154
Member Avatar for rustysynate

Hi, I am trying to build a rectangle which changes its size with respect to the input given. My problem is that on using the[B] surface.blit[/B] function the object start to replicate when the size of the screen is greater than the object. So many rectangle appear instead of one. …

Member Avatar for rustysynate
0
156
Member Avatar for rawsilk

I am trying to write a program that retrieves data from a site. However the url automatically displays the most recent data (from within the past month). I want to receive the data for the past year. On the page there is the option of choosing a previous data to …

0
41
Member Avatar for The Champ

Question: Prompt user to enter ten two digit number. The program should compute the sum of all positive values and print the sum of values added. Over here what I had done is: Chosen list to store initial all the ten numbers. First I have to initialize the list with …

Member Avatar for shadwickman
0
107
Member Avatar for sravan953

Hey guys... I would like to know how we can mask text input...I have read in some websites that we have to turn off the 'echo', but as far as I know, it only works in Linux....so what the alternative for Windows? I tried the getpass.getpass but in vain! :( …

Member Avatar for sneekula
0
2K
Member Avatar for Surge591

Hello, I would like to know how I can call a program ('example.exe') which runs as a batch process in a new command prompt and control the inputs and outputs from within a python script. I have tried the following code: import subprocess p = subprocessPopen('example.exe', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT) …

Member Avatar for vegaseat
0
2K
Member Avatar for firegenius

Hi everyone, I am trying to build application with Tkinter like a wizard, i'll use background image for application, and put some text and image to application window. But i couldn't do that. When I use background with that code, text labels background color is blocking background view. Is there …

Member Avatar for firegenius
0
4K
Member Avatar for aakaashjois

I just got Linux Mint 7 and I installed IDLE. I want to know if there is "drag and drop"(like WYSIWYG interface) python GUI builder for Linux?? Thanks in advance

Member Avatar for shadwickman
0
133
Member Avatar for andriod

Hello, I am new to the Python language and I am having difficulty with the print statement. For example, when I type print 4, or print "Hello", i get an error. The error message is: [CODE]SyntaxError: invalid syntax (<pyshell#2>, line 1)[/CODE] When I use python on other computers, the print …

Member Avatar for andriod
0
134
Member Avatar for Zidane

Hi. I just got started using wxPython and I was wondering how to create a button which transferred the user from one screen to another. To kind of illustrate what I mean, I created two files, 'main.py' and 'newgame.py'. I've made a button called 'New Game' in the main.py file, …

Member Avatar for vegaseat
0
108
Member Avatar for Jintu

Write a program to read a list of non-negative integers, and to display the largest integer, the smallest integer, and the average of all the integers. The user indicates the end of the list by entering a negative sentinel value (use -1) that is NOT used in the calculations. The …

Member Avatar for Jintu
0
406
Member Avatar for sravan953

Hey, I am thinking of making a Facebook application, where you open the app, enter your login details, and it passes the data and logs into the acc, and gets the HTML code, writes it to a .html file and opens it....I don't know how to make it pass the …

Member Avatar for firegenius
0
79
Member Avatar for hughesadam_87

Hey guys, I wrote a file the other day, which reads in data, adds a column, and then reads the data out to a specific file. I thought everything was working great, with all of your help; however, I am now running into another problem. The output data looks like …

Member Avatar for sneekula
0
89
Member Avatar for jcmeyer

I know how to store data into a database if I know the value of what I am storing. For example: [CODE]sql="INSERT INTO nameDatabase (name) Values('Joe')"[/CODE] However, I want to be able to store data that I do not know the value of into my database. So I can prompt …

Member Avatar for jcmeyer
0
121
Member Avatar for Zaffron

So I made a combat system, and for the life of me i cannot figure out how to make it start automatically. It does run, but it ignores the function at the beginning and doesn't run it. There is a similar text adventure I looked at as an example for …

Member Avatar for Zaffron
0
139
Member Avatar for rasizzle

[code] import os import csv ifile = open("C:/Python26/testdata.csv", "r") [/code] here is the error i get: Traceback (most recent call last): File "C:/Python26/06_June_2009/testhenry.py", line 4, in <module> ifile = open("C:/Python26/testdata.csv", "r") IOError: [Errno 2] No such file or directory: 'C:/Python26/testdata.csv' I have no clue what to do. I can't read …

Member Avatar for rasizzle
0
157

The End.