15,181 Topics
| |
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, … | |
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, … | |
| 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 … |
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 … | |
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, … | |
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. … | |
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 … | |
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 … | |
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 == … | |
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 … | |
hello all. I have python 3 and want use mysql but i dont find mysqls modouls please say me a link. | |
| 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 … |
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 … | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
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. | |
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 … | |
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. … | |
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 … | |
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 … |
The End.