I tried to display the time and today's weather w

Hello. I ’m rirocan, an active student.

I tried to display the time and today's weather w

time.py



# -*- coding: utf-8 -*-
import datetime#Basic date and time types
import multiprocessing#You can use the API to spawn a process.
import urllib2, sys#An extensible library for opening URLs.
import json

try: citycode = sys.argv[1]
except: citycode = '090010' #Default region

todaydetail  =    datetime.datetime.today()#Today's date
resp = urllib2.urlopen('http://weather.livedoor.com/forecast/webservice/json/v1?city=%s'%citycode).read()#today's weather
resp = json.loads(resp)
print '----------------------------------------------------------------------------------------'

print todaydetail#Today's date
print '----------------------------------------------------------------------------------------'
print resp['title']#today's weather
print resp['description']['text']
print '----------------------------------------------------------------------------------------'


Recommended Posts

I tried to display the time and today's weather w
I tried to illustrate the time and time in C language
I tried to display the video playback time (OpenCV: Python version)
I tried to enumerate the differences between java and python
I tried to move the ball
I tried to estimate the interval.
I tried to automatically post to ChatWork at the time of deployment with fabric and ChatWork Api
I want to record the execution time and keep a log.
I tried to summarize the umask command
I tried tensorflow for the first time
I tried to recognize the wake word
I tried to summarize the graphical modeling.
I tried to estimate the pi stochastically
I tried to touch the COTOHA API
I want to display the progress bar
I tried to create serverless batch processing for the first time with DynamoDB and Step Functions
I tried to summarize until I quit the bank and became an engineer
I tried moving the image to the specified folder by right-clicking and left-clicking
I tried to visualize the age group and rate distribution of Atcoder
I want to separate the processing between test time and production environment
I tried to express sadness and joy with the stable marriage problem.
I tried to learn the angle from sin and cos with chainer
I tried to extract and illustrate the stage of the story using COTOHA
I tried to verify and analyze the acceleration of Python by Cython
I tried to display the altitude value of DTM in a graph
I implemented the VGG16 model in Keras and tried to identify CIFAR10
I tried to control the network bandwidth and delay with the tc command
I tried web scraping to analyze the lyrics.
I tried using scrapy for the first time
I tried cluster analysis of the weather map
I implemented DCGAN and tried to generate apples
I tried to optimize while drying the laundry
I tried to save the data with discord
I tried to touch the API of ebay
I tried to correct the keystone of the image
I tried Mind Meld for the first time
Qiita Job I tried to analyze the job offer
LeetCode I tried to summarize the simple ones
[Introduction to PID] I tried to control and play ♬
I tried to implement the traveling salesman problem
I want to display the progress in Python!
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!
I tried to notify the update of "Hamelin" using "Beautiful Soup" and "IFTTT"
I want to make a music player and file music at the same time
I tried to process and transform the image and expand the data for machine learning
[LIVE] I tried to deliver the sunrise and sunset times nationwide every day
[Introduction to AWS] I tried porting the conversation app and playing with text2speech @ AWS ♪
I tried to pass the G test and E qualification by training from 50
I tried to display the infection condition of coronavirus on the heat map of seaborn
I tried to debug.
I tried to paste
I tried to learn the sin function with chainer
I tried to graph the packages installed in Python
I tried to read and save automatically with VOICEROID2 2
I tried Python on Mac for the first time.
I tried to detect the iris from the camera image
I tried to implement and learn DCGAN with PyTorch
I tried adding post-increment to CPython. Overview and summary
I tried to touch the CSV file with Python
I tried to predict the J-League match (data analysis)