15,181 Topics

Member Avatar for
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
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
204
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
427
Member Avatar for Joeflims

Hey everybody. I was reading some code on the website and I saw this: [CODE]with open(FILE) as number_file: lucky_numbers = [set(line.strip().split('-')) for line in number_file] [/CODE] What does "with ... as ..." mean? What is it used for? How is it used?

Member Avatar for Joeflims
0
134
Member Avatar for Learn_Pyhton

hii..m stuck in an issue...and need a help I have Try.c file having contents ValidateFunction() { ...... ...... print } .... I want to print data between the braces {....}. Also i do not want to read the contents of file line by line because file is of very big …

Member Avatar for TrustyTony
0
151
Member Avatar for Banjoplucker

[url]http://paste.pound-python.org/show/941/[/url] Having trouble getting a loop to write to a series of newly created sequential blank .wp files. Grateful for any help, thank you. Regards & a Happy New Year! Banjoplucker.

Member Avatar for djidjadji
0
107
Member Avatar for blacknred

I have a share -//192.168.0.11/myshare which has many files in it. Which is the best way to delete all the files in this directory using python? I tried: [CODE]import os folder = '\\192.168.0.12\myshare1' for the_file in os.listdir(folder): file_path = os.path.join(folder, the_file) try: if os.path.isfile(file_path): os.unlink(file_path) except Exception, e: print e[/CODE] …

Member Avatar for jice
0
129
Member Avatar for ChaosKnight11

Hi, I am trying to install the Python4Delphi components, but it doesn't compile (from python4delphi.googlecode.com/svn/trunk). It also seems out of date. What is the best current way to use Python inside Delphi? Any advice or help will be greatly appreciated. Thanks!

0
113
Member Avatar for G_S

Hello, This is a really simple question but I just don't see the error here: [CODE]def foo(): x = input('write something: ') if x == 1 or x == 2: print('OK') else: print('NO') print(x)[/CODE] Why does it keep printing NO? Also, I have a more complicated one: def foo(x, y): …

Member Avatar for G_S
0
113
Member Avatar for kiranbkrishna

Hi all, i was writing a gui for a small desktop application i made as a part of learning python.I use python 2.7.I used Tkinter.I am new to python and this was my first trial with Tkinter. First i created 9 buttons arranged in the form of a 3*3 matrix …

Member Avatar for TrustyTony
0
358
Member Avatar for jarograv

So I have a program I am making but I need to make it more efficient, is there any way to condernse the following code into a more compact and efficient code? [CODE]r1p1=o r1p2=o r1p3=o r1p4=o r2p1=o r2p2=o r2p3=o r2p4=o r3p1=o r3p2=o r3p3=o r3p4=o r4p1=o r4p2=o r4p3=o r4p4=o r5p1=o r5p2=o …

Member Avatar for woooee
0
203
Member Avatar for TrustyTony
0
776

The End.