-
Replied To a Post in not using len() to get length
You must add `ix = -1` before the for loop, or enumerate from 1: ix = 0 for ix, c in enumerate(s, 1): pass length = ix -
Replied To a Post in not using len() to get length
For a string, the following function works def length(s): return 1 + s.rfind(s[-1]) if s else 0 It fails for a list because the list type has no method `rfind()`. … -
Replied To a Post in How to calculate PI...
This page [Click Here](https://en.wikipedia.org/wiki/Numerical_approximations_of_π) contains many formulas. I suggest to start with Ramanujan's formula. -
Replied To a Post in Different Version of Python
I think you could add a launcher to the explorer's context menu by following [this tutorial](http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/). -
Replied To a Post in raspberry pi snake
You must indent line 50 to 89 (they belong to the while loop) and you must probably change `raspberry[1]` at line 79 with `raspberryPosition[1]`. -
Replied To a Post in What is the best language to learn?
Everybody has his/her favorite language. What we lack is an objective criterion to define *the best* language. It's an ill posed problem. You can 1. google what is the best … -
Replied To a Post in Help with starting a game board for binary puzzle
There are no steps to follow, you can start by printing board = """ 4 . . |. . . |8 . 5 . 3 . |. . . |. … -
Replied To a Post in Help with starting a game board for binary puzzle
In this well known page about Sudoku [Click Here](http://norvig.com/sudoku.html), Peter Norvig draws boards of numbers in a console simply by printing convenient strings of characters. Try to print one of … -
Replied To a Post in I can't pass a constant string to a function?
There is no such thing as a *non utf8* character. Utf8 is not a set of characters, it is an encoding, a way to represent unicode code points as a … -
Replied To a Post in I can't pass a constant string to a function?
I don't agree with that. Python's error messages are extremely helpful. The error message here was File "foo.py", line 6 print “NNOOOOOO!!!!” ^ SyntaxError: invalid syntax The compiler shows the … -
Replied To a Post in I can't pass a constant string to a function?
You say that it won't work, but what is the output ? -
Replied To a Post in Assign IP to 100 VMs using python
> its looks like i am supposed to login to each system and run this code to change the IPs right? but i am looking for the code which i … -
Gave Reputation to vegaseat in Factorial, Power
Another way to look at this ... ''' mpm_stuff.py comparing Python module mpmath result to C 64bit double results ''' from mpmath import * # convert to mpmath float x … -
Replied To a Post in Assign IP to 100 VMs using python
Googling about VMs, I fell on [pysphere](https://code.google.com/p/pysphere/wiki/GettingStarted). Does this module apply to your case ? -
Gave Reputation to matosha in Remove vsftpd on Kali linux
I found my answer here. The issue lied in this file. I commented out 3 parameters and the removal worked. installed pure-ftpd afterwards. -at the bottom of post [Click Here](http://ubuntuforums.org/showthread.php?t=1434911) -
Replied To a Post in Factorial, Power
Python says `5.16294852309750916500022794327 e287193` and `6.74114012549907340226906510470 e315652`. For example Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> … -
Replied To a Post in Open-source/free ANFIS libraries or implementations for Python
Apparently, there is a fuzzy logic toolbox for Scilab as these links tend to prove * [Item One](https://burubaxair.wordpress.com/2013/09/26/fuzzy-logic-in-scilab-sciflt-part-1-mamdani/) * [Item Two](https://atoms.scilab.org/toolboxes/sciFLT) Scilab is free software under CeCILL license and it … -
Replied To a Post in Assign IP to 100 VMs using python
If you want to automate, it will be much easier if you find command line tools to do the same thing. I'm usually not a windows user, but for example … -
Replied To a Post in Assign IP to 100 VMs using python
It makes sense, but you must go one step further: can you execute each of these steps completely on the command line ? Then can you write down everything that … -
Replied To a Post in Assign IP to 100 VMs using python
It's not exactly what I mean. Suppose you're sitting at a terminal on the server machine. How would you do to assign IPs to three VMs without a script ? … -
Gave Reputation to stultuske in So much info.. what is right?what is wrong?
[this one](http://forjenssake.files.wordpress.com/2012/03/abe-lincoln-meme.jpg) explains it pretty well. -
Replied To a Post in KeePass 2
Wouldn't that mean storing the master password somewhere in the file system and compromise security ? -
Replied To a Post in Assign IP to 100 VMs using python
I don't know ESX, but in principle, if you can describe precisely how to do it manually, python should be able to do it. -
Replied To a Post in So much info.. what is right?what is wrong?
Karl Popper invented the notion of [falsifiability](https://en.wikipedia.org/wiki/Falsifiability) in his extraordinary discussion on the meaning of truth. Following this idea, to make sure that answers are correct, try to refute them … -
Replied To a Post in Python and Matlab
I have a running version for scilab here. I didn't check that the numerical result is good however clear; function func = foo(z, x) func = ((0.6369).*sin(z.*sin(x)).*sin(x)) endfunction function simpson … -
Replied To a Post in Ancient Dragon
Yes he is one of the knights on the Bayeux tapestry, a very good friend of William the Conqueror. -
Gave Reputation to it@61@sec in Deleting symlinks
I'm running BusyBox version 1.19.4 (2014-07-24 09:45:52 CEST) on my set-top-box. The find-command is contained in the multi-call binary. The command 'find ./ -type l -delete' works as well. :-) -
Replied To a Post in Extract data from file into a tableau
Algorithmically, you're reading groups of lines and printing output for this group when it's finished. Pseudo code looks like current_group = None for line in file: group <- extract group … -
Edited Extract data from file into a tableau
Hi everyone. I have question and i hope someone will be pleased to help me. I am trying to write a python script which can extract data from a file … -
Replied To a Post in GUI fails to load in tkinter
From the python documentation >>> import sys >>> is_64bits = sys.maxsize > 2**32 >>> is_64bits True # check the answer on your computer It should perhaps be named `is_not_32bits`, from … -
Replied To a Post in GUI fails to load in tkinter
I suggest to uninstall PIL (or pillow) and reinstall Pillow‑2.6.1.win‑amd64‑py3.4.exe from [Gohlke's site](http://www.lfd.uci.edu/~gohlke/pythonlibs/). -
Replied To a Post in How To Print Out A List Of Strings ?
I suggest that you call the following function as soon as you get a cursor object: from collections import namedtuple from operator import attrgetter import itertools def load_programs(cur): """Return a … -
Replied To a Post in How To Print Out A List Of Strings ?
> I want to print for each title outside of the loop. This is meaningless. It does not matter if the titles are printed inside or outside of the loop … -
Replied To a Post in Access the clipboard via Tkinter
The corresponding command in linux is `xclip`, or `xsel`. This is what pypi modules such as pyperclip do. See the [source code here](https://github.com/asweigart/pyperclip/blob/master/pyperclip/__init__.py). Notice that in windows, this module has … -
Gave Reputation to nRg6ExWxsJ8JzX in Which is the most secure smartphone? Not the iPhone it appears...
PWN2OWN isn't really representative though. It's a bit like the historical claims about Apple laptops being secure due to the lack of exploits: mostly this was just down to the … -
Replied To a Post in Access the clipboard via Tkinter
Hm the documentation speaks about the tk clipboard, which is probably different from the system clipboard. Your code works for me, but I can't use it to paste something into … -
Replied To a Post in Deleting symlinks
There is no syntax error for my python. However, remove lines 3 to 8 if you want, they're not used. Are you sure that the shebang works ? -
Replied To a Post in Access the clipboard via Tkinter
It is interesting although I cannot make it work in linux with KDE. However, a search for `clipboard` in pypi yields a number of results. Among them, [pyperclip](https://pypi.python.org/pypi/pyperclip/) looks promising. … -
Gave Reputation to sneekula in Access the clipboard via Tkinter
You can accesss the clipboard simply by using the Tkinter GUI toolkit that comes with your Python installation. -
Replied To a Post in Deleting symlinks
Here is a python script, if you have python #!/usr/bin/env python # -*-coding: utf8-*- from __future__ import (absolute_import, division, print_function, unicode_literals) __doc__ = ''' ''' import argparse import os def … -
Replied To a Post in changing inputs into monetary value with two decimals in print statement
Use print('{0:.2f}% $ {1:.2f} $ {2:.2f} $ {3:.2f}'.format( ratea, principal, simple, compound)) see [Click Here](https://www.daniweb.com/software-development/python/code/232375/string-formatting-specifications). -
Replied To a Post in looking for a laptop. Any suggestions on a good one? one
I bought three Acer Aspire laptops with i7 and i5 processors. They were sold with windows 8, which I replaced with kubuntu 64 bits and they work very well. -
Replied To a Post in Create a password you can remember
> I use one password for all my internet accounts , it is a sentence consisting of 6 words ( english + persian ) which reminds me of my college … -
Replied To a Post in Create a password you can remember
At my bank they use a small keyboard on the screen, with keys in a random position. -
Replied To a Post in Create a password you can remember
It works in 2 clicks, with a temporary copy and paste. -
Replied To a Post in Create a password you can remember
@slavi Using a password manager, you can easily have unique random uncrackable passwords with more than 20 characters. The only password you need to remember is the password manager's password. … -
Replied To a Post in get the list of values outside of the loop
You can create a list of numbers >>> L = range(4128, 4616) >>> L = [x for x in L if (x-4128) % 70 != 69] >>> L [4128, 4129, … -
Replied To a Post in How to move circles in python
Independently from the python part, I don't understand what you want to do. Can you explain the problem in details. -
Gave Reputation to vegaseat in Load and view an image with imageio and visvis (Python)
Two third party Python modules imageio and visvis make it easy to load and view images. The modules come with the pyzo scientific package or can be downloaded separately. Module … -
Replied To a Post in Can't find information on socket.recv(bufsize[, flags])
In CPython, `Socket.recv()` is implemented by calling the C function ssize_t recv(int sockfd, void *buf, size_t len, int flags); You can see this by downloading the python source code and …
The End.