Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
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 #621
Ranked #202
~205.01K People Reached
Favorite Tags

225 Posted Topics

Member Avatar for Viasur

Dont forget to select your code and press (CODE) next time. And do you have a sample file, becasue this normally works. import csv for row in csv.reader(open('mesaure.csv')): print row

Member Avatar for Gribouillis
0
4K
Member Avatar for gishi
Member Avatar for theweirdone

Like this? [CODE]#!/usr/bin/env python import urllib def save_page(site="http://www.tvrage.com/Warehouse_13/episode_list"): mypath = site f = open('temp2.txt', 'w') for item in urllib.urlopen(mypath).readlines(): f.write(item) f.close() def find_title(temp="temp2.txt"): f = open(temp) site = f.readlines() f.close() for item in site: if item.find('<title>') != -1: before_html, tag_before, rest_html = str(item).partition('<title>') title, tag_after, after_html = rest_html.partition('</title>') print 'Title:', …

Member Avatar for Aung Myat
0
674
Member Avatar for Kippstah
Member Avatar for Beat_Slayer
-2
239
Member Avatar for ultimatebuster

??? Does yours outputs like this mate? [CODE]>>> import unittest >>> dir (unittest) ['FunctionTestCase', 'TestCase', 'TestLoader', 'TestProgram', 'TestResult', 'TestSuite', 'TextTestRunner', '_CmpToKey', '_TextTestResult', '_WritelnDecorator', '__all__', '__author__', '__builtins__', '__doc__', '__email__', '__file__', '__metaclass__', '__name__', '__package__', '__unittest', '__version__', '_makeLoader', '_strclass', 'defaultTestLoader', 'findTestCases', 'getTestCaseNames', 'main', 'makeSuite', 'os', 'sys', 'time', 'traceback', 'types'] >>> print unittest.TestCase <class …

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

Can you provide a sample xml and itl, it's a pretty easy task to achieve. Cheers and Happy coding...

Member Avatar for JoshuaBurleson
0
536
Member Avatar for Tcll

So you can't read C++, and want to convert some C++ files to Python? How about leaking the C++ files so we can help you? Meanwhile, i'll google for tools. ;)

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
3K
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

You don't have questions, nowone cared about this, so just let it sink, till someone finds it attractive. Cheers and Happy coding

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

[URL="http://docs.python.org/tutorial/index.html"]One of my favorites, it just explains you everything, has a lot of examples.[/URL]

Member Avatar for Dylan Solarsh
0
239
Member Avatar for yari
Member Avatar for techie1991

Going from the root as as folder python, [CODE]python\Objects\intobject.c[/CODE] Cheers and Happy coding

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

Have you tried [URL="http://www.pygame.org/docs/ref/joystick.html"]pygame.joystick[/URL]. Wheres the code? Cheers and Happy coding

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

doffing81, theres no need to hardcode the 5 deals. [CODE]def deal(): """this function deals the cards individually to each hand""" for i in range(5): self.append(deck.pop(0)) #pop(0) grabs the first card/item in list p2.append(deck.pop(0)) #pop() would grab last...I believe p3.append(deck.pop(0)) p4.append(deck.pop(0))[/CODE] Cheers and Happy coding

Member Avatar for doffing81
0
1K
Member Avatar for novice20

You want all the output in text file, or only the error output? Wich OS? Are you using GUI? Cheers and Happy coding

Member Avatar for novice20
0
161
Member Avatar for WildBamaBoy

You can run the listening function on an asynchronized thread. [CODE]from functools import wraps from threading import Thread def async(func): @wraps(func) def async_func(*args, **kwargs): func_handler = Thread(target=func, args=args, kwargs=kwargs) func_handler.start() return func_handler return async_func @async def listener(): print "Initializing Listener..." Listener.Listen(server_ip, int(server_port)) os.system("cls") print "Server IP: %s" % server_ip + …

Member Avatar for lrh9
0
174
Member Avatar for Sky Choi

This should be faster. [CODE]lines = [line for line in tx.readlines(2000000)][/CODE] Cheers and Happy coding

Member Avatar for TrustyTony
0
632
Member Avatar for ryufire

What you mean? Like clipboard access? Or a internal function? Copy to variable and write the variable to the widget maybe? Cheers and Happy coding

Member Avatar for vegaseat
0
133
Member Avatar for XR_

Something like... [CODE]self.transport.getDestination()[/CODE] Cheers and Happy coding

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

I can't see the problem, and it's working good. Maybe IDLE? Maybe version of the pygame you use? Cheers and Happy coding

Member Avatar for redyugi
0
3K
Member Avatar for python_user

You don't need to display them, if you maintain a list of the image objects open, you can easilly save them all in a nice loop. Show a example of what you mean, I'll help you. Cheers and Happy coding

Member Avatar for python_user
0
5K
Member Avatar for acrocephalus

[CODE]class SpeciesGrid(wx.Frame): self.EnglishNameList = ['Great Tit','Marsh Tit','Coal Tot','Crested Tit'][/CODE] Your code defines EnglishNameList as a attribute of the SpeciesGrid class, so you must change the [CODE]self.EnglishNameList[/CODE] on the SearchDlg class by something like [CODE]SpeciesGrid.EnglishNameList[/CODE]. Cheers and Happy coding

Member Avatar for acrocephalus
0
243
Member Avatar for acrocephalus

The usage is [CODE]SetGridCursor(self, row, col)[/CODE], so why collumn -1 on your code mate? [CODE]self.SpeciesGrid.SetGridCursor(ind, -1)[/CODE] Cheers and Happy coding

Member Avatar for acrocephalus
0
724
Member Avatar for dustbunny000
Member Avatar for mjs051

Only the print implementation. You can do [CODE]from __future__ import print_function[/CODE] and keep the 3.x print style. Cheers and Happy coding

Member Avatar for TrustyTony
0
9K
Member Avatar for simpatar

It seems to work here... [CODE]import re print re.findall('[0-9][0-9][0-9]\.', '1234_.txt') print print re.findall('[0-9][0-9][0-9]\.', '1234.txt')[/CODE] Can you explain what's not working. Cheers and Happy coding

Member Avatar for simpatar
0
119
Member Avatar for lewashby

The distance between vectors, presuming you have vector A and B with two coordinates x and y, is: [CODE]sqrt(((Ax - Bx) ** 2) + ((Ay - By) ** 2))[/CODE]

Member Avatar for Beat_Slayer
0
89
Member Avatar for lewashby

@staticmethod returns a static method for function. @classmethod returns a class method for function. The classmethod is called with the 'cls' argument as first argument and it represents the class. It's called when you create a class object and will serve as constructor for the class. At line 13 it …

Member Avatar for Beat_Slayer
0
110
Member Avatar for -ordi-

You have [URL="http://docs.python.org/library/urllib2.html"]urllib2[/URL] also, or you can try with the Beautiful Soup. Cheers and happy coding

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

Something like this... [CODE]f_in = open('file.csv') lines = f_in.readlines()[1:] fields = [item for item in lines.split(',')] selected = [] for field in fields: selected.append((field[4], field[6]))[/CODE] It will need adjusting... Cheers and Happy coding

Member Avatar for Beat_Slayer
0
130
Member Avatar for _neo_

Like this I believe... [CODE]#!/usr/bin/python import socket import subprocess sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) host = socket.gethostname() port = 1234 sock.bind((host,port)) while True: command, addr = sock.recvfrom(1024) if len(command) > 0: print("Received ", command, " command from ", addr) exec_command = subprocess.Popen(command, stdout=subprocess.PIPE) print(exec_command.stdout.read()) sock.close()[/CODE] Cheers and Happy coding

Member Avatar for _neo_
0
5K
Member Avatar for Wumbate

[URL="http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html"]Here.[/URL] Cheers and Happy codings

Member Avatar for Beat_Slayer
0
57
Member Avatar for Ghostenshell

Here it is. Now it works. [CODE]class Rectangle: def __init__(self, length = 1, width = 1): self.set_length(length) self.set_width(width) ##Setters to float def set_length(self, length): length = float(length) try: if 0.0 < length < 20.0: print "Value is in range. You may continute." self._length = length else: raise ValueError except ValueError: …

Member Avatar for Ghostenshell
0
218
Member Avatar for csguy11

The error message, and not the error type, were of great help. And a code usage sample also And wheres line 95? Cheers and Happy coding

Member Avatar for TrustyTony
0
486
Member Avatar for jyothics23

Wheres the checksum? Cheers and Happy coding EDIT: How about this? [CODE]data = '\x02' + '1T025.0F00R1000000000000000' + '\x8B' + '\x03'[/CODE]

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

Or [CODE]Hands.hasFlush()[/CODE] for outside the class Hands, or [CODE]self.hasFlush()[/CODE] if it's inside the class that defines hasFlush(). Cheers and Happy coding

Member Avatar for xtra333
0
2K
Member Avatar for gudumba

what are you trying to do? A folder creation? [CODE]os.makedirs('c:\\foo\\bar')[/CODE] [URL="http://docs.python.org/library/os.html"]Look here.[/URL] Cheers and Happy coding

Member Avatar for Stefano Mtangoo
0
188
Member Avatar for Rocanlover1

ask grade exam a ask grade exam b ask homework 90 = (needed*0.35) - (a*0.25) - (b*0.25) - (homework*0.15) Cheers and Happy coding

Member Avatar for TrustyTony
0
148
Member Avatar for a007s

Yeah, you need do read a litle bit before jumping into it, trying is good, but research also. [URL="http://effbot.org/zone/tkinter-menubar.htm"]Some help[/URL] Cheers and Happy coding

Member Avatar for a007s
0
3K
Member Avatar for UaBoy

You can use [URL="http://www.pythonware.com/library/tkinter/introduction/whats-tkinter.htm"]tkinter[/URL] or [URL="http://easygui.sourceforge.net/"]Easygui[/URL], or downgrade do 2.x and use [URL="http://www.wxpython.org/"]wxPython[/URL]. Cheers and Happy coding

Member Avatar for vegaseat
0
279
Member Avatar for guyfrompluto

I think it's simple as this: [CODE]list1 = [1, 5, 3, 9, 4] int1 = 8 list2 = [item + item for item in list1] if int1 in list2: print int1, 'is the sum of', int1/2 else: print int1, 'is not the sum of any of the numbers in the …

Member Avatar for Beat_Slayer
0
706
Member Avatar for lewashby

The if statements are no repeated, theres one if for each sprite. The if of line 42 moves the second sprite (x2) every 5 frames, or being said every 5 movements of the first sprite (x1) The frame counter is incremented on line 52. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
211
Member Avatar for BigHappyGod

Your router may be cofigured to only allow connections through ethernet cable and not wireless connections to the settings. Apart that, this is the python forum, for python related questions. Cheers and Happy coding.

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

For that function you use pyhton 3.x, or you do: [CODE]from __future__ import print_function def main(): f = open('lines.txt') for line in f: print(line, end = '') if __name__ == "__main__": main()[/CODE] Cheers and Happy coding

Member Avatar for Delu:sional
0
148
Member Avatar for remomore
Member Avatar for GothLolita

Functions to add, remove and view entries to the address book, values stored in a pickled dictionary. I'm eager to help, but I want to see some code effort from you. Cheers and Happy coding

Member Avatar for techie1991
0
2K
Member Avatar for udev
Member Avatar for acrocephalus

You must use the 'SetCellValue(self, row, col, s)' attrivute of the grid. Make a loop, read row, iterate trough items, and insert the data on the cells. Cheers and Happy coding

Member Avatar for acrocephalus
-1
2K

The End.