15,175 Topics

Member Avatar for
Member Avatar for UnitedForLife

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

Member Avatar for vegaseat
0
103
Member Avatar for novice20

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) …

Member Avatar for vegaseat
0
9K
Member Avatar for Darion

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 …

Member Avatar for Darion
0
361
Member Avatar for confusedman

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 …

Member Avatar for TrustyTony
0
305
Member Avatar for swinchen

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 …

0
137
Member Avatar for pjconrad

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for Venku Tur'Mukan

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 …

Member Avatar for Venku Tur'Mukan
0
793
Member Avatar for macca1111

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 …

Member Avatar for NoddyNUIG
0
4K
Member Avatar for jarograv

[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 …

Member Avatar for jarograv
0
247
Member Avatar for dare599z

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 …

Member Avatar for dare599z
0
2K
Member Avatar for DYP

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? …

Member Avatar for DYP
0
173
Member Avatar for Speleo

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 …

Member Avatar for predator78
0
270
Member Avatar for Krstevski

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 …

Member Avatar for Tech B
0
113
Member Avatar for katscandybar

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 …

Member Avatar for woooee
0
153
Member Avatar for kannibalkiwi

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 …

Member Avatar for woooee
0
161
Member Avatar for NumeroUno123

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 …

Member Avatar for britanicus
0
160
Member Avatar for mscbme

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' …

Member Avatar for britanicus
0
244
Member Avatar for pavanteja1987

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 …

Member Avatar for britanicus
0
194
Member Avatar for britanicus

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 …

0
75
Member Avatar for Shift_

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.

Member Avatar for Gribouillis
0
122
Member Avatar for Shift_

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 …

Member Avatar for Shift_
0
738
Member Avatar for J-M DESMETTRE

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, …

0
617
Member Avatar for group256

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 …

Member Avatar for group256
0
181
Member Avatar for Thisisnotanid

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 …

Member Avatar for Thisisnotanid
0
461
Member Avatar for pythonbegin

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 …

Member Avatar for pythonbegin
0
2K
Member Avatar for Dan08

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 …

Member Avatar for TrustyTony
0
3K
Member Avatar for Dude2714

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 …

Member Avatar for woooee
0
189
Member Avatar for Dude2714

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 …

Member Avatar for TrustyTony
0
137
Member Avatar for AutoPython

[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()' …

Member Avatar for TrustyTony
0
7K
Member Avatar for newbie14

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 …

0
89

The End.