Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
38
Posts with Upvotes
38
Upvoting Members
20
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
4 Commented Posts
2 Endorsements
Ranked #630
Ranked #202
~200.68K People Reached
Favorite Tags
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 gishi

hi! i want to place the contents of a dictionary into a csv file. Can someone help me with this? i already have the code in reading the csv file [CODE] import csv reader = csv.reader(open("c:\sample.dat")) for row in reader: print row [/CODE] i want the first element of the …

Member Avatar for Gribouillis
0
15K
Member Avatar for theweirdone

Hi, I'm trying to extract certain things from a web page. The website is TVRage.com, and the example I'm using at the moment is [URL="http://www.tvrage.com/Warehouse_13/episode_list"]the Warehouse 13 episode list[/URL]. So far I've managed to get the title of the show using this code: [CODE]#!/usr/bin/env python import urllib def save_page(site="http://www.tvrage.com/Warehouse_13/episode_list"): mypath …

Member Avatar for Aung Myat
0
667
Member Avatar for Kippstah

Ok, so. I've programmed, just for fun, a conversion calculator for decimal and binary numbers. Here is the code: [CODE]# -*- coding: cp1252 -*- import sys, os, time #This is where you convert a binary number into a decimal number. def binaryToDecimal(): os.system('cls') while True: print "To go back to …

Member Avatar for Beat_Slayer
-2
235
Member Avatar for ultimatebuster

How come unittest.TestCase doesn't exist for me? [CODE] Traceback (most recent call last): File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 1, in <module> import unittest File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 4, in <module> class CheckStructureAcceptance(unittest.TestCase): AttributeError: 'module' object has no attribute 'TestCase' [/CODE]

Member Avatar for Utopia_Tz
0
5K
Member Avatar for <LDJ>

Hey guys, new to the forum, but am in need of some help. I am quite new to Python, but want to be able to program a simple script that basically does three things: -1. Finds a string of text in an .xml file (the length of the string, and …

Member Avatar for JoshuaBurleson
0
515
Member Avatar for Tcll

does anyone have any note on rewriting C/C++ programs in Python?? google and bing give me the exact opposite, and I've got a headache from searching... please note that I can't read C++ if you need the program I'm rewriting, please let me know

Member Avatar for JoshuaBurleson
0
2K
Member Avatar for Beat_Slayer

Well, it bothers me to build menus for every shell application that needs one. So, I've written a module to handle that, like in the good old turbo pascal times. :) Here it is, the module comments are pretty explainatory, I think, and the sample usage if run as script …

Member Avatar for Beat_Slayer
0
2K
Member Avatar for Beat_Slayer

Simple script for image transparency. Someone asked one some time ago, and i had other but for a different system, and decided to write a Python/PIL version. The value of the color used as transparent is the value of the pixel at position (0, 0). You can adjust tolerance value. …

Member Avatar for gleam.uahmed
0
1K
Member Avatar for rubik-pypol

Hi, I am a new user and I want to show you my Python library. [B][I][U][COLOR="Red"]pypol[/COLOR][/U][/I][/B] pypol is a Python library that allows you to manipulate monomials, polynomials and algebraic fractions. An example: [CODE]>>> import pypol >>> a = pypol.polynomial('3xy - 3a^2 + 2b') >>> a - 3a² + 3xy …

Member Avatar for rubik-pypol
0
385
Member Avatar for acrocephalus

Hello! I'm just beginning to learn Python and I would like you to recommend me any good tutorial. I have started with the [URL="http://www.pythonlearn.com/"]http://www.pythonlearn.com/[/URL] and the [URL="http://hetland.org/writing/instant-python.html"]http://hetland.org/writing/instant-python.html[/URL]. I have found them very useful and I would like to continue learning. Furthermore, I would also like to start learning on programming …

Member Avatar for Dylan Solarsh
0
236
Member Avatar for yari

I really need help with this...i'm trying to make a game that where user guesses a word and it tells the user 1: the right number of letter in the right place 2: the number of letter that is right in the wrong place but when i test it out, …

Member Avatar for TrustyTony
0
2K
Member Avatar for techie1991

Can someone please direct me to the code for the class <int> in python. I know that it must have written in C, but I could not understand, where to ask this query. Though I tried to figure it out myself, but could not even understand, which folder to attack …

Member Avatar for techie1991
0
151
Member Avatar for P!th

I heard this forum was a wonderful place to ask programming related questions. So here I am, I'd like to know if anybody has a solution to a problem I'm having. I'm currently planning on creating a game on Python, and I've decided to make use of a joystick in …

Member Avatar for P!th
0
232
Member Avatar for doffing81

Let's create a continuing thread to program Crazy 8's from scratch for learning purposes! [B]DECK/CARD IDEA'S[/B] My simple starting suggestion: [CODE]deck = ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC', '2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD', '2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH', '2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS',][/CODE]

Member Avatar for doffing81
0
1K
Member Avatar for novice20

I am new to python n developing scripts as a part of my project.I need help regarding HOW THE OUTPUT OF THE SCRIPT CAN BE REDIRECTED TO A TEXT FILE(FOR MAINTAINING ERROR LOG), WHILE ALSO PRINTING IT ON CONSOLE?? Thanks for all the help in advance and I am looking …

Member Avatar for novice20
0
157
Member Avatar for WildBamaBoy

I'm attempting to write a game server and I need it to continue on with the code while listening for a connection. I know this is done with the threading module but I don't know how exactly to do this. Python documentation didn't work for me. [CODE] #[LISTENER] print "Initializing …

Member Avatar for lrh9
0
172
Member Avatar for Sky Choi

I'm trying to make program using Google 5gram data to compare with one of English exam called TOEIC. There are 118 files for 4grams and each size of 4grams are approximately 300MB and each files has 10,000,000 lines. So, here is the point. It requires about 4 or 5 seconds …

Member Avatar for TrustyTony
0
626
Member Avatar for ryufire
Member Avatar for vegaseat
0
122
Member Avatar for XR_

Hi, i'm searching for a way to know the hostname of a machine connected to my twisted-server. I use to know the host the method self.transport.getPeer().host, and i have the IP in this way. But i need to know the hostname. I'm searching for a way like socket.gethostname(). Waiting your …

Member Avatar for Beat_Slayer
0
412
Member Avatar for jtaylor-bye

Hi all this is my code :- [CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.lock() for count in range(10): random_color = (randint(0,255), randint(0,255), randint(0,255)) random_pos …

Member Avatar for redyugi
0
3K
Member Avatar for python_user

Hi guys, i have a problem here i have a situation where i need to save all the images opened using PIL I have no idea how to do without displaying images on screen one by one and saving them Can anyone please help how to save them without switching …

Member Avatar for python_user
0
5K
Member Avatar for acrocephalus

Hello, I have written this code, deleting those parts which are no needed to reproduce the error: [CODE]#! /usr/bin/env python # TestDialogs.py import wx, MySQLdb, wx.lib.intctrl, wx.grid ID_SPECIES=1 class SearchDlg(wx.Dialog): def __init__(self): wx.Dialog.__init__(self, None, -1, 'Search species', size=(400,400)) panel = wx.Panel(self, -1) vbox = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox2 = …

Member Avatar for acrocephalus
0
229
Member Avatar for acrocephalus

Hello! I have designed a dialog that shows a wx.Grid with some data (full code at the end). Then, there is a search area. The other buttons are not working now. When you fill any search control with some data shown on the grid, it prints the index where the …

Member Avatar for acrocephalus
0
713
Member Avatar for dustbunny000

Hi I am VERY new to python. I am trying to write a function that returns lines from a text file to a new file. I can't seem to get it right. So far my code looks like this: [CODE]def seperate_atoms(f):#Enter .pdb file in with quotations myfile=open(f,'r') crudepdb=myfile.readlines() cleanpdb=[] for …

Member Avatar for Beat_Slayer
0
143
Member Avatar for mjs051

I'm currently learning Python, and at the moment I'm writing a simple grocery list program. At one point in the program, the user is asked how many items are on their shopping list. What I want to do is take the number that the user inputs (lets say it's 5), …

Member Avatar for TrustyTony
0
9K
Member Avatar for simpatar

Here's the problem. I'm using pythons re-functions. I'm supposed to make a re-function to check if a string ends with 3 numbers(or more) before the extension.(e.g. 123.txt, 93821.ini) Here's my code that's supposed to do the magic [code] re.search('[0-9][0-9][0-9]\.','1234.txt') [/code] now, this doesn't work out. And I have no clue …

Member Avatar for simpatar
0
113
Member Avatar for lewashby

I'M reading the book "Beginning Game Development with Python and Pygame". The book showed me how to calculate the distance between two points using vectors. It first explained that you just subtract the values in the first point from the second. But just page or two pages later it says …

Member Avatar for Beat_Slayer
0
83
Member Avatar for lewashby

[CODE]class Vector2(object): def __init__(self, x= 0.0, y = 0.0): self.x = x self.y = y def __str__(self): return "(%s, %s)" % (self.x, self.y) @classmethod def from_points(cls, P1, P2): return cls( P2[0] - P1[0], P2[1] - P1[1] ) A = (10.0, 20.0) B = (30.0, 35.0) AB = Vector2.from_points(A, B) print …

Member Avatar for Beat_Slayer
0
104
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
524