Tag Info

New answers tagged

0

There's two ways we could interpret this - you don't specify whether you want the script to be run by the Python interpreter, or if you want it to open the script in IDLE. 1. You want to execute the script. While we can't execute the script directly from within Nautilus, we can create a .desktop file that will launch the script for you. Simply open up ...


0

No, you can't use launchpadlib for that. The Launchpad API doesn't provide a mapping for branch contents or history. You can get the diff for a specific set of revisions via bzrlib though. This is how Launchpad generates the diff contents for Merge Proposals. You don't need to clone a local copy of the branch to read it; bzrlib supports reading from remote ...


0

At now I am also doing this so as me below linked website are best for learning this things For : http://www.tutorialspoint.com/python/ In this link Database connections and network with C.G.I codes and step by step gives solution If any other Problem related that comment me...:)


0

Seems to be a bug that it is reported here It should to work if you install a later version of pip. You can remove the current pip installation with: sudo apt-get purge python-pip Then install it from github(it is a later version): wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py python get-pip.py Edit If it still won't work try this as ...


-1

I also have been plagued by this problem. I have a solution that works for me, but I am at a loss to explain why it works. I stumbled upon it entirely by accident. At a shell prompt type: CODE export PYTHONPATH=/usr/local/lib64/python2.5/site-packages CODE Yes, even though I have Python 2.7 installed, and the diectory is, in fact, named "python2.7". ...


1

OK, Solved it!. The problem was with the desktop file. in the exec line, I had to add a %f for nautilus to show it in open with menu. Exec=/home/thekindlyone/projects/vlcwrapy-nix/vlcwrapy-nix.py %f Here is a video demonstration, if anyone is interested.


0

I use ubuntu tweak to edit file associations: sudo add-apt-repository ppa:tualatrix/ppa sudo apt-get update sudo apt-get install ubuntu-tweak Let me know if it works for you.


1

I'm not sure about getting Nautilus to change it's default open-with program (on Thunar it's in the right-click menu, open with other, change default, but that doesn't really help here)... I have a bunch of .desktop files in /usr/share/applications/, tried copying your .desktop file into there? Or ~/.local/share/applications/ ? I also have a file in my ...


0

What worked for me was to purge nvidia-current, autoremove, restart, install cairo-dock then go to software updates and select the nvidia 331 from additional drivers (it took much more time than installing from cli), restart. Then from terminal install CCSM and activate the unity plugin. Now in commands what I think is the minimum to solve the issue: ...


1

On Linux, lightblue internally uses the PyBluez library, which doesn't currently allow a socket to opened on a specific HCI device. PyBluez internally uses the Linux bluetooth sockets functionality, so it depends on whether that allows sockets to be created for a specific HCI device. My guess is that it doesn't, else this functionality would have been ...


0

Looking at https://docs.python.org/2/library/string.html The correct way format a string is to use curly brackets. In your case: cursor.execute(str.format("select ChiName from Prices where `Code` = {0}", '00011')) If you desire the same format, you need to replace your , with a % cursor.execute("select ChiName from Prices where `Code` = %s" % ('00011')) ...


0

Can you change your below query cursor.execute("select ChiName from Prices where `Code` = %s", ('00011')) to cursor.execute("select ChiName from Prices where Code = %s", ('00011')) and check this helps,


0

Python virtual environment creator (python-virtualenv) allows you to create a sandboxed and isolated environment where Python packages can be installed without interfering with other packages on the same machine. With several virtualenvs, many different pieces of Python software with different and even mutually exclusive dependencies can coexist together. ...


0

If you need to write code which is Python2 and Python3 compatible you can use the following import try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse


1

There is a third-party packaged .DEB: Here


0

Have you tried downloading it from their website? https://www.jetbrains.com/pycharm/download/ If wget is too complicated, I doubt using git clone is going to be any easier.


0

LAMP-C++ with Django and Mezzanine All files available in git repo -> link 1) Network: If you want to see your service/site on the home subnet (192.168.xxx.xxx IP-s), then you should ensure that IP addresses are stable. I have a router which has a built-in DHCP server that gives home subnet IP-s to devices based on which connected first. There are two ...


0

LAMP-C++ with web.py All files available in git repo -> link 1) Network: If you want to see your service/site on the home subnet (192.168.xxx.xxx IP-s), then you should ensure that IP addresses are stable. I have a router which has a built-in DHCP server that gives home subnet IP-s to devices based on which connected first. There are two ways to handle ...


0

No, IPythons is not a python version but a couple of utilities for Python. Mainly a improved command shell and the notebook. But you are using your regular python install. You can install Ipython with it's own contained python version but this is not what pip does per default. Pip can install packages locally if you give it the -user switch, if you did it, ...


2

Normally, in Ubuntu, python defaults to python2. So you probably have a #!/usr/bin/env python3 # or similar in the top of your script. Either if this is the case or if you have changed the defaults, in the header of your program, change #!/usr/bin/env python # (or the more probable python3) to #!/usr/bin/env python2 # In standard Ubuntu, ...


0

Check your ~/.bashrc and/or .bash_aliases to find if you have any kind of alias like this: alias python=python3 Change it accordingly to python2.7


1

You can just reinitialize the virtualenv by: cd <virtualenv-dir> virtualenv .


1

The package name is python-numpy sudo apt-get install python-numpy


1

I'd just parse the output of either xprop or xwit and wmctrl (you might have to install wmctrl first: sudo apt-get install wmctrl). xprop gives a lot of information on windows. xprop -root gives you information on the active window, a.o. the window id, and wmctrl -l gives you a list of currently opened windows. Using the -p option also gives you ...


-1

My way did not involve the terminal at all but stil, I hope it helps. Here's what I did: Step 1. Highlight the names of all the files you want to move. Step 2. Press Ctrl(control key) and c and the same time Step 3. Go to the folder you want to put your files in, press Ctrl(control key) and v at the same time You're done. Hope it helped you!!


1

You can have both the default version of IPython from the Ubuntu Software Center and IPython 2.3.1 installed at the same time. Install IPython from the Ubuntu Software Center or from the terminal using the following command: sudo apt-get install ipython ipython3 Install IPython 2.3.1 in a virtual environment. virtualenv allows you to create a sandboxed ...


0

Perhaps writing the commands to a shell script, making it executable and running it with sudo will do what you need. However what you are doing is very dangerous. Allowing potentially untrusted command line to be executed as a root is a disaster waiting to happen. Look up "shell injection" type of vulnerabilities. Then perhaps consider reviewing what needs ...


2

Options: Option 1 -> LAMP-C++ with web.py That's a rather simple deployment option, ideal for the case when you're writing a web service with little or no GUI. web.py 0.37 (pip list | grep web.py) web.py info on stackoverflow -> link Option 2 -> LAMP-C++ with Django and Mezzanine That's an option if you want to make a web site, maybe still with a ...


0

I had the same error, trying to install Pillow 2.0.0. I found solutions [here].(https://github.com/collective/buildout.python/issues/39) In short, the location of the freetype library has moved in 14.04. An expedient, if hacky fix, is to make a symlink. On my system, the library was in /usr not /usr/local so I did: ln -s /usr/include/freetype2 ...


0

The official build doc for python3 on ubuntu seem to be here.


3

The login1 interface provides the signal now. Here is the modified code: #!/usr/bin/python # slightly different code for handling suspend resume # using login1 interface signals # import dbus # for dbus communication (obviously) import gobject # main loop from dbus.mainloop.glib import DBusGMainLoop # integration into the main loop def ...


0

Ok, I found the problem: both pip and pip3 install the executable file in /usr/local/bin. Uninstalling from pip (python2) removes the binary. So I had to uninstall and re-install in pip3 to get things working.


1

This import error occurs on Ubuntu 14.04, but not on Ubuntu 12.04. Basically due to the transition from Python 2.x -> Python 3. Many modules were renamed or merged. Python 3 is NOT backward compatible with Python 2.x. So add this to the list of the gotchas. ImportError: No module named 'gi._glib' debian.org bugreport #705387 from gi._glib import GError ...


0

The best thing you can do to ensure a working, clutter-free operating system, is to assemble it yourself. Start from an ubuntu minimal installation: http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/mini.iso If you install it, you just get the command line interface. From there, you can add packages such as a GUI, ...


0

Been there, did that, got the t-shirt, not doing it again! ;) What you're trying to do is: "I just want Windows, not this stupid System32 stuff that is eating up all my hard disk! Let's delete it!" ;) I did the same thing you did and had to install from scratch as I deleted too much, and now I'm much more careful as to what to delete... E.g. Python: ...


0

I suggest you use either df or the disk usage analyzer to find which files are taking up all of the space. Then you can figure out what's creating them.


0

Add #!/usr/bin/env python to the top of the file and save it as script.py. Open up the terminal. Set the file's executable bit by running: chmod +x script.py. Run the script with ./script.py.



Top 50 recent answers are included