# Define variables by giving them a name and a value

age = 30

# Print their values out by using the print() function

print(age)

# You can print values directly if you prefer

print(30)

# But having variables means you can change them after the fact

age = 30
print(age)
age = 40
print(age)

# Variable names can contain letters, numbers, and underscores. However, they cannot start with a number.
# There are some reserved names because Python uses them for other things.
# For example, don't call your variable print, because print is something else!

# Longer variable names are written in snake_case in Python:

friend_age = 23
countries_visited = 90

# Variable names you will never change are written in all uppercase

PI = 3.14159
RADIANS_TO_DEGREES = 180 / PI
malu2019(chris wong) - 2019-09-19 0 人
测试测试测试
# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
#打开cmd输入:pip3 install selenium
#根据谷歌浏览器版本在Python安装目录放置谷歌浏览器驱动目录Python37\Scripts\chromedriver.exe

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
import re

def getData():
    time_dq=time.strftime("%Y-%m-%d_%H.%M.%S")
    chrome_options = Options()
    chrome_options.add_argument('--headless')# 无头模式启动
    chrome_options.add_argument('--disable-gpu')# 谷歌文档提到需要加上这个属性来规避bug
    # chrome_options.add_argument('start-maximized')#谷歌浏览器最大化启动
    # chrome_options.add_argument('--no-sandbox')#没有沙盒box
    # chrome_options.add_argument(r'--proxy-server=http://IP:Port')#浏览器IP代理
    driver = webdriver.Chrome(options=chrome_options)#初始化实例

    url_a='https://www.xd0.com/'
    driver.implicitly_wait(10)#隐式等待
    driver.get(url_a)
    page_a=driver.page_source    # selenium的page_source可以直接返回页面源码,重新赋值后打印出来

    url_list=re.findall('href=\"(.*?)\"',page_a,re.S)
    url_get=[]
    for i in url_list:
        if 'http' in i:
            print(i)
            url_get.append(i+'\n')
            # 抓取写入
            f1 = open(r'A_%s.txt' % (time_dq), mode='w+')
            f1.writelines(url_get)
            f1.close()
            driver.quit()  # 关闭释放内存

if __name__ == '__main__':
    getData()
error14(Error_14) - 2019-09-09 0 人
获取目标网页所有超链接(http/https)
# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
#打开cmd输入:pip3 install selenium
#根据谷歌浏览器版本在Python安装目录放置谷歌浏览器驱动目录Python37\Scripts\chromedriver.exe

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
import re

def getData():
    time_dq=time.strftime("%Y-%m-%d_%H.%M.%S")
    chrome_options = Options()
    chrome_options.add_argument('--headless')# 无头模式启动
    chrome_options.add_argument('--disable-gpu')# 谷歌文档提到需要加上这个属性来规避bug
    # chrome_options.add_argument('start-maximized')#谷歌浏览器最大化启动
    # chrome_options.add_argument('--no-sandbox')#没有沙盒box
    # chrome_options.add_argument(r'--proxy-server=http://IP:Port')#浏览器IP代理
    driver = webdriver.Chrome(options=chrome_options)#初始化实例

    url_a='https://www.xd0.com/'
    driver.implicitly_wait(10)#隐式等待
    driver.get(url_a)
    page_a=driver.page_source    # selenium的page_source可以直接返回页面源码,重新赋值后打印出来

    url_list=re.findall('href=\"(.*?)\"',page_a,re.S)
    url_get=[]
    for i in url_list:
        if 'http' in i:
            print(i)
            url_get.append(i+'\n')
            # 抓取写入
            f1 = open(r'A_%s.txt' % (time_dq), mode='w+')
            f1.writelines(url_get)
            f1.close()
            driver.quit()  # 关闭释放内存

if __name__ == '__main__':
    getData()
abcd...(前端大神) - 2019-09-04 0 人
获取目标网页所有超链接(http/https)
# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
#打开cmd输入:pip3 install selenium
#根据谷歌浏览器版本在Python安装目录放置谷歌浏览器驱动目录Python37\Scripts\chromedriver.exe

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
import re

def getData():
    time_dq=time.strftime("%Y-%m-%d_%H.%M.%S")
    chrome_options = Options()
    chrome_options.add_argument('--headless')# 无头模式启动
    chrome_options.add_argument('--disable-gpu')# 谷歌文档提到需要加上这个属性来规避bug
    # chrome_options.add_argument('start-maximized')#谷歌浏览器最大化启动
    # chrome_options.add_argument('--no-sandbox')#没有沙盒box
    # chrome_options.add_argument(r'--proxy-server=http://IP:Port')#浏览器IP代理
    driver = webdriver.Chrome(options=chrome_options)#初始化实例

    url_a='https://www.xd0.com/'
    driver.implicitly_wait(10)#隐式等待
    driver.get(url_a)
    page_a=driver.page_source    # selenium的page_source可以直接返回页面源码,重新赋值后打印出来

    url_list=re.findall('href=\"(.*?)\"',page_a,re.S)
    url_get=[]
    for i in url_list:
        if 'http' in i:
            print(i)
            url_get.append(i+'\n')
            # 抓取写入
            f1 = open(r'A_%s.txt' % (time_dq), mode='w+')
            f1.writelines(url_get)
            f1.close()
            driver.quit()  # 关闭释放内存

if __name__ == '__main__':
    getData()
error14(Error_14) - 2019-08-26 1 人
获取目标网页所有超链接(http/https)
# coding:utf-8
#!/usr/bin/python
# -*- coding: utf-8 -*- 
#! /usr/bin/python3
# -*- coding: utf-8 -*-
 
 
def luhn(card_num):
    s = 0
    card_num_length = len(card_num)
    for _ in range(1, card_num_length + 1):
        t = int(card_num[card_num_length - _])
        if _ % 2 == 0:
            t *= 2
            s += t if t < 10 else t % 10 + t // 10
        else:
            s += t
    return s % 10 == 0
 
 
if __name__ == '__main__':
    print(luhn('6217002747073758862'))                
lfflnnchc(逍遥游) - 2019-08-11 0 人
银行卡号校验
from sys import argv

script, user_name = argv
prompt = '> '

print(f"Hi {user_name}, I'm the {script} script.")
print("I'd like to ask you a few questions.")
print(f"Do you like me {user_name}?")
likes = input(prompt)

print(f"Where do you live{user_name}?")
lives = input(prompt)

print("What kind of computer do you have?")
computer = input(prompt)

print(f"""
Alright, so you said {likes} about likeing me.
You live in {lives}. Not sure where that is.
And you have a {computer} computer. Nice.
""")
shenzhengg(Mao) - 2019-08-02 0 人
ex14.py - input(prompt)
没有了
1/6 下一页