• Member Avatar for Gribouillis
    Gribouillis

    Edited Pythod - Need help with homework assignment

    Random Number File Writer: Write a program that writes a series of random numbers to a file. Each random umber should be in range of 1 through 500. The application …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Making a looping menu using oop on python

    If `mainMenu` is a list, the expression `mainMenu()` does not make sense because `mainMenu` is not a function (it is not `callable` in python's terminology). The same holds for `menua`, …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python printing

    I'm using your code display_output_string variable = "You details are correct, you may now progress to the game" prit(display_output_string variable ) and I get File "foo.py", line 1 display_output_string variable …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in tar command output?

    > Okay, what will that do? 1. You won't have the error message any more 2. Your tar file would contain a single directory named gallery
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to invisal in Assigning values to list of strings

    You can use dictionary to simplify your code a bit dict = { "t": 1, "f": 1, "c": 1, "b": 2, "h": 2, "y": 2, "q": 3, "w": 3, "z": …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Assigning values to list of strings

    You may also use this trick >>> lett = "tfc bhy qwz".split() >>> dic = {x: i for i, w in enumerate(lett, 1) for x in w} >>> dic {'c': …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in tar command output?

    I think you are creating a *tar bomb*, a tar archive that explodes into many files instead of creating a single directory. Can't you try tar --exclude-tag-all=backups -C ../.. -cf …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Pandas.DataFrame.Read_csv

    You could perhaps start with `groupby` objects: grouped = df.groupby(['Date','Time']) for name, group in grouped: print(name) print(group) see http://pandas.pydata.org/pandas-docs/stable/groupby.html
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Create a Python Dictionary From a CSV File using CSV Module

    @Abdulkabir_1 You say that `for index, row in iterrow:` does'nt work, but we don't know what it means because we don't have your python code. Perhaps you could start a …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in how do I enable/disable pyQT pushbutton

    Perhaps the `isEnabled()` method ? Try `pydoc PyQt4.QtGui.QPushButton`.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in adding an age to my quiz

    I think you can try and write it yourself. Obviously you know how to ask the user a question and how to handle an answer, don't you ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in PLEASE HELP with restarting a program using user input

    You need to enclose everything in a loop # rhys translation quiz question_list = [ ( "What is Kia ora in english", "a. Hello\nb. Bye\nc. Greetings\nd. See ya\n", "a"), ( …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in My very ugly story about a Lenovo Laptop...

    > No doubt the previous owner was convinced that "Microsoft is evil" He may have downloaded cracked Microsoft programs, and he could not use windows updates because Microsoft would have …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Reverse Alphabetical Order

    Isn't it an example of UUOC ? It seems to me that `sort -r -o newfile file` should work.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Any idea the command to find and replace a file by name and size

    You could use a python script named `lescript` #!/usr/bin/env python3 # -*-coding: utf8-*- import os import sys if __name__ == '__main__': size = int(sys.argv[1]) for filename in sys.argv[2:]: if os.stat(filename).st_size …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to vasanth19 in How to run python .py3 in Eric

    Check whether the python3 interpretter is set in **Preferences -> Debugger -> Python3**.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Making a looping menu using oop on python

    You could start an OOP menu system like this for example #!/usr/bin/env python # -*-coding: utf8-*- '''doc ''' from __future__ import (absolute_import, division, print_function, unicode_literals) class Choice(object): def __init__(self, desc): …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Can't format my USB 64GB anymore

    You could try with gparted in ubuntu http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ edit: be careful not to format your hard drives ! Also don't use fat32 if the volume is too large. Try NTFS.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Making a looping menu using oop on python

    How do you expect the looping menu to work ? Can you describe its behavior ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in simple logical arithmetic

    Hello. It is the same as def mine(a, b): return a >= (b - 1) see https://docs.python.org/3/reference/expressions.html#operator-precedence
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Remote uninstall python script

    You could send an email that would be read by a python program on PC-B and trigger the deinstallation procedure.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Remote uninstall python script

    If you can connect to the remote PC with ssh, you can install or uninstall everything you want on the remote PC.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Installing OS (Linux/Ubuntu)

    Kubuntu is Ubuntu with the KDE desktop. It is a classical and robust desktop. Always choose LTS versions (see https://en.wikipedia.org/wiki/List_of_Ubuntu_releases). version 14.04 is supported until 2019. Also upgrade is easy between …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Installing OS (Linux/Ubuntu)

    My choice is Kubuntu 14.04 long term support. Download it from here http://kubuntu.org/getkubuntu/
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to snippsat in Few Questions about Python?

    >In the first question, ctually asking which directory on linux should I choose to place a project? Like /home/user/ or /var/www etc? [Where I should put my python scripts in …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to snippsat in Few Questions about Python?

    >Where should I host a python project on linux? I'm sure there'd be multiple choices. So, Where would you host it & on what circumstances? Github,Bitbucket... If you mean web-host,pythonanywhere,Heroku,Webfaction,Digital …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in file reading and variable isolation with slicing

    You can handle each student one after the other in the `for line in infile` loop and you don't need `strList`: use `lineSplit = line.strip().split()`. Also use `int()` instead of …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in python grabbing website data

    Hi Here is how to download this page from python, in file `/tmp/foo.html` import urllib urllib.urlretrieve("https://www.daniweb.com/programming/threads/500869/python-grabbing-website-data", "/tmp/foo.html")
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Get difference of two text files in excel and highlighting the difference

    That's a lot of code in many languages. A good think to do is to upload it to github or some other forge. Don't forget to write the documentation !
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ImportError: No module named pyasn1.codec.der?

    Install module pyasn1 https://pypi.python.org/pypi/pyasn1 . You can probably install it by typing pip install pyasn1 in a terminal.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to get filename/directory from tkFileDialog.asksaveasfilename()

    You have self.file self.OpenFile self.ReadFile self.savelocation self.savelocation1 That makes a lot of file-related members. Try to use them coherently, for example at line 61, `self.file` is a string, but at …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Tkinter to put a GIF Image on a Canvas (Python)

    @urireo561 You can use pythonmagick or another imagemagick python binding to resize the image. See this snippet for example https://www.daniweb.com/programming/software-development/code/463880/resize-an-image-with-pythonmagick
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to use?

    You could start with War and Peace. It is a very good book.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in cloud suggestions

    I suggest a home backup solution using a raspberry pi and a hard drive. See this article for example http://www.howtogeek.com/139433/how-to-turn-a-raspberry-pi-into-a-low-power-network-storage-device/
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Newbee -Linux admin

    Welcome to daniweb.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in click OK in bash script to dismiss message box

    Try this version perhaps ... #! /bin/bash PATH=${PATH}:/usr/sbin:/sbin T=0 M=0 lsusb -v |grep "Mouse" &> /dev/null if [ "$?" -ne "$M" ]; then if [ "$1" != "--no-gui" ]; then …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in click OK in bash script to dismiss message box

    The closing `</window>` tag is incorrect in your example above. Can you post the code with the timer included ? Did you try to put the timer before the `</vbox>` …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I need recursive and careful rsync

    Temporary files ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Conversion Error

    You can also use `collections.OrderedDict` instead of `dict` in the record in order to preserve the items' order. Use `json.load(f_obj, object_pairs_hook=OrderedDict)`.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Function returning a value (multi-thread)

    @Sagar_5 Can you explain what you want to do exactly ? You can perhaps start a new forum thread with your question.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in What is Linux Kernel ?

    Why not use search engines ? https://en.wikipedia.org/wiki/Linux_kernel
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in click OK in bash script to dismiss message box

    Apparently, you should be able to add a `<timer>` widget to the gtkdialog code, see http://code.google.com/p/gtkdialog/wiki/timer this timer can have an action which could dismiss the dialog, perhaps something like …
  • Member Avatar for Gribouillis
    Gribouillis

    Tweeted I need recursive and careful rsync

    So I recently had a catastrophe with using the Mega cloud service with my Linux Mint desktop and I got my whole home directory wiped out. Everything got wiped out …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I need recursive and careful rsync

    The python script will keep going and print the error messages if it runs into a problem. The only effect is that the files and directories that could not be …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I need recursive and careful rsync

    You can also run this python script #!/usr/bin/env python # -*-coding: utf8-*- '''doc ''' from __future__ import (absolute_import, division, print_function, unicode_literals) import os from os.path import join as pjoin import …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Catastrophy

    A disk usage analyser such as filelight or baobab would find visually where the GB are hiding.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in click OK in bash script to dismiss message box

    Can you post the bash script ? Edit: depending on your system, the libraries for popup dialogs are different. In KDE, for example, kdialog has an option `--passivepopup` that does …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in 5 Crucial Projects for Beginners

    @jana_2 This is a very old thread (7 years old). I suppose Inkcoder removed his/her source code from the site where it was hosted. You could perhaps follow Lardmeister's advice …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python ImportError: No module named requests

    Is there a `/kunden/homepages/xx/dxxxxx/htdocs/custom/bin/python2.7` executable ? In that case, it would be better to simply use that executable. It's not a very good idea to run python 2.6 and import …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python ImportError: No module named requests

    You can probably redirect to the 2.7 version by calling `python2.7 yourscript.py` or by changing the shebang line in your script to #!/usr/bin/python2.7

The End.