15,175 Topics
| |
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 … | |
| 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! :( … |
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) … | |
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 … | |
| 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 |
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 … | |
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, … |
The End.