15,406 Topics

Member Avatar for
Member Avatar for gunneronaspooky

Trying to get a program to fine the slope and intercept of a line on a graph.... I've got it all working so far...except the last line. I broke it down into pieces and ran it assigning numbers to the variables, but in the program, it doesn't work. Here is …

Member Avatar for IsharaComix
0
171
Member Avatar for -ordi-

Best way to parse this webpage private info: [url]https://ee.ekool.eu/index_et.html?r=2#/?screenId=g.user.login&err=1[/url] I found Beautiful soap and PyKhtml. What is the better?

Member Avatar for -ordi-
0
533
Member Avatar for Sargasso

I am currently trying to take two columns from a *.csv file... log10 transform them, and then plot them up on a graph. The graph is not the issue, I just need to edit those two columns and plot them. The file does have a header row, there are 8 …

Member Avatar for Beat_Slayer
0
130
Member Avatar for Alex Sarria

Hi, everybody! My name is Alex and I'm programming in C++ and Python just for hobby. My main interest is about games, fractal and fractal music. So, by the moment, I have a personal project with sounds by mean Python. I apologize, my English is not good...

0
32
Member Avatar for pythonstudent

Hey everyone, I am just starting to learn iteration in Python. I am stuck on an assignment that my teacher gave me. I am supposed to make a code to display this: 1 -2 3 -4 5 -6 7 -8 So far my code is this: counter=8 number=9 while counter>0: …

Member Avatar for cghtkh
0
106
Member Avatar for _neo_

How can I get results from exec()? Any suggestions appreciated!!! [CODE] #!/usr/bin/python import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) host = socket.gethostname() port = 1234 sock.bind((host,port)) while True: cmd, addr = sock.recvfrom(1024) if len(cmd) > 0: print("Received ", cmd, " command from ", addr) exec(cmd) # here how I can get …

Member Avatar for _neo_
0
5K
Member Avatar for _neo_

How can I get error message? [CODE] try: ...# some operations except: sock.sendto(err_msg,0,addr) # send client err_msg from exception [/CODE]

Member Avatar for _neo_
0
272
Member Avatar for Wumbate

Hi, I just finished a Python UI app with Tkinter and want to make it runnable by double-clicking an application on Mac OS X. But I'm having trouble figuring out how to do it. Does anyone have any instructions they could point me to? Thanks!

Member Avatar for Beat_Slayer
0
57
Member Avatar for Ghostenshell

I need to check for floating point numbers inside my class but it doesn't seem to be working. Any suggestions? [CODE] class Rectangle: def __init__(self, length = 1, width = 1): self.__length = length self.__width = width ##Setters to float def set_length(self, length): self.__length = float(length) try: #self.__length = float(length) …

Member Avatar for Ghostenshell
0
218
Member Avatar for csguy11

[code] def index_dir(self, base_path): num_files_indexed = 0 allfiles = os.listdir(base_path) #print allfiles num_files_indexed = len(allfiles) #print num_files_indexed docnumber = 0 self._inverted_index = {} #dictionary for file in allfiles: self.documents = [base_path+file] #list of all text files f = open(base_path+file, 'r') lines = f.read() # Tokenize the file into words tokens …

Member Avatar for TrustyTony
0
486
Member Avatar for Reverend Jim

Can someone please fill in the missing line of code in OnPageChange? I have a notebook control and on a page change event, I want to retrieve the label of the tab that was just selected. GetLabel and GetLabelText both return '' [CODE] import wx import wx.lib.mixins.inspection class Frame(wx.Frame): def …

Member Avatar for Reverend Jim
0
1K
Member Avatar for KrazyKitsune

Unicode: I would like to use the radical symbol (U + 221A) in my script. How do you print the Unicode without an error? Super/Subscript: Is it possible to make a variable superscripted (and subscripted, for that matter)?

Member Avatar for woooee
0
94
Member Avatar for JDuch

Somebody was so kind as to indicate to me an interactive Python learning program. I started using it, but lost the URL. I cannot find it back in the threads i started. Can this Python forum member remember me of his suggestion? Thanks

Member Avatar for JDuch
0
145
Member Avatar for KrazyKitsune

[code=syntax]from __future__ import division from math import sin from math import cos from math import tan from math import radians a = raw_input("enter 1 for sin, 2 for cos, 3 for tan") if a == 1: degree1 = int(raw_input("Type in angle value: ") radian = radians(degree3) sin = sin(radian) print …

Member Avatar for Stefano Mtangoo
0
622
Member Avatar for jyothics23

Hi, I try to communicate with equipment through serial port. It is slightly order equipment so it requires to send command in a specified format ends CHECKSUM (Like start with 'STX' and end with 'ETX' etc and the command looks something like '020T025F00R000000000000000'). [B]Issue with Python:[/B] For my case they …

Member Avatar for Tech B
0
2K
Member Avatar for gunneronaspooky

Okay...I'm back again for the next program...here's what i have so far [CODE]print "Euclid's Method" a= raw_input(("Enter first number ")) b= raw_input(("Enter second number ")) def euclid(a,b): while b != 0: a, b = b, a%b return a[/CODE] My question is, how do I get it to print out the …

Member Avatar for gunneronaspooky
0
144
Member Avatar for Delu:sional

I just installed eclipse and Pydev. but I can't I can't add Python 2.7 as the interpreter for Pydev. I couldn't find the interpreter file at 'mac/usr/local/bin/' I only see /python 3.1 and some others. Is it because of I have installed 3.1 and 2.7 both? Even then I click …

0
97
Member Avatar for udev

Hi! In every iteration of reading a file I populated a dictionary and appended it to a list . A part of that list looks like this : . . . Key Doc ID freq line number {'Emin': ({'file13.txt': 1}, {'Emin': [38]})} {'Gun': ({'file13.txt': 2}, {'Gun': [43, 71]})} {'I': ({'file13.txt': …

Member Avatar for udev
0
130
Member Avatar for matkod

Hi, Im trying to create a canvas as a background but i can manage to work =/ I create a window with the text and the size of de image, but the image is not there can someone help me? thanks. [CODE]import Tkinter as tk import tkMessageBox class Janela: def …

Member Avatar for woooee
0
7K
Member Avatar for xtra333

Hi Guys. I am new here. I am trying to run a Poker program that can detect the different hands in poker. here is my code [CODE] class Card: # A card is an Object with a suit and rank # attributes. def __init__(self, rank, suit): # To create a …

Member Avatar for xtra333
0
2K
Member Avatar for kinniburghc

I want to create a jpg image containg some graphics which I draw using the Tkinter Canvas widget. This draws the image to screen and then I use the PIL library ImageGrab() function to grab it off the screen into a file. It would be much neater to by-pass drawing …

Member Avatar for kinniburghc
0
7K
Member Avatar for gudumba

Hi, I started Python command prompt and entered this: import distutils.dir_util as du du.mkpath( "c:/foo/bar" ) #assume dir 'foo' doesn't exist This works fine and it creates the path 'foo/bar'. Now, go to file explorer and delete the dir 'foo' and go to the Python prompt and issue the same …

Member Avatar for Stefano Mtangoo
0
188
Member Avatar for pixelss

Hello, i'm very new to programming in genera. Python is the first language I'm learning. So, I was instructed to make a program that ask the user for loan payment, insurance, gas, oil, tires, and maintenance. The program will calculate the monthly cost and annual cost. here is what i …

Member Avatar for pixelss
0
476
Member Avatar for Tenck

I know it's one of those programming languages thought of as an easy thing to learn (or so it seems like it). My problem is not with the difficulty of learning the language, rather the outdated guides and the problems with Python 3.2. So I looked into a book called …

Member Avatar for snippsat
0
287
Member Avatar for sikais17

hey guys.i have one realy big big problem.. My programming teacher gave my a task to get these functions to work, but i dont know python program so good.. thats why maybe someone of you could help me, and make these 3 functions to work .:).. please!! these lines are …

Member Avatar for sikais17
0
155
Member Avatar for Rocanlover1

I need help with this. At the end of the semester, students often wish to know what grade they need on the final exam to get an A in the course. Write a program that prompts for the user’s grades on exam 1, exam 2, and the homework and from …

Member Avatar for TrustyTony
0
148
Member Avatar for a007s

I have this program I'm trying to write, a simple application with gui: a menu and a button. Whenever I go to run it, this is the error I get: Traceback (most recent call last): File "/Users/[I]myname[/I]/Documents/School/Programming/Window.py", line 27, in <module> app = Application() File "/Users/[I]myname[/I]/Documents/School/Programming/Window.py", line 14, in __init__ …

Member Avatar for a007s
0
3K
Member Avatar for UaBoy

I am new to this whole programming thing. I am currently using python 3.2. I want to get into trying to build GUI, but i can't find any programs that seem to work with python version 3.x. Should I downgrade to an earlier version of python? If so what is …

Member Avatar for vegaseat
0
279
Member Avatar for guyfrompluto

I need to write a function that takes in an array of integers and an integer, checks if the sum of any of the numbers in the array is equal to the supplied integer. Any ideas would be much appreciated.

Member Avatar for Beat_Slayer
0
706
Member Avatar for lewashby

[CODE]background_image_filename = 'sushiplate.jpg' sprice_image_filename = 'fugu.png' import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) background = pygame.image.load(background_image_filename).convert() sprite = pygame.image.load(sprice_image_filename) # our clock object clock = pygame.time.Clock() x1 = 0. x2 = 0. # speed in pixels per second speed = …

Member Avatar for Beat_Slayer
0
211
Member Avatar for gunneronaspooky

I've built my fair share of computers and figured it was time to learn to take advantage of that hardware by learning to program. So I'm taking some courses online. I'm having some issues writing some programs though, so any help would be appreciated. Right now, I'm stuck on this …

Member Avatar for gunneronaspooky
0
133
Member Avatar for Peter_TARAS

Hi! I am using a label widget in order to display a n rows and m columns matrix. My program allows repeated generation of a random matrix of integer (of arbitrarily number of rows and columns) - I am observing these matrices by representing them in a Label type widget. …

Member Avatar for Peter_TARAS
0
11K
Member Avatar for BigHappyGod

Here's the problem. Bought a new wireless printer, HP B209a. Have a wireless router, Belkin, been using it for years. I take it, the printer, out of the box, follow all the instructions on setting it up, run the setup program in a laptop, following all on screen instructions. It …

Member Avatar for Beat_Slayer
0
497
Member Avatar for Delu:sional

Im pretty new to Python (2.7) and no programming experience before. Anyway Im in the process of learning python but have a mysterious error that I can't figure out. Whenever I put equal sign in print statement, I get syntax error. here's an example code [CODE]def main(): f = open('lines.txt') …

Member Avatar for Delu:sional
0
148
Member Avatar for UaBoy

from random import randint correct = 0 for i in range(10): n1 = randint(1,10) n2 = randint(1,10) prod = n1 * n2 ans = input('What's %d * %d? ' % (n1,n2)) if ans == prod: print('That's Right! Well done.') correct = correct + 1 else: print('No, I'm afraid the answer …

Member Avatar for UaBoy
0
126
Member Avatar for remomore
Member Avatar for kumarantechie

Hi, I am a beginner in linux . i am using matchbox virtual keyboard for an application now i want to change the layout to another langauge . How to do it? Is there any way to change the layout from terminal . Kindly advice me suggestions. Any help appreciated …

Member Avatar for deimusmeister
0
157
Member Avatar for GothLolita

Hi everyone! I'm a newbie here. I have a problem: I need to create the address book in python that include name, phone number, email, address, etc...The information in the address book can able to delete or change. I will give more information later! Can you help me? I need …

Member Avatar for techie1991
0
2K
Member Avatar for gsenthil25

Hello, I'm trying to call a Python module in Java application using JEPP. I'm able to invoke the python modules from java Appl, but i'm not able to call the modules in python class from java appl. Python Code Code: [code] class SampleClass: def [b]callPythonModule[/b](self): print 'The Python Class module …

0
31
Member Avatar for lionaneesh

[B][I][U]Introduction[/U][/I][/B] Hey guys today I am writing a tutorial on Lists and tuples in Python.... So lets get started... [B][I][U] Layout:- [/U][/I][/B] 1.What are data sturctures? 2.What are tuples? 3.What are lists? 4.inbuilt functions on lists and tupples [B][I][I][U] What are Data structure?[/U][/I][/I][/B] Anybody familiar with programming or Actually Computers. …

Member Avatar for redyugi
1
3K
Member Avatar for ultimatebuster

Is there any tutorial for Ironpython and Winform out there that's good? A book that's free would be nice. Also if it involves sharpdevelop it would be pretty kickass.

0
109
Member Avatar for Ghostenshell

I read a lot of car classes on several sites and still can't get mine to work. Any ideas? [CODE]##Car class class Car: def __init__(self, y_model, make, speed): self.y_model = y_model self.make = make self.speed = speed def set_year_model(self, y_model): self.y_model = y_model def set_make(self, make): self.make = make def …

Member Avatar for Ghostenshell
0
105
Member Avatar for udev

Hi! I have used the os.walk function to traverse the many files in the directory. Now the problem is that it is listing same words from different files as different keys. How should I go about it?

Member Avatar for udev
0
128
Member Avatar for acrocephalus

Hello! I have designed a dialog with a grid widget. I would like to populate it with data from a MySQL table which has 10396 rows and 5 columns, as the grid widget. How can I do it? Then, how can I select a row from the grid widget and …

Member Avatar for acrocephalus
-1
2K
Member Avatar for Hawkeye Python

When realising the following operation: [CODE]do = 1.0 - 2.718281828**(-(23**2)/730) print do[/CODE] Python returns 0.632120558766 When you do it on the calculator or when google it, it returns 0.515509538 :-O

Member Avatar for vegaseat
0
277
Member Avatar for acrocephalus

Hello! I have created a control using the TimeCtrl widget using this code to insert an hour in a 24h format using the HH:MM format [CODE]self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', format = 'HHMM', fmt24hr = True)[/CODE] However, it keeps showing the time as a 12h clock (in the …

Member Avatar for acrocephalus
-1
197
Member Avatar for funfullson

Hi dears. I want make relation with gsm modem. my first goal and main one is sending and receiving sms. _then I want go front.for example for mms sending and ..._ I want to do it on a linux server. please introduce me a suitable modula with it's tutorial or …

Member Avatar for nazza
0
197
Member Avatar for jerryolive

The below code works, but the default value for the test method will be None. I'm trying to figure out how to read input from the user, convert that into a list (or whatever), and then based on the number of arguments the user inputs, it will be sent into …

0
30
Member Avatar for sphynx_25

Hey everyone, (Hopefully) a rather quick question. I'm currently trying to use regex to search a string for the location of the longest continuous match in a string where the *same* character keeps repeating. It doesn't matter which character it is, as long it is the highest number of consecutive …

Member Avatar for sphynx_25
0
2K
Member Avatar for Offshorejob

Hey Guys I'm looking for a full time offshore Python programmer. It is for a gaming (casino) company that produce slot machines and electronic poker machines among many other. So in so many words it is not web based python, but I'm sure someone who is very good with web …

0
33

The End.