【python脚本报错js2py】 module 'js2py' has no attribute 'evaljs'

我在cmd pip install安装js2py之后打算在edle中测试一下能否正常使用,发现报错为module 'js2py' has no attribute 'evaljs'。上网搜索了一下答案,发现有两条解决方法:
(1)删除_pycache_文件,原理好像是删除不正常记录,使得python直接重新带调用moudle而不是pyc文件
(2)采用from xxx import xxx方法,手动调用
报错如图所示

![如图所示,我想调用evaljs方法](https://img-ask.csdn.net/upload/201910/27/1572173953_851135.png)


这两种办法我都有尝试,可是还是解决不了。搜索了网上内容,发现没有相关问题解决办法了,所以想求助各位,还请不吝赐教。

2个回答

把你的文件名改一下,不要改成和包名一样。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
执行 python manage.py makemigrations 提示错误

Traceback (most recent call last): File "manage.py", line 23, in <module> main() File "manage.py", line 19, in main execute_from_command_line(sys.argv) File "D:\codeProgram\python3.7\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line utility.execute() File "D:\codeProgram\python3.7\lib\site-packages\django\core\management\__init__.py", line 357, in execute django.setup() File "D:\codeProgram\python3.7\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "D:\codeProgram\python3.7\lib\site-packages\django\apps\registry.py", line 114, in populate app_config.import_models() File "D:\codeProgram\python3.7\lib\site-packages\django\apps\config.py", line 211, in import_models self.models_module = import_module(models_module_name) File "D:\codeProgram\python3.7\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "D:\codeStudy\django企业开发实战\typeidea\typeidea\blog\models.py", line 8, in <module> class Category(models.Model): File "D:\codeStudy\django企业开发实战\typeidea\typeidea\blog\models.py", line 20, in Category owner = models.ForeignKey(User, verbose_name="作者") TypeError: __init__() missing 1 required positional argument: 'on_delete' ``` # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models class Category(models.Model): STATUS_NORMAL = 1 STATUS_DELETE = 0 STATUS_ITEMS = ( (STATUS_NORMAL, '正常'), (STATUS_DELETE, '删除'), ) name = models.CharField(max_length=50, verbose_name="名称") status = models.PositiveIntegerField( default=STATUS_NORMAL, choices=STATUS_ITEMS, verbose_name="状态") is_nav = models.BooleanField(default=False, verbose_name="是否为导航") owner = models.ForeignKey(User, verbose_name="作者") created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") class Meta: verbose_name = verbose_name_plural = '分类' class Tag(models.Model): STATUS_NORMAL = 1 STATUS_DELETE = 0 STATUS_ITEMS = ( (STATUS_NORMAL, '正常'), (STATUS_DELETE, '删除'), ) name = models.CharField(max_length=10, verbose_name="名称") status = models.PositiveIntegerField( default=STATUS_NORMAL, choices=STATUS_ITEMS, verbose_name="状态") owner = models.ForeignKey(User, verbose_name="作者") created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") class Meta: verbose_name = verbose_name_plural = '标签' class Post(models.Model): STATUS_NORMAL = 1 STATUS_DELETE = 0 STATUS_DRAFT = 2 STATUS_ITEMS = ( (STATUS_NORMAL, '正常'), (STATUS_DELETE, '删除'), (STATUS_DRAFT, '草稿'), ) title = models.CharField(max_length=255, verbose_name="标题") desc = models.CharField(max_length=1024, blank=True, verbose_name="摘要") content = models.TextField(verbose_name="正文", help_text="正文必须为MarkDown格式") status = models.PositiveIntegerField( default=STATUS_NORMAL, choices=STATUS_ITEMS, verbose_name="状态") category = models.ForeignKey(Category, verbose_name="分类") tag = models.ManyToManyField(Tag, verbose_name="标签") owner = models.ForeignKey(User, verbose_name="作者") created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") class Meta: verbose_name = verbose_name_plural = "文章" ```

django中创建表python manage.py makemigrations出现以下错误 ,望大神指导

![图片说明](https://img-ask.csdn.net/up load/201812/05/1544007099_480215.jpg) ![图片说明](https://img-ask.csdn.net/upload/201812/05/1544012043_872565.jpg) C:\Users\Administrator\PycharmProjects\mysite>python manage.py makemigrations Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 216, in ensure_connection self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 194, in connect self.connection = self.get_new_connection(conn_params) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\mysql\base.py", line 227, in get_new_connection return Database.connect(**conn_params) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\__init__. py", line 94, in Connect return Connection(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 327, in __init__ self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 598, in connect self._request_authentication() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 873, in _request_authentication auth_packet = _auth.caching_sha2_password_auth(self, auth_packet) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\_auth.py" , line 253, in caching_sha2_password_auth pkt = _roundtrip(conn, data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\_auth.py" , line 112, in _roundtrip pkt = conn._read_packet() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 683, in _read_packet packet.check_error() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\protocol. py", line 220, in check_error err.raise_mysql_exception(self._data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\__init__.py", line 381, in execute_from_command_line utility.execute() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\base.py", line 353, in execute output = self.handle(*args, **options) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\base.py", line 83, in wrapped res = handle_func(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\manag ement\commands\makemigrations.py", line 103, in handle loader.check_consistent_history(connection) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrati ons\loader.py", line 281, in check_consistent_history applied = recorder.applied_migrations() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrati ons\recorder.py", line 61, in applied_migrations if self.has_table(): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\migrati ons\recorder.py", line 44, in has_table return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cur sor()) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 255, in cursor return self._cursor() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 232, in _cursor self.ensure_connection() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 216, in ensure_connection self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\utils.p y", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 216, in ensure_connection self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\base\base.py", line 194, in connect self.connection = self.get_new_connection(conn_params) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backend s\mysql\base.py", line 227, in get_new_connection return Database.connect(**conn_params) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\__init__. py", line 94, in Connect return Connection(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 327, in __init__ self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 598, in connect self._request_authentication() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 873, in _request_authentication auth_packet = _auth.caching_sha2_password_auth(self, auth_packet) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\_auth.py" , line 253, in caching_sha2_password_auth pkt = _roundtrip(conn, data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\_auth.py" , line 112, in _roundtrip pkt = conn._read_packet() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\connectio ns.py", line 683, in _read_packet packet.check_error() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\protocol. py", line 220, in check_error err.raise_mysql_exception(self._data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception raise errorclass(errno, errval) django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES) ")

使用docker 制作python 镜像是报错

Dockerfile 如下 FROM python:2.7 LABEL maintainer="xiaodao11 295621649@qq.com" RUN pip install flask COPY app.py /app/ WORKDIR /app EXPOSE 5000 CMD ["python","app.py"] docker build ....报错 .. Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x7f759b4c4610>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/selectivesearch/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._ve............. 环境是阿里云 服务器 centos 7

python selenium可以导入,但是没有attribute get

PIP3 install selenium成功安装 from selenium import webdriver也是成功的 driver=webdriver.chrome也可以 drive.get("www.baidu.com") 出现错误AttributeError: module 'selenium.webdrive.chrome' has no attribute 'get' 到底是哪一步没有安装对吗?百度了下也没看到有谁有这个问题的

numpy.ndarray' object has no attribute 'show'

已安装:matplotlib,pyparsing,numpy,scipy 源代码: #!/usr/bin/env python # -*- coding:utf-8 -*- from PIL import Image from pylab import* im=array(Image.open('c:\\Python27\\tiananmen.jpg')) im.show() x=[100,100,400,400] y=[200,500,200,500] plot(x,y,'r*') #使用红色星状标记绘制点 plot(x[:2],y[:2])#绘制连接前两个点的线 title('Plotting:"tiananmen.jpg"') #添加标题

笨方法学python3上的习题43AttributeError: 'NoneType' object has no attribute 'enter',哪错了

from sys import exit from random import randint from textwrap import dedent class Scene(object): def enter(self): print("This scene is not yet configured.") print("Subclass it and implement enter().") exit(1) class Engine(object): def __init__(self,scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() last_scene = self.scene_map.next_scene('finished') while current_scene != last_scene: next_scene_name = current_scene.enter() current_scene = self.scene_map.next_scene(next_scene_name) # be sure to print out the last scene current_scene.enter() class Death(Scene): quips = [ "You died. You kinda suck at this.", "Your mom would be pround...if she were smarter.", "such a luser.", "I have a small puppy that's better st this.", "You're worse than your Dad's jokes.", ] def enter(self): print(Death.quips[randint(0, len(self.quips)-1)]) exit(1) class CentralCorridor(Scene): def enter(self): print(dedent(""" The Gothons of Planet Percal #25 have invaded your ship and destroyed your entire crew. You are the last surviving member and your last mission is to get the neutron destruct bomb from the Weapons Armory, put it in the bridge, and blow the ship up after getting into an escape pod. You're runing down the central corridor to the Weapons Armory when a Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costume flowing around his hate filled body. He's blocking the door to the Armory and zbout to pull a weapon to blast you. """)) action = input("> ") if action == "shoot!": print(dedent(""" Quick on the draw you yank out your blaster and fire it at the Gothon. His clown costume is flowing and moving around his body, which throws off your aim. Your laser hits his costume but misses him entirely. This completely ruins his brand new costume his mother bought him, which makes him fly into an insane rage and blast you repeattedly in the face until you are dead. Then he eats you. """)) return 'death' elif action == "dodge!": print(dedent(""" Lke a world class boxer you dodge, weave, slip and slide right as the Gothon's blaster cranks a laser past your head. In the middle of your artful dodge your foot slips and you bang your head on the metal wall and pass out. You wake up shortly after only to die as the Gothon stomps on your head and eats you. """)) return 'death' elif action == "tell a joke": print(dedent(""" Lucky for you they made you learn Gothon insults in the academy. You tell the one Gothon joke you know: Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur ubhfr. The Gothon stops, tries not to laugh, then busts out laughing and can't move. While he's laughing you run up and shoot him square in the head putting him down, then through the Weapon Armory door. """)) return 'laser_weapon_armory' else: print("DOES NOT COMPUTE!") return 'central_corridor' class LaserWeaponArmory(Scene): def enter(self): print(dedent(""" Youd do a dive roll into the Weapon Armory, crouch and scan the room for more Gothons that might be hiding. It's dead quiet, too quiet,You stand up and run to the far side off the room and find the neutron bomb in its container. There's a keypad lock on box and you need the code to get the bomb out. If you get the code wrong 10 times then the lock closes forever and you can't get the bomb. The code is 3 digits. """)) code = f"{randint(1,9)}{randint(1,9)}{randint(1,9)}" guess = input("[keypad]> ") guesses = 0 while guess != code and guesses<10: print("BZZZZEDDD!") guesses += 1 guess = input("[keypad]> ") if guess == code: print(dedent(""" The container clicks open and the seal breaks, letting gas out. You grab the neutron bomb and run as fast as you can to the bridge where you must place it in the right spot. """)) return 'the bridge' else: print(dedent(""" The lock buzzes one last time and then you hear a sickening melting sound as the mechanism is fused together. You decide to sit there, and finally the Gothons blow up the ship from their ship and you die. """)) return 'death' class TheBridge(Scene): def enter(self): print(dedent(""" You burst onto the Bridge eith the entron destruct bomb under your arm and surprise 5 Gonthons who are trying to take control of the ship. Each of them has an even uglier clown sostume than last.They have't pulled their weapons out yet, as they see the active bomb under your arm and don't want to set it off. """)) action = input("> ") if action == "throw the bomb": print(dedent(""" In a panic you throw the bomb at group of Gothons and make a leap for the door. Right as you drop it a Gothon shoots you right in the back killing you. As you die you see another Gothon frantically try to disarm the bomb. You die knowing they will probably blow up when it goes off. """)) return 'death' elif action == "slowly place the bomb": print(dedent("""" You point your blaster at the bomb under your arm and the Gothons put their hands up adn start to sweat. You inch backward to the door, open it, and then carefully place the bomb on the floor, pointing your blaster at it. You then jump back through the door punch the close button and blast the lock so the Gothons can't get out. Now that bomb is placed you run to the escape pod to get off this tin can. """)) return 'escape_pod' else: print("DOES NOT COMPUTE!") return 'the_bridge' class EscapePod(Scene): def EscapePod(self): print(dedent(""" You rush through the ship desperately trying to make it to the escape pod before the whole ship explodes. It seems like hardly any Gothons are on the ship, so you run is clear of interference. You get to the chamber with the escape pods, and now need to pick one to take. Some of them could be damaged but you don't have time to look. There;s 5pods, which one do you take? """)) good_pod = randint(1,5) guess = input("[pod #> ") if int(guess) != good_pod: print(dedent(""" You jump into pod {guess} and hit the eject button. The pod escapes out into the void of space, then implodes as the hull ruptures, crushing your body into jam jelly. """)) return 'death' else: print(dedent(""" You jump into pod {guess} and hit the eject button. The pod easily slides out into space heading to the plantes below. As it flies to the planet, you look back and see your ship implode then explode like a bright star, taking out the Gothon ship at the same time. You won! """)) return 'finished' class Finished(Scene): def enter(self): print("You won! Good job.") return 'finished' class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'laser_weapon_armory':LaserWeaponArmory(), 'the_bridge':TheBridge(), 'escape_pod':EscapePod(), 'death':Death(), 'finished':Finished(), } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self,): return self.next_scene(self.start_scene) a_map = Map('central_corrider') a_game = Engine(a_map) a_game.play() 返回结果: Traceback (most recent call last): File "F:/Python/test43.py", line 228, in <module> a_game.play() File "F:/Python/test43.py", line 18, in play next_scene_name = current_scene.enter() AttributeError: 'NoneType' object has no attribute 'enter' Process finished with exit code 1 看了好久,就是找不到是哪里错了,很烦

提问:测试Tensorflow object detection API,然后就出问题了?

# AttributeError: module 'tensorflow.python.keras' has no attribute 'Model' ![图片说明](https://img-ask.csdn.net/upload/201901/19/1547905831_372525.png) 大神们帮我看看怎么弄

tensorflow报错,我已经训练好的模型,在测试的时候报错Failed precondition: Attempting to use uninitialized value

Traceback (most recent call last): File "D:\Anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call return fn(*args) File "D:\Anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn target_list, run_metadata) File "D:\Anaconda3\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found. (0) Failed precondition: Attempting to use uninitialized value encoder/word_att/Variable [[{{node encoder/word_att/Variable/read}}]] [[prop/Softmax/_129]] (1) Failed precondition: Attempting to use uninitialized value encoder/word_att/Variable [[{{node encoder/word_att/Variable/read}}]] 0 successful operations. 0 derived errors ignored.

使用jieba切词时出现格式问题

``` from gensim.models import word2vec import gensim import logging import jieba,re,codecs ##结巴分词——添加新字典 jieba.load_userdict("E:/workplace/data/userdict.txt") test=open("E:/workplace/data/test.txt",'r',encoding='Utf-8') words=list(jieba.cut(test,cut_all=False,HMM=True)) #输入文本 是否为全模式分词 与是否开启HMM进行中文分词 words= ''.join(words)#将列表转化为字符串 ``` 报错: ``` warnings.warn("detected Windows; aliasing chunkize to chunkize_serial") Traceback (most recent call last): File "<ipython-input-17-a64173a4fbe2>", line 1, in <module> runfile('E:/workplace/code/untitled0.py', wdir='E:/workplace/code') File "D:\Program Files (x86)\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace) File "D:\Program Files (x86)\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "E:/workplace/code/untitled0.py", line 15, in <module> words=list(jieba.cut(test,cut_all=False,HMM=True)) File "D:\Program Files (x86)\anaconda\lib\site-packages\jieba\__init__.py", line 282, in cut sentence = strdecode(sentence) File "D:\Program Files (x86)\anaconda\lib\site-packages\jieba\_compat.py", line 37, in strdecode sentence = sentence.decode('utf-8') AttributeError: '_io.TextIOWrapper' object has no attribute 'decode' ``` test.txt和userdict.txt均使用utf-8编码。 test.txt内容如下: ![图片说明](https://img-ask.csdn.net/upload/201809/11/1536677472_844090.jpg)

repeatvector_2: expected ndim=2, found ndim=3

Traceback (most recent call last): File "LSTM_att/co-attention.py", line 98, in <module> img_new_repeat = RepeatVector(maxlen)(img_new_dense) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 529, in __call__ self.assert_input_compatibility(x) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 469, in assert_input_compatibility str(K.ndim(x))) ValueError: Input 0 is incompatible with layer repeatvector_2: expected ndim=2, found ndim=3 求助,帮忙keras新手

python requests.get得到的中文编码错误

在练习爬虫的时候requests.get一个网站 打印出来的得到的text中文是 &#x 5BF6;&#x 8C9D;&#x 9F8D;的(为了防止网页自动编码在&#x后面敲了空格)。其他网站都能正常显示 。 找了很多方法都没法普通的显示成中文。 代码 ``` import requests import chardet response = requests.get("https://store.playstation.com/zh-hant-hk/grid/STORE-MSF86012-SPECIALOFFER/1?smcid=hk-chs_ps%3Acom_header") print(response.text) ```

numpy处理中文csv文件报错?

#coding = gbk import numpy as np c,v,m=np.loadtxt('e:\\000718.csv', delimiter=',', usecols=(3,6,13),unpack=True) ======================== 其中,csv文件中第二列有中文字符,不管我设定coding是utf-8还是gbk,均报错。删除第二列,程序可以运行。 我修改000718.csv为utf格式,或另存为utf的txt格式,程序依然出错;猜测还是编码的问题,该如何解决,请教各位大神? 第一次发帖,希望能得到大家的帮助,不胜感激~ 报错信息: UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)

在Eclipse里创建安卓项目报错

我jdk是1.8的,创建好安卓项目后只要保存就报错,有人看看这是什么原因嘛 ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585463240_73166.png) ![图片说明](https://img-ask.csdn.net/upload/202003/29/1585464953_172903.png)

Python3 发送带附件的邮件 附件名如何引入变量

Python3 发送带附件的邮件 附件名如何引入变量 # 构建附件1,传送桌面目录下的2.txt文件 att1 = MIMEText(open(2.txt,'rb').read(), 'base64', 'utf-8') att1['Content-Type'] = 'application/octet-stream' att1['Content-Disposition'] = 'attachment; filename = html.html' message.attach(att1) 怎样才能让filename = 变量. 或者附件名直接是open打开的文件名+后缀 求大佬解答

怎么设置正则表达式 为A1, A2,a3这种只有2位的同时第一位为字母,第二位为数字的。求大神回答

怎么设置正则表达式 为A1, A2,a3这种只有2位的同时第一位为字母,第二位为数字的。求大神回答

python模拟twitter登陆

这是我的代码,不知道为什么一直无法成功 import urllib2 import urllib import cookielib import re class Fetcher(object): def __init__(self,name=None,pwd=None): self.cj = cookielib.LWPCookieJar() #获取一个保存cookie的对象。 self.cookie_processor = urllib2.HTTPCookieProcessor(self.cj) #将一个保存cookie对象,和一个HTTP的cookie的处理器绑定 self.opener = urllib2.build_opener(self.cookie_processor, urllib2.HTTPHandler) #创建一个opener,将保存了cookie的http处理器,设置一个handler用于处理http的URL的打开 urllib2.install_opener(self.opener) #将包含了cookie、http处理器、http的handler的资源和urllib2对象绑定在一起 self.name = name self.pwd = pwd self.hosturl = 'https://twitter.com/' #登录的主页面 self.posturl = 'https://twitter.com/sessions' #post数据接收和处理的页面(我们要向这个页面发送我们构造的Post数据) def login(self): #跳转到登陆界面,此时可获得cookie req=urllib2.Request(self.hosturl) resp=urllib2.urlopen(req) html = resp.read() #得到表单中的authenticity_token att=re.compile('value="(.*?)" name="authenticity_token"') t = att.search(html) authenticity_token = t.group(1) #处理cookie #cookies = '' #for index, cookie in enumerate(self.cj): # cookies = cookies+cookie.name+"="+cookie.value+";"; #cookie = cookies[:-1] #print "cookies:",cookie #request headers,仿冒浏览器 self.header = {#':host': 'twitter.com', #':method': 'POST', #':path': '/sessions', #':scheme': 'https', #':version': 'HTTP/1.1', #'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', #'accept-encoding': 'gzip,deflate,sdch', #'accept-language': 'zh-CN,zh;q=0.8', # 'cache-control': 'max-age=0', # #'content-length': '214', #'content-type': 'application/x-www-form-urlencoded', # 'cookie': cookie, #'origin': 'https://twitter.com', 'referer': 'https://twitter.com/', 'user-agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36' } #print(self.cj) #form data,提交的表单数据 postForm = {'session[username_or_email]':self.name, 'session[password]':self.pwd, 'remember_me':'1', 'return_to_ssl':'true', 'scribe_log':'', 'redirect_after_login':'/', 'authenticity_token':authenticity_token, } postData=urllib.urlencode(postForm) #编码 #print(postData) #提交表单 rep = urllib2.Request(self.posturl,postForm,self.header) resp=urllib2.urlopen(req) html = resp.read() print(html) #req=urllib2.Request(self.hosturl) #resp=urllib2.urlopen(req) #html = resp.read() #print(html) if __name__ == '__main__': username = '*******' #用户名 password = '******' #密码 fet = Fetcher(username,password); fet.login() 大神帮忙看看吧。 我的思路和网上的思路一样的,我是个菜鸟,也没什么币,希望大家见谅了

启动Tomcat报错。。。。。。。。。。

启动tomcat时报错如下: 严重: Servlet [jsp] in web application [/HDFS-NetDisk] threw load() exception java.lang.ClassNotFoundException: org.mortbay.log.Log at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734) at com.sun.org.apache.commons.logging.JettyLog.<init>(JettyLog.java:36) at com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java:35) at org.apache.jasper.servlet.JspServlet.<clinit>(JspServlet.java:116) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:114) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5349) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 六月 20, 2019 8:50:31 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 六月 20, 2019 8:50:31 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 六月 20, 2019 8:50:31 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 14071 ms ![图片说明](https://img-ask.csdn.net/upload/201906/20/1561035443_252193.png) 请求大佬们帮忙看看,急!!!

sql语句报错,请大神看下哪里的错误

错误代码: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8' at line 15 ``` CREATE TABLE `task_schedule_job` ( `job_id` BIGINT(20) NOT NULL AUTO_INCREMENT, `create_time` TIMESTAMP NULL DEFAULT NULL, `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `job_name` VARCHAR(255) DEFAULT NULL, `job_group` VARCHAR(255) DEFAULT NULL, `job_status` VARCHAR(255) DEFAULT NULL, `cron_expression` VARCHAR(255) NOT NULL, `description` VARCHAR(255) DEFAULT NULL, `bean_class` VARCHAR(255) DEFAULT NULL, `is_concurrent` VARCHAR(255) DEFAULT NULL COMMENT '1', `spring_id` VARCHAR(255) DEFAULT NULL, `method_name` VARCHAR(255) NOT NULL, PRIMARY KEY (`job_id`), UNIQUE KEY `name_group` (`job_name`,`job_group`) USING BTREE ) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; ```

我的SQL代码执行结果为空,没报错。【有好答案我可以加悬赏,求助!】

我的这段SQL代码,执行了1个小时,没有报错,但是最终结果是“空”,求助。 (1)这段代码应该怎么优化? (2)这段代码为什么执行完是空? ``` with sanlian as ( select uuid, att_user, intrst_user, inten_user, car_owner, top1att, top3att, top5att, hour_prf, level_prf, series_prf, spec_prf, brand_prf, place_prf, price_prf, leads_num, leads_series from AA表 where uuid in(select distinct uuid from AA表) and substr(dt,1,7) = '2018-10' ), fulltable as( select uuid, age_age as age, sex_sex as sex, car_loan as car_loan, mortgage as mortgage, er_value as customer_value, du_level as edu_level, ge_name as stage, occupation as occupation, tal_status as marital_status, illing as loan_willing, city as city, concen as concen, interval_day as interval_day from BB表 where seri = '1' ), atttime as( select b.uuid, a.att_time from( ( select uuid, cookie from CC表) b join (select cookie, sum(att_time) as att_time from DD表 where substr(dt,1,7) = '2018-10' cookie <> '0' group by cookie ) a on a. cookie = b.cookie ) ), inten as ( select b.uuid, a.ordernum from( ( select phone, sum(ordernum) as ordernum from EE表 where substr(dt,1,7) = '2018-10' and series_id = '1' group by phone ) a join ( select uuid, phone from FF表 )b on a.phone = b.phone ) ), fangwen as( select uuid, y_id, y_name, sum(y_ratio) as y_ratio, sum(n_ratio) as n_ratio from GG表 where substr(dt,1,7) = '2018-10' and series_id = '1' group by uuid, y_id, y_name ) select * from sanlian as a left join atttime as e on a.uuid = e.uuid full join intention as b on a.uuid = b.uuid left join fangwen as f on a.uuid = f.uuid join fulltable as g on a.uuid = g.uuid ``` 最后*是35个来自a\b\e\f\g的变量。

celery启动worker时说redis版本太低

![图片说明](https://img-ask.csdn.net/upload/201903/12/1552394168_669843.png) 我用django的celery时把redis作为broker然后启动worker时一直报错说我redis的版本是3.1可我启动的redis就是3.2.1的,大佬们这是为什么呀

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

为什么本科以上学历的人只占中国人口的5%,但感觉遍地都是大学生?

中国大学生占总人口不到5% 2017年,中国整体的本科率仅有5.9%;如果算上研究生,这一比例可以进一步上升到6.5% 为什么在国家统计局推出的这份年鉴中,学历的最高一阶就是到研究生,而没有进一步再统计博士生的数量的。 原因其实并不难理解,相比全国和各省整体人口体量,博士生的占比非常之低,属于绝对意义上的小概率样本。 这一点,我们从上表中的各省研究生占比情况也可以看出端倪。除北京、天津、上海三...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

6年开发经验女程序员,面试京东Java岗要求薪资28K

写在开头: 上周面试了一位女程序员,上午10::30来我们部门面试,2B哥接待了她.来看看她的简历: 个人简历 个人技能: ● 熟悉spring mvc 、spring、mybatis 等框架 ● 熟悉 redis 、rocketmq、dubbo、zookeeper、netty 、nginx、tomcat、mysql。 ● 阅读过juc 中的线程池、锁的源...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

立即提问
相关内容推荐