text
stringlengths
226
34.5k
no module named crypto.cipher Question: I'm trying my hands on encryption for a while now. I recently got hands on this python based crypter named [PythonCrypter](https://github.com/jbertman/PythonCrypter). I'm fairly new to Python and when I try to open the CodeSection.py file via terminal, I get error saying `from C...
Add matrix in X-axis using matplotlib Question: I try to add matrices in X-axis using matplotlib. The code I wrote is: #!/bin/python import sys import numpy as np import math import decimal import matplotlib.pyplot as plt import matplotlib.mlab as mlab from matplotlib i...
Delay load/calculate values in Python Question: Many times I run into the situation where I want a static/global/constant variable that may take time to calculate, may be reused many times in a single run, and may not be used at all during a single run. One example would be a filter that I apply to an image that takes...
Pandas variable numbers of columns to binary matrix Question: I am currently working with a data set(csv file) which doesn't have a fixed number of columns. however, I want to convert it to a binary matrix which have a fixed number of columns. as an example, current data set is like this(no headers), a,...
Dronekit API Python: How to connect to the same vehicle from 2 different processes? Question: I am looking for help working with the same vehicle from 2 different processes. I have one SITL instance runnning. I am trying to connect to this same instance from both the main process of my DroneKit script and from a sub- ...
Python, Pygame Blitting to screen (argument 1 must be pygame.Surface) Question: I am creating a list of blocks that i want to loop through to print to the screen in pygame using the pygame.blit function. However an error is thrown that says (argument 1 must be pygame.Surface, not block). I have made other games in pyga...
What happened to ifilter? Question: In comparing documentation for itertools between Python [2](https://docs.python.org/2/library/itertools.html) and [3](https://docs.python.org/3/library/itertools.html), I noticed `ifilter`, `imap`, `izip` are missing from Python 3. I suspect this is because many builtin keywords have...
aysncio cannot read stdin on Windows Question: I'm trying to read stdin asynchronously on Windows 7 64-bit and Python 3.4.3 I tried this inspired by an [SO answer](http://stackoverflow.com/questions/25351999/what-file-descriptor- object-does-python-asyncios-loop-add-reader-expect#answer-25352042): impor...
Python: Why is my program running when I insert pieces one by one, but not when all together? Question: So I created this very easy paber-rock-scissors game in Python (Sorry, the strings are not in English). Anyway, I am running it in IDLE and it works when I insert it like this: 1. from random import randint --> E...
Python subprocess.popen returns empty string Question: import subprocess cd=['sudo','./interface','-a','</tmp/vol.js'] p = subprocess.Popen(cd, stdout = subprocess.PIPE,stderr=subprocess.PIPE, stdin=subprocess.PIPE) Above code returns null but when I run same same command i.e `sudo ./interface -a </t...
Python call function from module in a subprocess Question: I would like to retrieve the stdout, stderr and resultcode of a module function called from the main program. I thought subprocess was the key, but I don't succeed submitting the module function to subprocess. What I have: #my_module.py def ...
BeautifulSoup - getting value from the resultant tags Question: The below code is my python code with beautiful soup for getting a specified value from a given URL. from bs4 import BeautifulSoup import urllib import re book = urllib.urlopen(url) bookpage = book.read() book.close(...
error using MySQLdb Question: I am newbie to python,I have simple code to connect database using MySQLdb and Python3.4 running in localhost. Python Code: #!c:/Python34/python.exe -u import cgitb ,cgi import sys import MySQLdb conn = MySQLdb.connect(host='localhost',port=3306, ...
Basic Maths Game, Python: 'input expected at most 1 arguements, got 4' Question: I've been working with Python for a little while now, and I decided recently I wanted to make a basic maths game that would choose a random number from a list between 0-9, and make you add them together. If your answer was right, it would ...
Handle/catch RuntimeWarnings in connection with igraph python Question: I am running the code testgraph = igraph.Graph.Degree_Sequence(degseq,method = "vl") which sometimes throws the warning RuntimeWarning: Cannot shuffle graph, maybe there is only a single one? at gengraph_graph_mo...
Find the year with the most number of people alive in Python Question: Given a list of people with their birth and end years (all between `1900` and `2000`), find the year with the most number of people alive. Here is my somewhat brute-force solution: def most_populated(population, single=True): ...
Python Pandas - Don't sort bar graph on y axis values Question: I am beginner in Python. I have a Series with Date and count of some observation as below Date Count 2003 10 2005 50 2015 12 2004 12 2003 15 2008 ...
Pydot Error involving parsing ':' character followed by number Question: So I was using pydot in python 2.7 from Anaconda and noticed I keep getting errors when I attempt to use certain strings in Pydot. The error I have isolated to: import pydot graph = pydot.Dot(graph_type='digraph', ran...
Remove accents in Windows username causing troubles with softwares and libraries Question: I have an accent in my Windows username `Clément`. Therefore, there is an accent in my user directory `C:\Users\Clément\`. This causes some troubles for softwares and libraries. For example, I recently installed Python Anaconda ...
Write a CSV from Urlib and manage encoding properly Question: I need to put the content of a vector/list into a CSV. I'm getting trouble with the "python encoding problem" obviously. Here is the code we're taklin' about : import pdb #pdb.set_trace() import sys sys.version_info import csv...
a bug with csv module in python Question: import csv with open('database.csv') as csvfile: reader = csv.DictReader(csvfile) for row in reader: print(row['NAME']) Guys, I have a csv file with the first row as a index, and in linux the code read from row['NAME'] and print only t...
Converting a string of numbers to hex and back to dec pandas python Question: I currently have a string of values which I retrieved after filtering through data from a csv file. ultimately I had to do some filtering of the data but I have the same numbers as a list, dataframe, or array. I just need to take the numbers ...
BeautifulSoup: RuntimeError: maximum recursion depth exceeded Question: I can't avoid the maximum recursion depth Python RuntimeError using BeautifulSoup. I'm trying to recurse over nested sections of code and pull out the content. The prettified HTML looks like this (don't ask why it looks like this :)): ...
How to implement ZCA Whitening? Python Question: Im trying to implement **ZCA whitening** and found some articles to do it, but they are a bit confusing.. can someone shine a light for me? Any tip or help is appreciated! Here is the articles i read : <http://courses.media.mit.edu/2010fall/mas622j/whiten.pdf> <http:/...
Display a grid of images in wxPython Question: I am trying to display a grid of images in wxPython. I am using a GridSizer to create a grid to which I add my staticbitmaps. But for some reason I only see one image at the first position in the grid. I am not sure where I am going wrong. Here is my code and the correspon...
Openstack Neutron: How to update port vif-model using update_port() api Question: I wanted to update vif_model of already created port. I use following command in CLI neutron port-update --binding:vif_model=avp <port_id> How to achieve the same using python apis of neutron. I'm trying to use update...
Django migration fails with "__fake__.DoesNotExist: Permission matching query does not exist." Question: In a Django 1.8 project, I have a migration that worked fine, [when it had the following code](https://github.com/geometalab/osmaxx/blob/378ddc5043f1fd80727067de19316f30d1f725b5/osmaxx- py/osmaxx/contrib/auth/migrat...
More Efficient Way to Create array Question: I am a bit new to python so I am wondering if there is a more efficient way of accomplishing something. Basically I need to create an array of values which come from one of two other arrays depending on a random number (0 or 1) Currently its pretty easy to implement using a ...
Python - Find all intersection points of 2 graphs Question: I'm trying to find all the intersection points of two graphs and display them on the final plot. I've looked around and tried multiple things, but I haven't been able to obtain what l'm looking for. Currently, I attempting to generate a list wherein the inter...
No migrations to apply but Django is still trying to create a new content type Question: I pushed a new release to a server last week which included a database migration for a new table. This completed as expected, and works, but now on every deployment when the server runs it's migrations I'm seeing no migrations to a...
Inspect a large dataframe for errors arising during merge/combine in python Question: I hope this is an appropriate question for here. If not, let me know, and I will remove it immediately. Question: How can I use python to inspect (visually?) a large dataset for errors that arise during combination? Background: I ...
Python rounding of random floats to nearest points on a 2D uniform mesh grid Question: Despite numpy & scipy's many rounding functions, I cannot find one that allows me to discretize randomized floats with respect to nodes in a 2D uniform mesh grid. For example, # create mesh grid n = 11 l = 16. ...
Python curses handling stdout from another thread Question: I'm running two threads in my python program, one thread which uses python curses to run a menu system and waits for input, and one thread which does analysis based on menu choices and outputs it's status via the built in `print()` function. My problem here is...
Why does my list return characters instead of items? Question: This is a very basic question but I'm having trouble understanding why this is. Taking a file with lists separated by new lines, if I use this script... #!/usr/bin/python import sys fil = open(sys.argv[1]) for lin...
How do I apply my python code to all of the files in a folder at once, and how do I create a new name for each subsequent output file? Question: The code I am working with takes in a .pdf file, and outputs a .txt file. My question is, how do I create a loop (probably a for loop) which runs the code over and over again ...
Why is Python 3 is considerably slower than Python 2? Question: I've been trying to understand why Python 3 is actually taking much time compared with Python 2 in certain situations, below are few cases I've verified from python 3.4 to python 2.7. Note: I've gone through some of the questions like [Why is there no xra...
python: how to delete row and modify specific list string from CSV Question: This is my first time posting a question so I apologise in advance if I make any mistakes. I am currently attempting to create a custom python program (pretty much a parser) that takes in data as such: junk junk junk ...
Python error urllib.request error in pycharm Question: Getting the following error in when running this code using Pycharm import random import urllib.request def download_web_image(url): name = random.randrange(1, 1000) full_name = str(name) + ".jpg" urllib...
numpy.random has no attribute 'choice' Question: I am using python 2.7.2 |EPD 7.1-1 (64-bit) and for some reason numpy.random.choice is not working: from the terminal window: d-108-179-168-72:~ home$ python Enthought Python Distribution -- www.enthought.com Version: 7.1-1 (64-bit) Pytho...
Django UpdateView with ImageField attribute Question: I am having trouble in making UpdateView Class.I was able to do createView and UpdateView without adding any form before adding up the imageField. But now I have imageField, which is creating problem. Fortunately, I am able to do createView and its working fine. Fo...
How to do Parameterization/Data driven testing using selenium in Python Question: I'm learning automation, and i have a few set of login id's and i'm trying to login and logout in amazon.com website and with a set of login id's and password which are in a excel file. Issue what i'm facing is to figure out how to hover...
How to remove '\n' from scrapy output in python Question: I am trying to output to CSV but I realized that when scraping tripadvisor I am getting many carriage returns thus the array goes over 30 while there are only 10 reviews so I get many fields missing. Is there a way to remove the carriage returns. spider. ...
How to find the median and standard deviation by job in the below data in python? Question: I have CSV file like below and i want to calculate the median and standard deviation of salaries by each job salaries.csv City Job Salary Delhi Doctors 500 Delhi Lawyers 400 Delhi ...
Boost Python, propagate C++ callbacks to Python causing segmentation fault Question: I have the following listener in C++ that receives a Python object to propagate the callbacks. class PyClient { private: std::vector<DipSubscription *> subs; subsFactory *sub; ...
Parse multiple subcommands in python simultaneously or other way to group parsed arguments Question: I am converting Bash shell installer utility to Python 2.7 and need to implement complex CLI so I am able to parse tens of parameters (potentially up to ~150). These are names of Puppet class variables in addition to a ...
Passing Python functions to Gnuplot Question: Plotting a Python function in Gnuplot is not straightforward although there are some solutions. For example, one could either cast its values into an array or manually translate its expression into Gnuplot’s syntax. Here is an example that uses the module [`Gnuplot.py`](htt...
Fitting a Binomial distribution with pymc raises ZeroProbability error for certain FillValues Question: I'm not sure if I found a bug in pymc. It seems like fitting a Binomial with missing data can produce a `ZeroProbability` error depending on the chosen fill_value that masks missing data. But maybe I'm using it wrong...
Output from two processes on shell (Python,Linux) Question: My python script executes program that sends its output on shell. However, script should simultaneously execute its own commands which also have its output on shell. Is it possible to do that? Will I see output both from the script and from the process? Here i...
Python Import using __init__.py instead of adding to sys.path Question: This is my file structure. /working dir __init__.py main.py /packages __init__.py snafu.py /subfolder1 __init__.py foo.py /subfol...
Django Web Development Server Not Working Question: I'm trying my hands upon Django and just started with this and frankly speaking i'm very beginner at this. Now recently I encountered a problem which is linked to some settings I guess but i'm not able to understand and solve this problem. Whenever I write ...
KeyError: SPARK_HOME during SparkConf initialization Question: I am a spark newbie and I want to run a Python script from the command line. I have tested pyspark interactively and it works. I get this error when trying to create the sc: File "test.py", line 10, in <module> conf=(SparkConf().setMa...
How to ensure a file is closed for writing in Python? Question: The issue described [here](http://stackoverflow.com/questions/31447975/python- open-write-on-windows-permission-issue-ioerror-for-file-created) looked initially like it was solvable by just having the spreadsheet closed in Excel before running the program....
How to set site-packages directory for local Python 2.7 install Question: I'm trying to run a certain script in Python, but it requires some other modules (setuptools) - I don't have write permissions for our /usr/ directory to install them, so I'm trying to install a local version of Python 2.7 to run it (not in /usr/...
How to delete repeating lines starting with specific word in python Question: I have an inputfile of the form All tests start with the word "Test" and all errors start with the word "error" Test1 Error1 Error1 Error2 Test1 Error3 Test2 Error1 Error4 Test2 ...
python subprocess & popen invalid syntax Question: I am new to scripting. I have this line in bash I'm trying to write in python. numcpu = ($(cat /proc/cpuinfo | grep 'physical id' | awk '{print $NF}' | sort | uniq | wc -l)) I have tried using sub and popen and couldnt get it to work. Here's the li...
Elasticsearch Python client Reindex Timedout Question: I'm trying to reindex using the Elasticsearch python client, using <https://elasticsearch- py.readthedocs.org/en/master/helpers.html#elasticsearch.helpers.reindex>. But I keep getting the following exception: `elasticsearch.exceptions.ConnectionTimeout: ConnectionT...
A way to display currency? Question: I have database values such as the following: price currency 10.99 USD 13.99 EUR Is there a python library or something that I can use for help with displaying the currency properly on a storefront? For example, it should be: ...
How to get points inside multiple polydata Question: I use `vtkAppendPolyData` to merge multiple polydata into one polydata, and `vtkSelectEnclosedPoints` to get points inside the polydata. Here is the python code using `tvtk.api`: from tvtk.api import tvtk # create some random points ...
Datetime comparisons in python Question: I have a file with two different dates: one has a timestamp and one does not. I need to read the file, disregard the timestamp, and compare the two dates. If the two dates are the same then I need to spit it to the output file and disregard any other rows. I'm having trouble kno...
Use NLTK to find reasons within text Question: For my project at work I am tasked with going through a bunch of user generated text, and in some of that text are reasons for cancelling their internet service, as well as how often that reason is occurring. It could be they are moving, just don't like it, or bad service,...
Python mock Patch os.environ and return value Question: Unit testing conn() using mock: app.py import mysql.connector import os,urlparse def conn(): if 'DATABASE_URL' in os.environ: url=urlparse(os.environ['DATABASE_URL']) g.db = mysql.connector.connect(user=url.user...
Pair of python processes communication Question: I need to implement 2 python processes: 1. a python client process that will connect to a https server on the web 2. a python server process that will server 1 or 2 clients (UIs) over ssh if client is outside network, or just tcp if client is inside LAN. Info will ...
How to update a graph using matplotlib Question: I'm using Panda and matplotlib to draw graphs in Python. I would like a live updating gaph. Here is my code: import matplotlib.pyplot as plt import matplotlib.animation as animation import time import numpy as np import MySQLdb import p...
Pyspark VS native python speed Question: I am running Spark on a Ubuntu VM (4GB, 2 cores). I am doing this simple test of a word count. I am comparing it to a simple Python `dict()` counter. I find that Pyspark is 5x slower (takes more time). Is this because of the initialisation or do I need to tune a parameter? ...
Get Python type of Django's model field? Question: How can I get corresponding Python type of a Django model's field class ? from django.db import models class MyModel(models.Model): value = models.DecimalField() type(MyModel._meta.get_field('value')) # <class 'django.db.models...
complex ajax query using parse api Question: Im dealing with parse.com's apis. I want to make complex queries in my javascript function. I couldnt manage to equivalant params section below code for ajax get request. Any help appriciated. For example, to retrieve scores between 1000 and 3000, they gave example in pyth...
Overwrite/Don't overwrite option for Dropbox API Upload Question: I have found the following script from an old StackOverflow question which gives an example of how to connect to my Dropbox via the API: import dropbox client = dropbox.client.DropboxClient(<auth_token>) print 'linked account:...
NumPy: Importing a Sparse Matrix from R into Python Question: I have a matrix in R that is very large and sparse, created with the 'Matrix' package, and I want to handle in python + numpy. The R object is in the csc format, and if I export it using the function writeMM in the Matrix package, the output looks something ...
Error running *requests* Question: Installed Python/Pip on OSX 10.10 using instructions here <http://docs.python- guide.org/en/latest/starting/install/osx/> Only installed to gain access to Pip Installed requests using `pip install requests` Ran script import requests feed_url = 'http://www.m...
Identifying Lists of Numbers With Regular Expressions in Python Question: I'm working with data from an online math tutor program, and I'd like to be able to identify some features of those problems. For example, for the following question: Find the median of the 7 numbers in the following list: [22,...
How to print current logging configuration used by the python logging module? Question: I'm using the python logging module. I update the logging config using logging.dictConfig(). I would like a way to read the current configuration (e.g. level) used by each logger and print it. How can I get and print this informa...
python ImportError without import call Question: Okay, I'm stumped on this one. I've looked around but I can't find anything and can't figure out how to debug this. Basically, python is throwing an `ImportError` at a line of code where I'm not importing anything. I've a decently large module `ICgen` which contains the ...
Python Dynamic Import Can't Find Packages in Virtualenv Question: So, I have a directory structure: main.py \_ modules/ \_ a.py \_ b.py In main.py, modules are dynamically loaded at runtime, depending on which modules are specified. (This allows for a hypothetical `c.py` to be add...
Full-matrix approach to backpropagation in Artificial Neural Network Question: I am learning Artificial Neural Network (ANN) recently and have got a code working and running in Python for the same based on mini-batch training. I followed the book of [Michael Nilson's Neural Networks and Deep Learning](http://neuralnetw...
Wrong variable data type? Question: I have class, which intended to grab user name and his email from Git commits: class BitbucketData(object): def get_user_name(self): proc = subprocess.Popen("git --no-pager show -s --format='%an'", stdout=subprocess.PIPE) commi...
"InsecurePlatformWarning" while installing django Question: I am using: -CentOS 6.6 on my Mac on virtual environment, -Python 2.6.6 I am using this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-centos-7) to install Django: I am new to Python and Django and i f...
NoReverseMatch at / Reverse for 'password_change_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] Question: my views part: @login_required def password_change(request, template_name='register.html', password_change_form=PasswordChangeForm...
Create random, unique variable names for objects Question: I'm playing around with Python and any programming language for the first time, so please bear with me. I started an online class two weeks ago, but try to develop a small game at the side to learn faster (and have fun). It's a text adventure, but is shall have...
Need table to populate with search results from search bar Question: I have a webpage with a search bar and a bunch of dropdown menus but just the search bar is important right now. Anyways I have it working where when I click the go button after the search bar it brings up a table, but wont put the searched item in th...
"working outside of application context" in Google App Engine with Python remote API Question: I deployed one simple project on Google App Engine and there the project is working. Before I was able to get list of users from datastore through the remote API console , but now this no longer works. To start the remote API...
Plot of 3D matrix with colour scale - Python Question: I would like to plot a 3D matrix - essentially a box of numbers, each labelled by an `x, y, z` triad of coordinates- by assigning a different colour to each of the `x, y, z` point, according to its magnitude (for example, bigger numbers in red and smaller numbers i...
How to reach the mediafire direct link that is hidden behind a captcha? Question: I wrote a python program to download a file from the internet : url = "http://download2163.mediafire.com/icum151v51zg/55rll9s5ioshz5n/Alcohol52_FE_2-0-3-6850.exe" file_name ='file' u = urllib2.urlopen(url) f...
sklearn GridSearchCV (Scoring Function error) Question: I was wondering if you can help me out with an error I am receiving in running grid search. I think it might due to misunderstanding on how grid search actually works. I am now running an application where I need grid search to evaluate best parameters using a di...
Django Error: cannot import name autodiscover_modules Question: I meet this error when I deploy my Django project on another VPS. The same codes can run successfully on my Macbook and a staging VPS. My website based on Django 1.4.20, and import some third python library and Django apps, for example redis-py, requests,...
Multiclass linear SVM in python that return probability Question: How can I implement a linear SVM for multi-class which returns the proabability matrix for the test samples. Train samples: mxn Train labels: mxc Test labels : mxc, where column has the probability of each class. The function in sklearn which does "one-...
Python script run via cron job returning IOError [error no2] Question: I'm running a Python feedparser script via cron job on a Centos6 remote server (SSHing into the server). In Crontab, this is my cron job: MAILTO = [email protected] */10 * * * * /home/local/COMPANY/malvin/SilverChalice_CampusIn...
Converting ascii file to netcdf using python Question: I would like to add all the data from an ascii file to a netcdf file. The ascii file has data for every 0.25 degree cell on earth. I am able to create all the lat/lon dimensions but not able to add the data. The ascii file is here: <https://www.dropbox.com/s/lybu6...
Python HTTPPasswordMgrWithDefaultRealm error Question: I am new to programming. I want write a parser for the beginning. Code: import urllib import urllib.request url = 'https://example.com' username = 'login1' password = 'pass' p = urllib.request.HTTPPasswordMgrWithDefaultRealm() ...
Beyond for-looping: high performance parsing of a large, well formatted data file Question: I am looking to optimize the performance of a big data parsing problem I have using `python`. In case anyone is interested: the data shown below is segments of whole genome DNA sequence alignments for six primate species. Curre...
NetworkX : When I add 'weight' to some node I can not generatee adjacecy_matrix()? Question: The moment I add 'weight' to a node, I can no longer generate adjacency_matrix() ? Any ideas of how to still be able to generate it ? In [73]: g2 = nx.Graph() In [74]: g2.add_path([1,2,3,5,4,3,1,4,3,7,2]...
Accessing an array with ctypes in Python Question: I am writing a ode-solver in C, exported to a Windows DLL and a Python wrapper for the DLL. I am very used to Python, but I'm a complete beginner with C and ctypes too. A modified solution inspired by the accepted answer [here](http://stackoverflow.com/questions/18679...
import error for pyautogui Question: I installed the pyautogui module and dependencies via pip-3.2 on my raspi correctly, However when I am trying to do import pyautogui I am getting an import error: ImportError: No module named pyautogui What am I doing wrong? Did the command ...
Getting the names of unicode pictograms Question: I'm trying to analyse a text stream that includes unicode pictograms like these: -> 128132 -> Lipstick -> 128133 -> Nail Polish -> 128139 -> Kiss Mark I'd like to be able to look up the name of each of these characters, so for example any...
Facing issues while importing third party (pygoogle) library in main.py for making android apk via buildozer Question: I am trying to importing pygoogle by `import pygoogle` in my main.py but when i make an app via buildozer , in logcat i am finding that `no module named pygoogle` I have installed pygoogle in my kali l...
Python : Printing While Loop data set to a file Question: I am trying to take sensor data and plot it into a graph via JSON. I would like to read the first 100 sensor values and create a file, after the 100, I want to replace the 1st with 101, 2nd with 102... etc so the file is constantly showing the latest 100 lines. ...
Decode using ASN.1 where substrate contains some opaque data Question: I would like to use `pyasn1` to decode some data, part of which is opaque. That is, part of the data contained in the ASN.1-defined structure may or may not be ASN.1 decode-able, and I need to parse the preamble to find out how to decode it. Based ...
Matplotlib error Line2d object s not iterable error in tkinter callback nothing shows up Question: The code is shown below. I am attempting to animate using vectors calculated earlier a figure window is opened so i know it gets this far and the vectors are being calclated correctly. But matplotlib oututs nothing but th...
Pyspark reduceByKey with (key, Dictionary) tuple Question: I'm stuck a bit in trying to do a map-reduce on databricks with spark. I want to process log files and I want to reduce to a (key, dict()) tuple. However I'm always getting an error. I'm not hundert percent sure if that's the right way to do it. I'd be very gl...
Is there a way to have atom editor automatically open docs related to a particular python module when it is imported? Question: Basically when I import a module, I want atom to automatically show related object methods and a little information about the method to speed up programming. Is it possible? Answer: There is...
how to get week number on python? Question: I want to get week number like picture below [![enter image description here](http://i.stack.imgur.com/zTOsQ.png)](http://i.stack.imgur.com/zTOsQ.png) If I insert 20150502, It should print "week 1". If I insert 20150504, It should print "week 2". If I insert 20150522, It ...