Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.

learn more… | top users | synonyms (2) | python jobs

0
votes
0answers
5 views

How to return multiple variables from python to bash

So I have a bash script that calls a python script. At first I was just returning one variable and that is fine, but now I was told to return two variables and I was wondering if there is a clean and ...
1
vote
1answer
17 views

python regular expression to remove repeated words

I am very new a Python I want to change sentence if there are repeated words. Correct Ex. "this just so so so nice" --> "this is just so nice" Ex. "this is just is is" --> "this is just is" ...
0
votes
0answers
9 views

Returning a row from a CSV, if specified value within the row matches condition

Ahoy, I'm writing a Python script to filter some large CSV files. I only want to keep rows which meet my criteria. My input is a CSV file in the following format Locus Total_Depth ...
0
votes
0answers
4 views

Keeping a sprite in a window using pygame

I have a simple pygame script, my character can move around the screen, although, he won't stay on the screen. The program reads that he is touching the edge, but how do I stop him from leaving the ...
-3
votes
0answers
19 views

Best way to create a mouse automatization tool on Linux?

So I'm doing some complex network research and I'm trying to create multiple accounts for a social network in order to obtain data. So I found an amazing program to do autoclicks by murguu, but it ...
0
votes
2answers
22 views

How to return a value from a shell script in a python script

I have a python script which requires a value from a shell script. Following is the shell script (a.sh): #!/bin/bash return_value(){ value=$(///some unix command) echo "$value" } return_value ...
-1
votes
0answers
22 views

Python: Plotting two cases using a definition

I would like to plot two cases. Case (1) is when alpha < pi and beta < pi and Case (2) is when both alpha and beta are greater than or equal pi but less than 2 pi. import numpy as np import ...
3
votes
1answer
24 views

Average number of bits required to store one letter of British English using perfect compression in python

I have an assignment which is written under: What is the average number of bits required to store one letter of British English if perfect compression is used? Since the entropy of an experiment can ...
0
votes
0answers
10 views

Properly using ntlk with python

I am trying to use python with ntlk to get a number of acronyms for a number of words (for now 2). It seems that I can get it to work with the first word, but not the second. I'm guessing I still have ...
2
votes
0answers
13 views

Histogram from data which is already binned, I have bins and frequency values

All the matplotlib examples with hist() generate a data set, provide the data set to the hist function with some bins (possibly non-uniformly spaced) and the function automatically calculates and then ...
0
votes
2answers
14 views

how to establish in models file that a django model should be defined as NOT NULL?

In my models.py file I would like a way to explicitly state that certain fields in my model should be defined as NOT NULL such that the MySQL code would be CREATE TABLE Minion_job(MyColumn ...
-9
votes
0answers
31 views

Python: can I disable intentation “feature” [closed]

Can anyone clue me up as to which config file or other dictionary contains the settings for the intentation feature of python? I kind of need it turned off pronto as it keeps telling me my lines are ...
0
votes
1answer
24 views

String representation of file name

I have a script that uses argparse to handle command line arguments. One argument can be stdin or a file name. The basic code looks like this: import argparse p = argparse.ArgumentParser() ...
0
votes
0answers
8 views

Python urllib2 and authentication leads to None result

I have been following this as a guide: CURL alternative in Python ... but I get None as a result. Opening the URL "in browser" and authenticating leads to success. Am I missing anything here? ...
1
vote
1answer
11 views

Module naming convention (avoid collisions)

I'm learning Python and I have already created few ad-hoc utility modules that I use for whatever. I don't intend to install them anywhere, having them simply laying around and copying them wherever ...

1 2 3 4 5 13183
15 30 50 per page