15,175 Topics
| |
Hey, I am new to python and was wondering how to import modules? I want to import the datetime module. Do i have to download it from a website? Thanks | |
Hi all, I need to set some variables via Pysnmp which take 'unsigned int' only. Is python int by default a 32 bit- signed int? How do I convert it into 16 and 8 bit- unsigned ints? I need to read two registers consequently( which are of 8 bits each) … | |
Well i just bought "python for the absolute begginer" and title says it all. The task at the end of the chapter wants me to print "Game over" and then write something like '\n\nPress the enter key to exit.' which i causes the program with double click however this is … | |
Hello i am new to python and i am getting increasingly worried. I have a deadline on tuesday and i have to make a game in python. I have tried and tried but i am useless at python. Therefore i have decided to finish off a piece of code that … | |
I am working on a project that requires me to clean data from a series of RS-232 instruments. These instruments can have a different version number, and output format (both of which can change the expected ouput). On top of that there are flags that determine if certain fields are … | |
I have an issue with my python code and in some cases, users are getting the "IndexError: list index out of range" message. However, I'm not getting the error and it's not happening with every case so it's a bit confusing. I did search the site and found this article … | |
print "Hello, World!" ;) Hi, everyone, Venku (a.k.a Python Newb) here. I just kind of randomly opened up Python today (I do that a lot), and I decided I would finally ask this: What does the "is" statement do in Python 2.7.1 (if the ver# matters)? I checked out the … | |
HI, I have written a small program that uses a while loop to calculate how many years it takes for an investment to double given an interest rate: However, I think there is something minor wrong with the calculation for years, since when testing I put in 100% it should … | |
[CODE]#created by Jaron Graveley #April 26th, 2011 #This program completes reservations for Jon Von Poechman’s airline in an easy to use program #variable list: #i=counter used to limit the number of seats present on the diagram #n= counter to display the row number on the diagram #num_booked=counts the number of … | |
Hello, I'm re-creating the game Riveter using wxPython. I have all the basic fundamental groundwork done, and now I'm just trying to polish certain aspects. I am, however, having problems removing buttons from the screen. I have a panel, with a vertical sizer inside of it. Inside of that vertical … | |
i've a problem to split a joining multipe type of file here's my code for joining two diff type file, pict file (jpg) and audio file(mp3) an ouput is pict file contains audio file in it. a problem is how do i check this file is joining file or not? … | |
Hey all, I'm relatively new to python, just started learning it about a week ago. I've been working on making some small scripts to make learning easier for me. This is a cypher script I've been working on that is based off of the order of letters used on a … | |
Hello friends, I searching for "Combination generator" and I found something but not this what I need me... I want to write a script who will generate all possible combination by given string and range of length. e.g. string = "daniweb" length_range (3, 5) The results should be: _____________ ddd … | |
I honestly have no idea what part of the code i messed up on. It says line 94 but there is nothing wrong with that line, i tried all i could do to fix it...maybe someone can help a bit? [ICODE]# Tic-Tac_toe # Plays the game of tic-tac-toe against a … | |
okay, i'm stuck on an assignment! (first post btw, so tell me if i'm doing anything wrong please :) ) okay, my assignment is as follows : Write some efficient and commented python code to do the following: Accept an input value between 33 and 126 and convert it to … | |
So essentially I'm prompting the user for two binary numbers. How can I add these together? I don't know how to get the 0b in front the the original input. If there is an easier way to do it, please let me know. #Prompt the user for two binary numbers … | |
hi, I have a images in bmp format and I would like to convert into dicom. I am not a professional in python or vtk. if you may have advice, please reply me. I have started like this but it does not work :(... file_in = 'C:/programfile/image.bmp' file_out = 'test1.dcm' … | |
hello every one i have a python file with two different classes class threaded rotation ..... ....... class optimizer ...... ..... i want to separate this two classes in to two different files optimizer.py and threaded rotation .py .... wat i want to do is import threaded rotation class in … | |
This is a part the extension module im writing for python using c++. ( The complete source is available as an attachment ) [CODE] #include <python2.6/Python.h> #include <iostream> #include <fstream> #include "structmember.h" using namespace std; typedef struct { PyObject_HEAD fstream file; } CppFileObject; static int CppFile_init( CppFileObject *self, PyObject *args … | |
Hmm - I was looking at the following code for a PyQt4 program: [CODE] import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() widget.resize(250, 150) widget.setWindowTitle('simple') widget.show() sys.exit(app.exec_()) [/CODE] Could someone please explain what sys.argv does/means, and what it means in this context. | |
I'm having another crack at python - and I am enjoying the clean simple syntax - but one thing I couldn't work out was how to read a line from a file until a '\t' character. How could I do this? It is a phone-book program and the data is … | |
Hi, I've posted two scripts that I would like to improve. The first one (SparePartsDemo.py) is a little utility that takes a .csv (.txt) data file exported from another application, builds a SQLite database,performs a request to select and sort records and write the results to a sqlite database file, … | |
Dear experts in Python, I have written a binary search method that receives a list of float and one new float item. It needs to look for the proper index for that item to be placed and return that index. To make it simple, I give an example: imagine a … | |
I was planning on writing code that would get stock data from the exchange and store it for use and analysis later. I'm new to programming and Python so I don't really know where to get started. Are there functions, modules, or techniques I should be aware of? So far … | |
Hi All I have a query about Numpy randn() function to generate random samples from standard normal distribution. I want to add some random samples using this function to my data and I want these samples must be in a range of 1 and -1. I using this function y … | |
Hi everyone. Well I've been trying to figure this out for a quite a long time now by looking at some examples and searching the web, reading some tutorials and so on, but I don't even know where to start yet. Can you explain to me about the sprites too … | |
Hi, just joined this website as you guys seemed like the perfect people to ask for help, I'm creating a database system using python for car rental with tables customers,cars,and rentals. The customer table is fine but on my add_cars() function which adds a new car it is showing some … | |
I've created a function which creates a new password. But I want a function to store it in a text file from which it will be called when the program is started. Also how do I make an edit or delete password function? As the password will have to be … | |
[B]!USING PYTHON 3.1![/B] [B]USING WINDOWS[/B] I never thought it could be so simple. However I should have clarified that it's a [B]1 character[/B] input. But the general idea is the same. Someone suggested that I explain what is going on better, so I'm going to do that. The function 'getch()' … | |
Dear All, I am very new to phyton and try to learn basis. I have a big application currently running in java. The application is a listener which lister to few thousand of gps devices which send data to it. The problem sometimes I notice some data goes missing because … |
The End.