2
votes
0answers
18 views

Fixed point iteration and cobweb diagram plotting

I'm using Python to find fixed points of a given function and then plot a cobweb diagram to visualize it. Thanks to this, I have the core of the code written and can accomplish the task, but I have a ...
5
votes
1answer
43 views

First text game with Python - Higher or Lower

Recently I have been learning Python programming, for about a week. I have covered all basic stuff - loops, strings, input masks - and have challenged myself by making a little game. It isn't much, ...
2
votes
1answer
46 views

Parsing Solr log files

I am kind of new to programming. Picked up some Perl about a year ago and now learning some Python. I am pretty confident in Perl, but Python seems un-natural to me. I wrote a little script that ...
1
vote
1answer
70 views

Modifying nested dictionaries in Python

My task was to take a configuration specified as a dictionary and run some function with it (the actual function is not relevant here). After implementing that, I was asked to allow some "sweeping" of ...
3
votes
0answers
117 views

Genetic Algorithm in Python

I'm a new programmer, so any help is advised. Preferably to make it faster, avoid heavy memory usage and so on. EDIT: Updated the code, now including a functional test program. Fixed the PEP-8 ...
3
votes
1answer
28 views

Script for saving top wallpapers from wallbase.cc into a directory

I am newish to Python and I am looking for some extra eyes on a script I wrote. I wrote this script to learn more about web-scraping and using requests and Beautiful Soup. I use it to connect to the ...
3
votes
1answer
50 views

Base class for subclasses that can track their own instances

I'm new to Python, with some background in Java and C# from a while ago, and more recently in scripting worlds like Bash and AppleScript. I wanted to be able to create classes that could report ...
5
votes
2answers
61 views

Taking wind data and simulating future wind profiles

I am new to programming, and am using Python to take wind data and simulate future wind profiles. The code as written takes a while to execute and I was hoping someone could suggest ways to make my ...
2
votes
2answers
74 views

Word counter script

I made a word counter. It works as long as there aren't any lone punctuation marks. How could it be improved? (Could it be made simpler? Are the comments detailed/clear enough? etc.) I know it's ...
10
votes
1answer
94 views

Simplifying Python Pandas code for selecting co-occurrences in a window of time

I am a beginner at programming. I was able to build the thing below, which achieves what I want with a small dataset. With larger datasets, my RAM gets swamped bringing the computer to a halt (2014 ...
1
vote
3answers
77 views

How could I make my simple Python maze game better?

The program is running fine but I was just wondering whether there was anything I could do to make it more user friendly or efficient. Please note that I have only been programming for a couple of ...
6
votes
1answer
252 views

Can my Python maze game be better in any way?

How could I improve or make this program more user friendly? I have not been programming very long, so please don't give me a task that is too complicated. ...
2
votes
1answer
86 views

Simple anagram or permutation generator in Python

In preparation for a job interview I decided to try and implement the classic find all anagrams of a given string solution. I wanted to see if I could translate a javascript solution into python. This ...
4
votes
2answers
98 views

K-means clustering in Python

The following code uses scikit-learn to carry out K-means clustering where \$K = 4\$, on an example related to wine marketing from the book DataSmart. That book uses excel but I wanted to learn Python ...
6
votes
2answers
51 views

Clean and tidy Python code for dictionary look up and API interactions

I am new to programming and entirely self-taught. Below is a program I wrote to retrieve text content via an API and scan the text for important words. If the word is found URI is returned. The API ...
3
votes
2answers
86 views

Small Twitter bot made in Python

I've just started to play around with Python and I've decided to create a little script that post tweets every hour (cronjob on Ubuntu) telling what time it is. I'm not sure if I follow best ...
2
votes
2answers
190 views

Making a nested loop structure more pythonic

I'm looking for a review on my code. I am also looking for ways to transform this function into something more Pythonic. I'm fairly new to Python, so any advice would be appreciated. ...
0
votes
3answers
44 views

Finding the biggest number in a list of numbers

This is the first time I tried to solve a problem and wrote code for it, rather than learning some code and trying out to see what I might be able to do with it. As such, it's not much, but I'd like ...
13
votes
2answers
253 views

First try at a Python game

I've started coding about 3 weeks ago, just for fun and maybe practical uses later. My GF dared me to make a PGM that would replace this dice game where you roll two dice, one with body parts and one ...
3
votes
1answer
62 views

Archiving Tweets via Python

I'm fairly new to Python - though not new to programming by any means. I have this Python script and it works perfect for my needs but being new(er) to Python I'm just looking to see if there are any ...
5
votes
2answers
80 views

Social Media Hashtag Splitting

I decided to try out Python (3.x) two or so weeks ago, and this is my first real script using it. The program I've written below is slow, clunky, inefficient, inaccurate, and probably poorly coded! ...
6
votes
1answer
116 views

Weather Station for a Raspberry Pi

Would you kindly look at my first piece of python code, a weather station on a Raspberry Pi, and tell me how I could have done better? Any comments are much appreciated. The code is here on Github. ...
3
votes
2answers
57 views

Comparing two partition functions in Python

I have written a partition function in Python (my_partition_adv). I have written this one after reading a similar function from a website. The version of the ...
3
votes
1answer
94 views

A small text adventure in Python

I've been teaching myself programming in Python for about three months now using How To Think Like a Computer Scientist and a bit of the internet with the intention of being able to create video games ...
2
votes
1answer
57 views

Inline script routine for Open Sesame experiment

I am new to Python as well as threading and had to build an inline script routine for the use within a Open Sesame Experiment. The Routine should open a program, play tones and catch reaction times. ...
2
votes
1answer
59 views

Password protected Joomla administrator folder with Python

I am trying to make a basic auth password protected folder for Joomla. This script will simply ask for username and password to secure administrator folder in Joomla and creates .htaccess and ...
1
vote
0answers
89 views
7
votes
1answer
79 views

Touchless lightswitch with Raspberry Pi

I am currently developing a touchless lightswitch via a Raspberry Pi, an ultrasonic module and a nice radio module. However, I am quite a beginner in Python and it was a hard time (at least for me) ...
2
votes
0answers
97 views

Script for obtaining images from an IP security camera

I am fairly new to Python and programming in general so I hope the code in this post is not too messy. I have the following code which I use for taking images from an IP security camera: ...
5
votes
1answer
51 views

RAR dictonary attack

I have some old RAR files and I know the general format of passwords I used to use, so I have generated a dictionary file combining those words in a variety of ways. The dictionary file is 500mb and ...
7
votes
3answers
383 views

Better way to create a string of random characters

I'm generating domains with random names but I'm pretty new to Python. I used the map function because it packages the results into a list which I can then join() ...
7
votes
2answers
149 views

Python Email Program

I've written this email program in Python, and I would like to get some feedback on it. (i.e. closing the server twice after the raw input, etc.) ...
6
votes
5answers
198 views

Guessing Game in Python

Now that I've got this working, any improvements that I can make to better my code review would be helpful. ...
1
vote
0answers
108 views

Parse Bloomberg Excel/CSV with Pandas DataFrame

First, please pardon my ignorance. This is my very first Python program. I retrieved Bloomberg data using the Excel API. In the typical fashion, the first row contains tickers in every fourth ...
5
votes
1answer
430 views

Rock, Paper, Scissors in Python

I was eventually going to add another computer and more options to this (i.e., Rock-paper-scissors-lizard-Spock) but I wanted to make sure I was using the best practice for this type of game. Any help ...
10
votes
1answer
79 views

wxPython Item Information Scraper

What is the best method/practice to keep, let's say, over 3,000 lines of code organized for readability? What kind of NO-NOs in regards to coding habits should I get rid of before they become bad ...
4
votes
2answers
160 views

Best way to display big data

I would like to display this data, callable at any time, but I'm not sure if this is the best practice to do so. ...
2
votes
0answers
119 views

Django on virtual machine - watching changes in static files and autocompiling LESS without inotify

I'm setting up a Django development environment using Vagrant to run an Ubuntu virtual machine on VirtualBox. As this is a student project run mostly be very amateur coders and I want everyone to be ...
6
votes
2answers
106 views

Modeling a soccer team with substitutions

I'm new to Python and want to make sure I'm not developing bad habits. If you could please review this code below and give me any tips, practice ideas or critiques you might have. Any ideas on which ...
3
votes
2answers
102 views

Diving into Python sequences: analyze an access.log

As a first little python exercise, I wrote an analyzer/summarizer for my nginx accesslogs. The code works fine but I'm not sure if I used the different types of sequences properly or made some other ...
4
votes
1answer
285 views

Printing out JSON data from Twitter as a CSV?

I'm extremely new to Python, and the Twitter API, but I found a example online that walked me through the process. Now that I've been playing around with it for awhile, I've begun to push the limits ...
6
votes
3answers
436 views

Streamlined for-loop for comparing two lists

I'm new to Python and I'm wondering is there a way to streamline this clunky code I've written. Maybe a built-in function I've never come across before? I run through two lists of binary numbers and ...
5
votes
1answer
132 views

Fallout-style homework game

I've been going through LPHW (learn Python the hard way) lessons and I am now at exercise No36 where I have to create a similar game. Could you please review it and point out beginner mistakes? ...
5
votes
1answer
92 views

Improving a triangulation test script

I am a relative beginner to Python and as such I've been working on little things here and there in the office that strike me as something interesting that might be fun to try and code a solution. ...
3
votes
1answer
58 views

Using classes vs. using functions

I am trying to learn how to tell if my code will be better off creating a class as opposed to using many functions. I am a new Python programmer trying to get the hang of when classes should be ...
1
vote
0answers
46 views

Generate features for future ML analysis of asset returns

I have built the following code to download stock data from yahoo finance. The plan is to then use the inbuilt pandas functions to calculate metrics from this data that will then be used as features ...
3
votes
1answer
95 views

Speed up file format conversion

I wrote this quick script to convert a genotype file into a BED file. Running it seems to be taking a very long time. ...
5
votes
1answer
212 views

Python script using distutils to copy files on a Mac

I have a Python script I have written to copy files to a mounted Windows SMB share on a Mac. ...
4
votes
3answers
1k views

Merge Sort Algorithm in Python

I'm implementing basic sorting algorithms to learn them, and coding, better. Criticisms and possible optimizations welcome. ...
4
votes
1answer
94 views

How to make this lingo game more compact?

I made a lingo game using Python: You guess a word, and if its letter(s) is in the same spot as a hidden word's, you add [] around the letter. If it's in the hidden word, but not in the same spot, ...