« first day (712 days earlier)      last day (1476 days later) » 

4:46 AM
-1
Q: Python (2.7) script malfunction "unindent does not match any outer indent level"

user214045I'm new to Python scripting, and I've been tinkering with an RPG script. So far it was working fine until I added some "if/else" statements. Upon trying to run the module, I was greeted warmly by this little number: "There's an error in your program: unindent does not match any outer indent l...

 
 
5 hours later…
9:26 AM
0
Q: Quickest Way to Find MD5 Hash of the Contents of Files

pee2peeI have two txt files. Both contain 60k+ words in a list. I put together some code to loop through each file and concatenate the strings import hashlib with open('1.txt') as f: alist = [line.rstrip() for line in f] with open('2.txt') as f: blist = [line.rstrip() for line in f] for a in a...

 
 
5 hours later…
2:37 PM
0
Q: Split up an iterable into batches

SnowbodyI was writing a program that had a list of e-mail messages. It needed to group them into batches, with the condition that each batch must have at max 20 messages, and be maximally 50k in size (no individual message is bigger than 50k). Obviously itertools.groupby() is a candidate for this, but I ...

 
3:10 PM
0
Q: Generators + send() as a replacement for simple classes?

GeckoI have a data processing pipeline where some steps need an initialization phase which I would only would want to call once. I could employ classes and do the initalization in __init__ but it feels like boilerplate and it requires me to think of a class name and method name. What are the advanta...

-1
Q: Need Psuedocode for this code asap please?

QH1import random # Adds Random Numbers to the Quiz. import os import math def quiz(): #Defines the operation as a quiz. value1=random.randint(1, 10)#Numbers between 1 and 10 can be inputted randomly in the operation. value2=random.randint(1, 10)#Numbers between 1 and 10 can be inputted rand...

 
3:28 PM
0
Q: Flask json rpc2.0 extension

FabioCostaI created a simple extension to handle JSON RPC 2.0 requests on flask I would like some feedback regarding usage here is an usage example: app = Flask(__name__) app.debug = True @app.route('/hello', methods=['POST']) @rpc_request def func(method): return 'Hello fro...

 
 
2 hours later…
5:33 PM
4 messages moved from Core Python & Related Architecture
 
6:13 PM
0
Q: Efficiently index rows of numpy array by exclusion

CactusWomanI need a function that takes a numpy array and a row number as inputs and returns the array (or copy of the array) excluding the given row. I want to do this as efficiently as possible. # Test array x = np.repeat(range(10),2).reshape([10,2]) Indexing by slices is very fast in numpy, but as far...

 
 
1 hour later…
1 message moved from SO Close Vote Reviewers
 
7:50 PM
0
Q: first time wtih dynamodb using python

BigBThis is my first time working with DynamoDb and i was wondering if what i did is right to parse date from a json document to dynamodb. ALl input is appreciated. i was going to try this on dynamodb local. !/usr/bin/env/python import boto import optparse import json from pprint import ppri dyna...

 
8:08 PM
0
Q: Word frequency counter

celeniusI recently took a self-assessment question to assess my Python ability for an online class. The problem was to return the frequency of a word occurring, as part of a tuple. Implement a function count_words() in Python that takes as input a string word_string and a number number_of_words, an...

 
 
3 hours later…
10:42 PM
0
Q: How to check paginated website for new entries?

SixRequirements I'm interested in determining the best way to check a paginated website for new entries. I want to be able to scrape pages 1, 2, 3, ... as necessary to get all updates. However the scraping is fairly network intensive (e.g. I have to recurse into links to get data) so I only want to...

0
Q: pygame movement of character in Class does not work

MichaelI am new to developing games. Before I used to place the movement of the main character in the while loop and it worked perfectly. Now I am trying to make a Class for the maincharacter as in can be seen in the code below (I was told it is better because the collision will be easier and less messy...

 
10:58 PM
1 message moved from C
 

« first day (712 days earlier)      last day (1476 days later) »