15,179 Topics

Member Avatar for
Member Avatar for Ivnas

Hi All, I am working on a little side project for myself. i have created an interface which contains two listboxes and a few buttons. Clicking on each button would load separate csv files and they would populate in listbox 1. This is as far as i have gotten, what …

Member Avatar for G_S
0
784
Member Avatar for Ala'a99

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on). the function that I created to find the …

Member Avatar for Xavier_5
0
1K
Member Avatar for Geethu_2

import urlparse import urllib import urllib2 from bs4 import BeautifulSoup from collections import Counter import re import Tkinter from Tkinter import * import ttk from tkFileDialog import askopenfilename import logging import tkMessageBox import tkFileDialog import csv import json import os import time import collections import shutil import thread from PIL …

0
207
Member Avatar for vegaseat

A little fun with Python's turtle module drawing a number of random stars in the dark sky.

Member Avatar for Ali_65
2
11K
Member Avatar for Xavier_6

Hello I'm new to python so I was thinking on building a simple neural network...I think I'm almost there and got an error, so I would really need a help right now. from PIL import Image from scipy.misc import imread import matplotlib.pyplot as plt import matplotlib.image as mpimg from pybrain.tools.shortcuts …

Member Avatar for Gribouillis
0
2K
Member Avatar for inkcoder

Well if you were like me and Python is your first language. You are trying to learn programming and many people suggested that learn Python as a first language. You take their advice, your download Python and get all set up. Maybe you take a tutorial or two in order …

Member Avatar for Gabriel_9
1
49K
Member Avatar for Pi

Hi, im writing app in Python 3.4 using tkinter. Its timer for windows 7 and higher. Input some minutes and press start button. When time reaches zero it will shutdown computer. Ive used update method with time.sleep - look at my code. But i need to make this timer with …

Member Avatar for Gribouillis
0
300
Member Avatar for Kristians

Hello. I am in need of your help guys. I have a topic "Patchworks" in uni right now and I have no idea how to draw them on window by using graphics.py in Python 3.5 Basically I got following patch designs to draw on screen: [IMG]http://i67.tinypic.com/2wbt7v5.png[/IMG] and [IMG]http://i68.tinypic.com/j9u7mo.png[/IMG] I will …

Member Avatar for Gribouillis
0
431
Member Avatar for lokesh_6
Member Avatar for Gribouillis
0
314
Member Avatar for Lucas_10

So, I'm making a ton of games like Bubble Blaster but will anyone help me with my currunt one, CodeNet! Currently this is the code. #CodeNet.com #Game Script import time print('Welcome') menu = ['Accept', 'Cancel'] from Tkinter import * HEIGHT = 626 WIDTH = 1238 window = Tk() window.title('Code Net.com') …

Member Avatar for Lucas_10
0
383
Member Avatar for Lucas_10

I'm pretty brand new to Python and started with Python 2.7.10 for a start but I started thinking of 'updating' Python for some random reason. Plus there are many programers who 'stuck' with Python 2.7 for many reasons like in Python 3 you'd have to put parenthesis in a print …

Member Avatar for ddanbe
0
1K
Member Avatar for rhys1619

Hi, i was want to add an image that is displayed before my game and then the user will click or press enter and the image will disappear and my game will start. I have tried "blit" and a few other thinks to try and get the image to appear …

Member Avatar for Lucas_10
0
358
Member Avatar for Lucas_10

How could I improve my code for Bubble Blaster. from Tkinter import * HEIGHT = 626 WIDTH = 1238 window = Tk() window.title('Bubble Blaster 1.8 - By Lucas - AiroTM - Contact Us On Airo ;)') c = Canvas(window, width=WIDTH, height=HEIGHT, bg='darkblue') c.pack() ship_id = c.create_polygon(5, 5, 5, 25, 30, …

Member Avatar for Lucas_10
0
348
Member Avatar for bryann

I am getting an unexpected result when using mod '%' in Python. When I type print(356%3.56) I would expect the result to be 0 as 3.56 goes in to 356 exactly 100 times. However when I run the code it returns 3.5599999999999947. What is the reason for returning this number …

Member Avatar for Gribouillis
0
359
Member Avatar for wine_1

There is a multi-dimensional array, e.g., ` data is of shape (1,320,320,1)` I once saw a function which uses x=data[:,c:-c,d:-d] I am not very clear about what does this mean, my original understanding is that x will keep data's first two dimensions, and take a slice from data on the …

Member Avatar for slate
0
278
Member Avatar for paul_46

Hi there Im doing a project at the moment and need to find the numbers 1,2 and 3 i(all) in any order entered by the user. A=[] B=[0,1,2,3,4] lengthOfList = int(input("Enter the number of elements:")) for i in range(0,lengthOfList): elm = int(input("Enter and element value: ")) A.append(elm) print(A) Code so …

Member Avatar for rproffitt
0
289
Member Avatar for Amber_6

I'm stuck on this problem for a day. Since no one responds my question on stack overflow, I hope somebody here may help. I'm trying to build a dictionary of shakespeare's plays that records the act and scene of the first speech of each character, and the number of speeches …

Member Avatar for Gribouillis
0
343
Member Avatar for Zaal

Hi guys, want to convert PYTHON to C and RUBY anyone can help me with this? I have tried to find some online services, but can't find.. if someone can recommend free service, i'll be happy. I want to convert this simple code to C, RUBY,NODE JS http://hastebin.com/kibaraganu.pl Someone can …

-1
148
Member Avatar for tjy92

I need to write a program that reads data from a text file, and prints it. These are the specifications. And then manipulate the program to determine this: -The number of uppercase letters in the file -The number of lowercase letters in the file -The number of digits in the …

Member Avatar for Reverend Jim
0
3K
Member Avatar for wine_1

Hi, I am using the following code segment to input image from file. The code itself works fine. However, I have a question regarding line 7 img=img/255 I understand that it aims to scale the img value to 0 and 1. But I am not sure whether I should add …

Member Avatar for Gribouillis
0
247
Member Avatar for sandman64

i'm trying to use the elif statement but every time i try to use it it gives a syntax error. here's the code: [code] n = input() while n != 2: n = n - 2 print "number is even" elif: n < 2: print "number is odd" [/code]

Member Avatar for Swathi_4
0
218
Member Avatar for Viasur

Hello to everyone! Yes, Im a newbie and I have a problem that is kind of a pain. I receive an error "Invalid Syntax", when trying to run this. The file mesaure.csv has been created and it is locate on the correct folder with the .py file. Whe I try …

Member Avatar for Gribouillis
0
4K
Member Avatar for Nether_1

Firstly, I would like to apologize for the massive number of nooby crap questions that come out of my account. I'm an emerging programmer that doesn't always know what he's doing, so I'm sorry. Secondly, the problem. I'm writing this code: class Object(): def __init_(self, vertices, color, name): self.color = …

Member Avatar for Gribouillis
0
516
Member Avatar for pasta

Hello, i recently learned Pig Latin and how it works (some stupid hard shakespeare language in Python lol) and in CodeAcademy it says "print Pig Latin" in pig latin which i do not know how and i need some help, here is the code i entered for the program on …

Member Avatar for Gribouillis
0
533
Member Avatar for Nether_1

Hey everybody. I'm currently working on making a simple 2D "engine" of sorts in which I can assign certain objects to certain coordinates and it will render them out there. It's mainly to be about 2D animation and the like, but that's besides the point. I'm working on a coordinate …

Member Avatar for Nether_1
0
8K
Member Avatar for mms6

def binding_locations(strA, strB): The first parameter represents a strand of DNA. The second parameter is one strand from a recognition sequence. Return a list of all the indices where the recognition sequence appears in the DNA strand. (These are the restriction sites.) For example, if the DNA palindrome appears at …

Member Avatar for Hassaan_4
-2
893
Member Avatar for Mengchen

from turtle import * import random def allTriMedian (w=300): speed (0) vertices = [] point = turtle.Point(x,y) for i in range (3): x = random.randint(0,300) y = random.randint(0,300) vertices.append(trutle.Point(x,y)) point = turtle.Point(x,y) triangle = turtle.Polygon(vertices) a = triangle.side() b = triangle.side() c = triangle.side() m1 = tirangle.median m2 = triangle.median …

Member Avatar for slate
0
984
Member Avatar for Lucas_10

It would be good for some people to help me out on putting sounds in my application without Pygame, because it doesn't work on my PC. If you can then it would be highly appreciated for your help. If you could not reply then you could do a download for …

Member Avatar for rproffitt
0
258
Member Avatar for Gowda_1

I'm new to python, for my project I need to send mail from python.. I'm getting the following error can someone please help me how to get out of it.. Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for …

Member Avatar for Lucas_10
0
604
Member Avatar for Tim_10

I need to comput and display the sum and average of the cubes of the even natural numbers between 2 and n. Where n is entered by the user. Im stuck on how to average the sum of the cubes. Help Please. This is what I have so far. def …

Member Avatar for tinstaafl
0
378

The End.