python-3.5

Cannot import name 'spawn' for pexpect while using pxssh

廉价感情. 提交于 2021-02-18 21:10:01
问题 This is the code I am trying to run: from pexpect import pxssh s = pxssh.pxssh() if not s.login ('myip', 'myusername', 'mypassword'): print ("SSH session failed on login.") print (str(s)) else: print ("SSH session login successful") s.sendline ('ls -l') s.prompt() # match the prompt print (s.before) # print everything before the prompt. s.logout() The error which I am getting on running this is : Traceback (most recent call last): File "test_pexpect.py", line 1, in <module> from pexpect

Can't pickle <class 'pywintypes.datetime'>: attribute lookup datetime on pywintypes failed

我的梦境 提交于 2021-02-18 17:49:50
问题 I am using python 3.5 (32bit), win10-64bit, OpenOPC, and I have downloaded pywin32 build 64bit. I have run the following python code: import OpenOPC import time opc=OpenOPC.client() opc.connect('Matrikon.OPC.Simulation.1') tags =['Random.Int4','Random.Real4'] while True: try: value = opc.read(tags,group='Group0',update=1) print (value) except OpenOPC.TimeoutError: print ("TimeoutError occured") time.sleep(5) but I always get this error message: Traceback (most recent call last): File "C:

pip not working in Python Installation in Windows 10

China☆狼群 提交于 2021-02-17 12:34:29
问题 I downloaded and installed Python 3.5 from https://www.python.org/downloads/ on my Windows 10 machine with IDLE I want to install other packages using pip using the following and various other options in the IDLE commandline editor. >> pip install packagename >> pip --install packagename >> pip --upgrade packagename >> pip upgrade packagename Where packagename I have tried various packages available from my installed Python modules Tried all the above options without any packagename a well.

Why does this return None?

廉价感情. 提交于 2021-02-17 06:28:35
问题 I'm testing out repl.it (running Python 3.5.1) and I noticed that after every line of input into the console, the console replies with None . I'm not using any fancy definitions with forgotten return values, this happens even after assignment statements. What is going on here? Example: x,y,z=1,2,3 => None print(x+y+z) 6 => None 回答1: None is the default return value of statements that do not have a return value. Some interpreter shells display it, some don't. It's perfectly normal, don't worry

Python 3.5.1 - read multiple inputs into an array

徘徊边缘 提交于 2021-02-16 20:18:20
问题 I'm using python 3.5.1 and running my file through command prompt on windows. The arguments are being passed after the program is run; ie the program prompts for input based on a previously generated list. I'm looking to read in multiple numbers on the same line separated by spaces. Python 2.X it wouldn't have been an issue with raw_input but this is proving to be a challenge. selection = list(map(int,input("Enter items to archive (1 2 etc):").split(","))) If I enter two different numbers on

Running python script in Service account by using windows task scheduler

微笑、不失礼 提交于 2021-02-11 16:43:38
问题 NOTE 1- All files are running using cmd in my profile and fetching correct results.But not with the windows task scheduler. **> NOTE 2- I finally got a lead that glob.glob and os.listdir is not working in the windows task scheduler in my python script in which I am making a connection to a remote server, but it is working in my local using cmd and pycharm.** ** print("before for loop::", os.path.join(file_path, '*')) print(glob.glob( os.path.join(file_path, '*') )) for filename in glob.glob(

Transposing Data in Pandas

只谈情不闲聊 提交于 2021-02-11 15:15:55
问题 I have an excel file that contains a count of how many times an Part has been used during its lifespan. The data is currently stored in such a way that the Serial numbers are in Column A, and each "Lifespan" Count is stored in adjacent columns, with a "Date" value as its heading. Here is an example: Image1 I want to be able to pivot/transpose ALL of the Date columns in Python so that the output is in the following format with the Lifespan Count as a new column named "Count": Image2 I've tried

Python pip install doesn't install pynput?

♀尐吖头ヾ 提交于 2021-02-11 14:18:36
问题 When I type pip install pynput in the command prompt it just says collecting pynput and doesn't install. I have already checked to make sure pip works. I am using Python 3.5.0. 回答1: Upgrade pip python -m pip install --upgrade pip Then Try: python -m pip install pynput 来源: https://stackoverflow.com/questions/61048438/python-pip-install-doesnt-install-pynput

Error installing python 3.5 on Win 10

孤街浪徒 提交于 2021-02-11 12:53:29
问题 I receive this error when trying to upgrade pip on python 35 with the command: C:\WINDOWS\system32>python -m pip install --upgrade pip PermissionError: [WinError 5] Access is denied: 'c:\program files\python35\lib\site-packages\pip-7.1.2.dist-info\description.rst' -> 'C:\Users\Athena\AppData\Local\Temp\pip-g9zbqikf-uninstall\program files\python35\lib\site-packages\pip-7.1.2.dist-info\description.rst' I notice that it is looking in C:\program files\python35 . Unlike previous versions of

Tensorflow failed to create a newwriteablefile when retraining inception

故事扮演 提交于 2021-02-08 12:59:13
问题 I am following this tutorial: https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/?utm_campaign=chrome_series_machinelearning_063016&utm_source=gdev&utm_medium=yt-desc#4 I am running this part of the code: python retrain.py \ --bottleneck_dir=bottlenecks \ --how_many_training_steps=500 \ --model_dir=inception \ --summaries_dir=training_summaries/basic \ --output_graph=retrained_graph.pb \ --output_labels=retrained_labels.txt \ --image_dir=flower_photos Here is the error that