• Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    This happens because `t` is not an iterable with 2 values. Print `t` or `repr(t)` to see what's going on.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    You can define a function to return the coordinates to move to def destination(x, y): i, j = int(x/ux), int(y/uy) return i * vx + wx, j * vy + …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    I had a better result by adding a call to `refresh()` at the end of `display_game()`. Also adding a `print(board_representation)` at the end of `interpretor()` shows an error rnbqkbnrpppppppp0000000000000000000000000000000000000000PPPPPPPPRNBQKBNR at …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    I cannot run your code because I don't have the images of the pieces and the lvl file. Can you zip the folder pieces_image and attach the zip to a …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    If you read the above mentioned documentation for method `coords()`, you see that it can be used to move the object, instead of deleting and recreating the image. You should …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    You can simply do nothing if the value is None t = canvas.coords("blackk") if not t: return assert(len(t) == 2) x1, y1 = t ...
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    The canvas `.coords()` method is described here http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/canvas-methods.html . As you can see, it may return a variable number of coordinates. In your code, the canvas object with tag `"blackk"` …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Finding states with max and min population in python

    A block of python code, showing serious attempts to solve the problem is missing in your question. Helpers here are not attending a programming course, and usually don't do student's …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [PYTHON] Place pieces on a chessboard

    What you can do is add print statements in the code in order to see what's getting executed. For example you can add `print(line)` at line 66 because the `interpretor()` …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need help with part of this problem

    Here https://docs.python.org/3/reference/expressions.html?highlight=precedence#value-comparisons are the comparison operators in python. You must write if stu_points < 60: print("F")
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in https://

    I don't know the answer, but this is what I read in django's documentation > It is always better for security to deploy your site behind HTTPS. Without this, it …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Metric Calculator in Tkinter

    Ok, here it is.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need help with part of this problem

    Your code needs an `if` statement to determine if `stu_points` is below 60 and print an F in that case.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Problem displaying tkinter PhotoImage

    Hello, effbot.org says to keep a reference to the image object to prevent it from being garbage collected. You could try self.our_image = tk.PhotoImage(master=self, file="side.png") [http://effbot.org/tkinterbook/label.htm](http://effbot.org/tkinterbook/label.htm)
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Metric Calculator in Tkinter

    What you can do is add a dictionary self.as_meter = dict( mm=0.001, cm=0.01, inches=0.0254, feet=0.3048, yards=0.9144, meter=1.0, km=1000.0, miles=1609.344, ) Then you add lines to bind various variables self.measurements.trace('w', self.update_length) …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to Tim_7 in Why does Dell hate Linux so much?

    Linux is garbage that doesn't work and requires a computer science degree to use, and Dell obviously got sick of the nightmare of supporting customers who got tricked into buying …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Metric Calculator in Tkinter

    Can you post the whole code ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to split personal names in python using pandas

    What about Renaud Le Van Kim ? More seriously, I can't run your code because my python has pandas 0.13.1 in ubuntu 14.04, and this version does not understand the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Metric Calculator in Tkinter

    According to the python documentation > The combobox widget generates a <<ComboboxSelected>> virtual event when the user selects an element from the list of values. It means that you could …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Creating a calculator. Value Error?! Please Help.

    There is a problem in the indention of function `add_number()` at the beginning of your code. Apart from that, don't only post `ValueError`, instead, post the whole error message sent …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Splash screen with information

    This works for me from tkinter import * from time import time, sleep, clock class Splash: def __init__(self, root, file, wait): self.__root = root self.__file = file self.__wait = wait …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Invalid Syntax? Python 2.7.11

    `Invalid syntax` is always a very simple error. The only strange thing in your code is the colon at the end of the line. This can happen only when the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need help with python problem

    I would remove `get_dollars()` and `get_left_over_cents()`. You can write at line 13 total_value = get_total(pennies, nickels, dimes, quarters) dollars = int(total_value) left_over_cents = int(100 * (total_value - dollars)) It seems …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Creating a Python function to manipulate python data types

    It seems implicit to me that the code should keep argument2 unchanged and return a new value (new list or set). I suggest def manipulate_data(typename, instance): if typename == 'list': …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to Ritesh_4 in Which is the best application to connect Linux remotely

    I've used [MobaXterm](http://mobaxterm.mobatek.net/) (home edition) to connect from Windows for several Ubuntu servers, using SSH of course.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python code to check if the file exists within Android Internal Storage

    With a kde desktop (kubuntu), there may be a solution using module [PyKDE4.solid](http://api.kde.org/pykde-4.5-api/solid/). This module can discover and connect hardware devices connected to the computer [See Here](https://techbase.kde.org/Development/Tutorials/Solid/Device_Discovery). On my computer, …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python code to check if the file exists within Android Internal Storage

    No I don't know how to do that. I tried with a Samsung phone but it does not work. From what I read elsewhere, a solution is to install sshdroid …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python code to check if the file exists within Android Internal Storage

    Sorry I thought the program was running on your android device
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python code to check if the file exists within Android Internal Storage

    Start with print(os.listdir('/'))
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Using wxPython to create a feet-in calculator

    The result of `if keycode == foo or bar` is probably not what you are expecting. You probably meant `if keycode in (foo, bar)`
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Dealing with Negative Floating Values in Python3

    You could use nan from math import sqrt nan = float('nan') def mysqrt(x): return sqrt(x) if x >= 0.0 else nan See https://en.wikipedia.org/wiki/NaN Edit: Hi Tony! It's been a while... …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Migrating to Linux - Any Tips?

    Thanks for the link, I didn't know that. You can perhaps have windows on an external drive and run it in virtualbox. This would be a portable windows. I like …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to AleMonteiro in Migrating to Linux - Any Tips?

    Thanks guys. I think it's possible to make the move using an Win VM for what anything that isn't going well on linux. I will even keep my current HD …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to rproffitt in Telnet connection problem with telnet connection script.

    Did you try responding to the query I see on line 2 of your log? Note: read http://stackoverflow.com/questions/10413963/telnet-iac-command-answering
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python code that idenifies word position in a string

    Hint: type `help(str.find)` in a python console. You can also try `help(str.index)` !
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How To Make Register, Login, and View User

    You can debug this yourself ! Helping doesn't mean that I write the program for you. I already know python very well :)
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Which is the best application to connect Linux remotely

    If you want a desktop, x2go works well (but there are many other remote desktop apps).
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How To Make Register, Login, and View User

    Use something like while True: {'2':create_username,'l':app.login, '3' app.view_user}.get(raw_input("Chosee with number (1,2,3: ").lower(),app.login)()
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How To Make Register, Login, and View User

    It is only a starting point. You can add this to your file, then connect it to the rest of your code.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How To Make Register, Login, and View User

    You need to store state variables. The best thing to do is to create a class instance class App(object): def __init__(self): self.username = None self.password = None def login(self): if …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in request + single value json output

    Try `id = j['id']`, and read a python tutorial!
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in list out of index error

    The list `list(swn.senti_synsets(i,'a'))` is probably the empty list `[ ]` You could check this by printing its `repr()` for example. Your program does not (yet) handle the case where this …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in need help with unicode in python

    If the type of `os.environ['APPDATA']` is `str`, you may need to decode it first with the appropriate encoding apppath = os.path.join(os.environ['APPDATA'].decode(...), 'myapp')
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in need help with unicode in python

    Which version of python are you using. If you are with python 2.7, a good thing to do first is to import from __future__ import unicode_literals at the top of …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in List Index out of Range

    @lavanyarao `list index out of range` is a very general message. You must post the whole error traceback to see which list is involved. Also, it is better if you …
  • Member Avatar for Gribouillis
    Gribouillis

    Marked Solved Status for WindowsError: [Error 206] The filename or extension is too long:

    Hi.. I've to remove a very long path. I've written the below to try that but its giving WindowsError: [Error 206] (I've pasted it below). I've prepended "\\?\" to the …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to eden100 in WindowsError: [Error 206] The filename or extension is too long:

    Use Long Path Tool, Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need to save the database variables to a file Python

    Depending on your data, there are several ways to do this. A simple one is to write a csv file using the csv module. See [https://pymotw.com/3/csv/](https://pymotw.com/3/csv/) for explanations. A csv …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Read PDF Files with wxPython

    Here is how I currently open pdf files from python in linux from webbrowser import BackgroundBrowser browser = BackgroundBrowser('/usr/bin/okular') browser.args.extend( ['--icon', 'okular', '-caption', 'Okular'] ) browser.open("/path/to/file.pdf") # It works ! …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need to save the database variables to a file Python

    What kind of data does the database contain ? Do you know how you want the data to appear in the file ?

The End.