Tag Info

New answers tagged

0

I just realized that I was looking at the system path in the CMD prompt and only at the USR path when I checked with the Windows-7 GUI. I thought I checked both already. Maybe this post will remind someone else to set both


0

Yes, your boss does mean replace the string, just not quite the way you're trying to do it. When you have Message = "0x01", you're setting the variable to the text "0x01". In ASCII, with one byte for 0, x, 0, 1 each, that's byte values 0x30, 0x78, 0x30, 0x31. >>> [ord(c) for c in "0x01"] [48, 120, 48, 49] What you need in this case is 0x01 ...


3

You can check where those values were changed via :verbose setlocal ts? et? Likely, it's by this added line in $VIMRUNTIME/ftplugin/python.vim: " As suggested by PEP8. setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 You can undo this via a script ~/.vim/after/ftplugin/python.vim with the following contents setlocal noexpandtab shiftwidth=4 ...


1

Pass the command as a string, and signal to subprocess that's a shell command with shell=True: source import subprocess print subprocess.call([ "echo beer > zoot" ], shell=True) output 0


5

The > is interpreted by the shell not by the program. Since subprocess doesn't use a shell by default, the > is passed directly to the program. Using shell=True might work, but to redirect stdout, you should use the stdout argument. For example, you could use import subprocess with open('data.csv', 'w') as f: subprocess.Popen(['iperf', '-s', '-u', ...


1

It's definitely possible. The easiest way to do it would be to call Windows Python explicitly when you want to run a Python script. If you were doing it from a Cygwin shell, you'd probably want a command that looked something like this: /cygdrive/c/Python27/python.exe script.py That calls Python with your script as an argument, and should run it in ...


0

I got the answer via stackoverflow, apparently without defining the path in the python file and just providing the file names it defaults to creating the files in a system directory that I don't have access to. The solutions are: set the working path in python with open('/Library/Application Support/PythonDaemons/Ping_log.txt', 'a') as f: or set the ...


0

I have this same problem on Linux Mint Quiana 17, 64-bit. I had this same problem, and I'm not sure why, but when I run sudo pip install nltk it installs nltk 2.0.4, as seen in pip list. This may cause this problem as nltk 3.0 was the first version to support Python 3. Also, running pip search nltk does say that the latest version of nltk is 3.0.0b2 ...


0

Oh, I just found a way ! I just installed (again) dexy directly with easy_install $ sudo easy_install dexy Searching for dexy Best match: dexy 1.0.14 Adding dexy 1.0.14 to easy-install.pth file Installing dexy script to /usr/local/bin (...) Installed /usr/local/lib/python2.7/dist-packages/chardet-2.2.1-py2.7.egg Finished processing dependencies for dexy ...


0

Which specific device do you have? You may know this, but serial connections don't have any device identification built into the protocol. I did find a technical manual for the MT4000 series that states that these devices are running an embedded RTOS, but doesn't mention any specifics. If they support ssh, I wonder if you could bring up a terminal and use ...


1

I guess one of the easiest ways to do this would be installing a SSH client on Windows and then using a SSH connection to trigger the script on the Linux side. The command to call on the Windows side could be as easy as something like this: ssh.exe user@hostname /path/to/the/script Note that your ssh client will need some way to directly authenticate ...


0

Usually this is due to the -arch ppc flag being passed into the build flags. I suspect some of this code may have come from legacy PowerPC days, when OSX ran on the PowerPC instead of x86/Intel platform. The issue starts here: C compiler: /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -arch i386 -arch x86_64 -g -O2 Try ...


0

It happens because somewhat the atom package is not in the path. This could be due to several reasons depending on your Python installation method. This quick workaround worked for me... Just add this two lines... import sys sys.path.append('/usr/local/lib/python2.7/site-packages/') ...on top of this duplicity's gdocsbackend.py file: ...


1

This is normal behavior. When you close the terminal, the SSH session terminates, killing all child processes. You need to use something like tmux or screen on the server to fork and create a persistent shell, which will continue to run after the ssh session terminates, and can be reconnected to when you log in again.


1

It seems you cannot stop the opening of Script Editor easily per https://discussions.apple.com/thread/6449168 So looks like you are better off with terminal-notifier which I just tested works even with mavericks beta: ProductName: Mac OS X ProductVersion: 10.10 BuildVersion: 14A299l https://github.com/alloy/terminal-notifier The 1st method to ...


0

Not sure I understand the question. Solaris 11.2 is already using Python 2.6.8 by default. Your output from cat /etc/release is truncated and therefore meaningless. Here's what my /etc/release file looks like: Oracle Solaris 11.2 X86 Copyright (c) 1983, 2014, Oracle and/or its affiliates. All rights reserved. ...


1

AVG probably detects a false positive, ie. it accuses a perfectly good file of being a virus. It happens sometimes and it's not a reason to worry. First add Python directory to AVG's excluded folders list. That will prevent it for scanning it for viruses and will suppress false positives. Then check AVG's quarantine. It's possible that the file wasn't ...


0

The easiest, non-intrusive way would be to use Homebrew: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Then, read the instructions that are given on your shell. Now you can install Python 2.7 and Python 3.x: brew install python python3 They will not conflict. The python binary will take precedence over your system binary ...


0

I found a Sublime Text Package which I believe we be able to do what you'd like. RegReplace It's listed under package control so it easy to install. It allows you to create commands to perform regular expression search and replaces. To have it run the commands you want you'll need to enter the following into the settings files. User Settings { ...


1

Create a shortcut on the desktop (right click on desktop->new->shortcut) then enter "cmd" in the place of type the location of the item. Change icon and name on "cmd" shortcut for what you need.(DONT change path) Drag this shortcut to the taskbar so its will be pinned. Press Win+R, paste and run this: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User ...


0

If you use the "!env_reset" option to unset it and "secure_path" is not set in your sudoer's file, then the options "env_check" and "env_delete" can remove PATH from being exempt from reset (i.e. they function as blacklist entries). A more likely cause would be that a system /etc/bashrc or your own .bashrc is resetting PATH to some standard value (and not ...


0

Think about whether you replace shell in /etc/passwd with your script or start your script in .bash_profile with exec /path/to/your/script.


0

This works: Right-click on the Command Prompt in the Start Menu. Select Run as administrator. Select Yes in the User Account Control dialog. Run ipython notebook in the resulting Command Prompt window. Basically, it has to be run as administrator for some reason.


0

It seems that windows is not checking the whole path of the executable! Try to rename the python.exe of version 2 (respectively 3) to some temp name. Then associate with this name. And change everything back. FYI you could check the file association with: C:\Users\shadowed>assoc .py .py=Python.File C:\Users\shadowed>ftype Python.File ...


0

I would recommend using a program to clean out your registry of unused programs like CCleaner after you have unistalled the program. Often many programs leave files in the registry even after they have been uninstalled. Here is a link to the download of the program: http://www.bleepingcomputer.com/download/ccleaner/dl/189/


0

I would remove both netCDF4 and HDF5 by running apt-get remove --purge python-netcdf hdf5 This will also make go away related packages. This might be more safe: dpkg -r python-netcdf hdf5 apt-get autoremove followed by reinstallation of netCDF4 and dependencies, used most from an article for Ubuntu 14 LTS. apt-get install git git-doc git-el git-email ...


0

If anyone comes across this thread at a later date: I had incredible difficulties getting Scrapy to install with easy_install on Python 2.7. The cryptography module in particular was impossible to install. I installed pip using the information found at http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows Afterwards a simple pip ...



Top 50 recent answers are included