15,190 Topics

Member Avatar for
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
161
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
739
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
635
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
464
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
190
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
Member Avatar for HiHe

This works with Python 2.7 [code]class B: def __init__(self, arg): print(arg) class C(B): def __init___(self, arg): super(C, self).__init__(arg) c = C('abc') # abc [/code]Here super() gives a TypeError: must be type, not classobj [code]from math import pi class Circle: """with Python3 object is inherited automagically""" def __init__(self, r): self.r = …

Member Avatar for HiHe
0
279
Member Avatar for vegaseat

Probably the simplest way to get into multimedia with Python is the webbrowser module. This works with both Windows and Unix systems, and selects the default browser you have installed. But that is not all: if you give it the name of a multimedia file it will select the default …

Member Avatar for e-papa
4
1K
Member Avatar for Thropian

I'm trying to get sounds to play from python. I've tried Winsound, snack, and now Pygame. Winsound only seemed to play windows preset sounds (which aren't so useful), snack did nothing, and Pygame is raising a memory error on a 2 second mp3. Is there something obvious I missed in …

Member Avatar for vegaseat
0
238
Member Avatar for koveras vehcna

Hi everyone, I have created a random text generator -ok, not so random, works with certain parameters- and at times it runs slowly. I looked up on the internet about speeding tricks and applied some of them that looked concurrent with my code piece. The code however, is still slow …

Member Avatar for woooee
0
205
Member Avatar for 650U

I have a question in Inheritance(Python): Write a class named Person with data attributes for a person's name, address, and telephone number. Next write a class named Customer that is a subclass of the person class. The Customer class should have a data attribute for a customer number and a …

Member Avatar for e-papa
0
233
Member Avatar for cwarn23

Hi, I am in need of a python ocr script that can convert images into text and for the script to work on BOTH windows and centos. All the scripts I have found seem to not be compatible with linux/centos or require an api to another server and I do …

Member Avatar for cwarn23
0
163
Member Avatar for python01

Hi all, I have just modified a mouse so that the left mouse button gets activated when a puck hits the net in ice hockey... Now all I need is for python to react to the hit by sending an output of voltage for a period of time and adding …

Member Avatar for python01
0
178
Member Avatar for Thisisnotanid

Hi all, I wrote code to list primes that are in a given "radius" of an even number. For example, 6 - 1 = 5 and 6 + 1 = 7, 14 - 3 = 11 and 14 + 3 = 17, etc. I used Euler's sieve to obtain the …

0
99
Member Avatar for Stefano Mtangoo

Vega had nailed a "Starting Python" thread. I though there should be a place for proposing intermediate and advanced projects so that one can have something to do to improve their skills more. Especially for those who don't do alot of math enough to get the challenges of project eura …

Member Avatar for lrh9
0
6K
Member Avatar for Tcll

so I'm using the 'initialfile' to automatically generate the name of the import file, but I'm using 'defaultextension' to set the extension when clicking 'Save' how do I set the 'defaultextension' based on the current filter selection??

Member Avatar for Tcll
0
7K
Member Avatar for socksy

Okay, so I'm currently working my way through Beginning Python: From Novice to Professional, and I'm up to the networking stuff. I consider myself at least an intermediate Python programmer, but the network stuff is really confusing me. I'm trying to get the hang of it by writing a simple …

Member Avatar for socksy
0
197
Member Avatar for novice20

Hi all, Is there any way to do forward referencing or function prototyping in python..? Being an interpreted language, is lack of forward referencing a drawback of python?

Member Avatar for novice20
0
4K
Member Avatar for losbellos

Hej Guys, I am not a phyton programmer, just on [url]www.luxrender.net[/url] (open source project) we have this annoying problem when we need to dl something the phyton mercury doesnt pass the file size to browser... Can somebody take a helpful look at it? I am sure its just something worng …

0
44
Member Avatar for e-papa

I've tried to make a program that will sort the results of a competition, by asking the user the number of competitors, then the name and score of each one. It worked but now i have to make it recognize when two or more people get the same score (that …

Member Avatar for e-papa
0
218
Member Avatar for srw0801

Hello, so I'm fairly new to python and I have become stumped on this one problem. As much as I would like you to solve the problem for me, I do not want you to do so without explanation, I would much rather have a step by step procedure. After …

Member Avatar for srw0801
0
433

The End.