15,190 Topics

Member Avatar for
Member Avatar for tmcclure57

I'm actually helping my wife. She's learning Python. Me? VB.net and C# are my preferance. So I try to help her. All she wants to do is paint a command button, use this to launch another program written in python. I have spent the past few days trying to find …

Member Avatar for vegaseat
0
129
Member Avatar for ram_10

I'm trying to learn scripting in Python. So, I started using an exercise and it had this question for me. Define a function that computes the length of a given list or string. And I can't use the built in function len(). I tried the code below and I can't …

Member Avatar for vegaseat
0
188
Member Avatar for tony75

Hi I installed a different version of Python but how to choose edit with IDLE to open scripts in python 2.7 or python 3.2 on my Windows desktop?

Member Avatar for tony75
0
429
Member Avatar for vegaseat

For those of you who are inquisitive, here is a little Python program to approximate the value of pi to 77 digits. You can easily go further, just change the value n in range(n+1).

Member Avatar for sneekula
0
3K
Member Avatar for MasterHacker110

Recently I've been fooling around with some fun mathmatic (dont knwo if that is even a word) stuff. I recently took on the task of trying to calcualte PI. I have a very simple program in python that does this for me: import math from datetime import datetime top = …

Member Avatar for sneekula
0
347
Member Avatar for nwillis1

I have a computer science project and it has all to do with list and such could someone please help me with it!

Member Avatar for nwillis1
-1
97
Member Avatar for MasterHacker110

I've been messign around with Python a little recently. Though I now want to import one of my .py files into my "main" file, but I get an `"module" object is not callable` error. How do I actually do this then. My files: KeyGenerator.py main.py Code I use to import: …

Member Avatar for MasterHacker110
0
340
Member Avatar for YorkshireSpud

Im personally learning how to program in python though I do know of other languages. Is Python the best to learn off?

Member Avatar for vegaseat
0
278
Member Avatar for kruko

Hello Guys, i am new to python, for a assingment i need to create a game (binary puzzle). im having problems to start with creating the bord, i saw some examples of creating a bord game on this forum but it didnt worked out for me. i want to create …

Member Avatar for Gribouillis
0
533
Member Avatar for vegaseat

This snippet shows you how to animate a dice roll with the Tkinter GUI, useful for many games that require a dice to give a random number from 1 to 6. An interesting use of Tkinter's grid(), grid_forget() and after() functions.

Member Avatar for Jake_6
0
4K
Member Avatar for punna.udaykumar

A series of different parts of sentences will be randomly put together to come up with new interesting sentences. using with Random, Integers, Print, Strings, Breaks, Functions, For, Range

Member Avatar for sneekula
0
484
Member Avatar for ao_py

I am trying to write a program that graphically presents three doors and ask the user to choose the “special” door (randomly selected by the program). If the user correctly chooses the special door, it’s a win. If either of the other two non-special doors is selected, it’s a loss. …

Member Avatar for sneekula
0
891
Member Avatar for dancks

I was testing this in prompt mode: import re def checkurl(url): check = re.match(r'^(:?https?://)?[^\/#?&]+\.[^\/#?&]+.*$',url) if check == None: print “NNOOOOOO!!!!” else: print “YESSSS!!!!!” checkurl("javascript:void(0);") checkurl("/account/general?ru=https%3a%2f%2fwww.bing.com%3a443%2fsearch%3fq%3dukraine%2bcrisis&FORM=SEFD") checkurl("/?FORM=Z9FD1") checkurl("http://choice.microsoft.com") I have no idea why this won't work. Ignore the regex its only supposed to weed out relative paths and fragments of strings. …

Member Avatar for Gribouillis
0
994
Member Avatar for Rahul47

Hello folks, I am currently in 2nd year of Masters Degree and I am expected to develop a project this year from the given topics. I find Command Based text editor like vi fascinating as others were boring. So, here is the project definition. **In this project you are expected …

0
60
Member Avatar for Johnny Blaz
Member Avatar for Florian_2

Hey, guys! Newbie here. =) I try to reverse an image but an error came and i don't know why :/ This is the error: Traceback (most recent call last): File "C:/Users/Florian/Documents/ISN/S10/défi11.py", line 10, in <module> im.putpixel((x,600-y),(p[0],p[1],p[2])) File "C:\Python27\lib\site-packages\PIL\Image.py", line 1267, in putpixel return self.im.putpixel(xy, value) IndexError: image index out …

Member Avatar for vegaseat
0
782
Member Avatar for James_41

I have to complete a project which have an text file and finds path between 2 actors(kevin bacin game) that you input by going through the movies in the text file. For example if the text file is: Apollo13 Kevin Bacon Tom Hanks Gary sinise HollowMan Elisabeth Shue Kevin Bacon …

Member Avatar for juanpa_2510
0
3K
Member Avatar for fontana74

Hi guys, I'm trying to draw multiple diagonal lines in python, I know I have to use a loop but how do I get the lines to draw in different places? i.e \\\\\ \\\\\

0
72
Member Avatar for prasanna.k

Hi Guys, I need python script to assign 100 IP addresses to VMs present in the same ESX host. can anyone help me with this.

Member Avatar for Gribouillis
0
893
Member Avatar for JJHT7439

I have to complete a lab which basically takes a text file and finds path between 2 actors that you input by going through the movies in the text file. (For the labs purposes we are only doing 3 degrees of separation) For example if the text file is: [QUOTE]Apollo13 …

Member Avatar for James_41
0
3K
Member Avatar for TyeL89

I am creating a contact program with python and wxpython. While creating the browsing function for my program I ran into a problem. I've been searching for hours trying to find a way to fix it. Unfortunately I haven't had any luck on fixing the error/problem. Here is the code …

0
167
Member Avatar for Noskes

Hi, I'm currently trying to create a Pattern on python which I'm really struggling to figure out. I'm trying to recreate the patch in the picture I've uploaded however I can't figure out where I'm going wrong. I'm really confused and I'd really appreciate it if someone could help me. …

0
75
Member Avatar for piovertwo

This is for a senior-year project with an [ANFIS](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=256541) (adaptive neuro-fuzzy inference system) module to be used as a predictor for financial instruments. The bulk of the system will be written in Python—chosen for its ease of use and the presence of libraries for genetic programming, another component of the …

Member Avatar for Gribouillis
0
3K
Member Avatar for Alex_29

Hi, I've just started using Python/Pygame as a hobby. I've gotten the code to draw my Plane.png and move it using the wsad keys, and I mapped the q and e keys to rotate it which it does, but each time it rotates, it 'falls' down the screen to the …

Member Avatar for juanpa_2510
0
4K
Member Avatar for Karthika_g

Hello, Please let me know how should we get the id of an entity and put it in the another entity. I have two entity User and Track. I tried the below code I couldn't make. Please help! class Review(webapp2.RequestHandler): template = JE.get_template('templates/Review.html') self.response.out.write(template.render()) def post(self): n = self.request.get('user_name') t …

0
204
Member Avatar for Auroch

Hello! I'm trying to transform working Python code to Matlab code. It's Simpson's rule. But MatLab code is not working. What should I change for in this code? Python: from math import sin def f(x): return ((0.6369)*sin(sin(x))*sin(x)) def method_simpson_compost(f,a,b,n): h = (float(b)-a)/n i = 0 fks = 0.0 while i<=n: …

Member Avatar for Taywin
0
318
Member Avatar for herrschteiner

I'm writing a bash script that redirects the output of a command to a file. The next thing the script should do is read the contents of the file, into the tenth line of a python script. It's tricky, because the line of text in the python script should read: …

Member Avatar for Software guy
0
309
Member Avatar for Kadian

he following code gives the error UnboundLocalError: local variable 'currentpl' referenced before assignment: if user_choice == 0: currentpl = 1 elif user_choice == 1: currentpl = 2 while gameover(num_sq): if currentpl == 1: pick = getPlayerPick(num_sq) while not validPlay(pick, num_sq): pick = getPlayerPick(num_sq) makePlay(pick, player_col[currentpl]) if currentpl == 2: pick …

Member Avatar for snippsat
0
372
Member Avatar for photoguy77

teacher assigned out of the book "python programming: an introduction to computer science. second edition. page 384 # 19 is as follows this below is verbatim from the book and the instructions for the assignment are "Python Assignment #10 Complete programming exercise #19 on page 384 from Chapter 11" create …

Member Avatar for chriswelborn
0
367
Member Avatar for ncassambai

Hi so basically I need to create a timer for this simple maths test. I need it to give each question, lets say 30 seconds for test purposes, and then move onto the next question after the time is up and repeat the timer like that. Just cant figure it …

Member Avatar for woooee
0
141

The End.