• Member Avatar for Gribouillis
    Gribouillis

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

    In your script, add import sys raise RuntimeError(sys.path) This will show the directories used to find importable modules. If your directory is not here, you can try from distutils.sysconfig import …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in while loop add numbers!

    > But I can't understand why it misses a count after an invalid input when I use It doesn't have anything to do with the if test. Look at your …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ubuntu error

    On my kubuntu system, I get this $ ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 mars 5 2014 /usr/bin/java -> /etc/alternatives/java $ ls -l /etc/alternatives/java lrwxrwxrwx 1 root root …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in while loop add numbers!

    @glao you are not posting your actual code: `'Enter '1' or '2': '` is not a valid python string. Use copy and paste to write your code. Your previous version …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in while loop add numbers!

    Write pseudo code to show the logic of your code. I suggest while True: get user input if input is invalid: print error message continue process user input (update sum) …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in command system failure!

    Some code is missing, I get Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'pnt' is not defined please post the code that generates your …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to cereal in sendmail not working

    Hi, try to change port number to `465`, it works fine for me.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Convert JPG to PDF on Linux

    You can also use `/usr/bin/pdfunite` to merge several pdf into one (in ubuntu, install package `poppler-utils` for this)
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to JonyGreen in Convert pdf to image with PythonMagick

    I'm not a developer, i always use this <snip> to convert pdf to image online.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in sys.executable

    It goes the other way round. If you're already running python 2, `sys.executable` is the path to the python 2.7 executable. If you're already running python 3, `sys.executable` is the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ValueError: Mixing iteration and read methods would lose data

    Try def extract_data(filename): with open(filename) as infile: v0 = next(infile) return v0, list(infile) Note that this will fail if there is no line in the file.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Tkinter Image Slide Show (Python)

    You can add from PIL import Image, ImageTk import io at the top, then add a method in class App: def photo_image(self, jpg_filename): with io.open(jpg_filename, 'rb') as ifh: pil_image = …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Tkinter Image Slide Show (Python)

    @micksulley This snippet https://www.daniweb.com/programming/software-development/code/467528/show-internet-image-with-tkinter shows how to open a jpeg image with PIL in order to display it with tkinter. I think it should work for you.
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to rproffitt in Having problem Fetching hyperlinks from url due to proxy (i am new to Pyth)

    https://docs.python.org/2/library/urllib.html notes more work for you when proxies are involved.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Read PDF Files with wxPython

    @srujana_1 I don't have windows, but you can try and replace the lambda with lambda e: os.startfile("C:\Users\hello\Desktop\filename.pdf") Please start new threads with the tag "python" when you have different questions. …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in temperature conversion using tkinter

    > insert between lines 70 and 71 this I updated the code accordingly. Note that a None value must be checked with the `is` operator.
  • Member Avatar for Gribouillis
    Gribouillis

    Edited temperature conversion using tkinter

    since the forum has been quiet for a while I thought to post this program , it might start new discussions . the idea is not new but it should …
  • Member Avatar for Gribouillis
    Gribouillis

    Edited temperature conversion using tkinter

    since the forum has been quiet for a while I thought to post this program , it might start new discussions . the idea is not new but it should …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Creating a pop-out Gui from another Gui

    I dont understand how you want to get this user input, nor why it could not be possible to append values to a list. You only need to define a …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in loops-python

    This may work while True: className=input("Are you enetring results for class a, class b or class c:>>>").strip().lower() if className in ('a', 'b', 'c'): break else: print('Invalid name, please enter a, …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Creating a pop-out Gui from another Gui

    You need to create a `Toplevel` window. There is a good example in the famous blog [Mouse vs Python](http://www.blog.pythonlibrary.org/2012/07/26/tkinter-how-to-show-hide-a-window/). Also study how Mike Driscoll uses of a `class App` in …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in vi editor creates bad data

    Did you try `"%lf "` instead of `"%lf"` ? (see `man fscanf`)
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in remove lines

    @David W This is also a universal problem with a known solution >>> lst = [ ['e', 1, 2], ['e', 2, 1], ['e', 1, 2], ['e', 2, 3] ] >>> …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in getting object definitions from a restricted namespace

    Replace all the `except: pass` with `except: raise` and you'll have a detailed report about what's going wrong. You could also log the exception tracebacks to files if you prefer.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in getting object definitions from a restricted namespace

    The problem is that your code works very well for me. I get <function func at 0x7f48097fd230> success so I don't understand the issue.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in getting object definitions from a restricted namespace

    You could try NS.update(vars(__builtins__))
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in getting object definitions from a restricted namespace

    I only removed line 7 and it worked. Edit: You can also use this initialization NS = {'__builtins__': __builtins__}
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to ~s.o.s~ in Python Companion operator

    Regarding your 3rd "why", Python performs certain primitive optimizations when it comes to immutable values. For when you write `e=258; f=258` on the *same* line, Python realizes that it can …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Companion operator

    I didn't know that, this is awesome. I don't think it is an optimisation, for example it does not work in functions >>> def f(): ... a = 10.1 ... …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in PyQt QPainter indent guides

    Perhaps an error in the computations of y1 an y2 ? Also find the reason of the index error.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Dynamic Change of Tkinter Label color

    There is a old thread [Click Here](https://www.daniweb.com/software-development/python/threads/325471/tkinter-updating-label-color) with an answer. Edit: you can also try hex colors such as `'#00ff00'`
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in PyQt QPainter indent guides

    > it still extends past the dedent in some cases what exactly am I doing wrong?? It is difficult to say without an sufficiently detailed example. Another issue that you …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in PyQt QPainter indent guides

    You could perhaps find some ideas in the source code of the [asciitree](https://pypi.python.org/pypi/asciitree/) module, which produces terminal output similar to the linux [tree command](http://bashitout.com/2013/05/06/Linux-Tree-Command.html).
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to rubberman in Where is IOCTL defined?

    The version of Linux has zip to do with where the ioctl() function is defined. It is a C function that runs in user space, but sends messages and data …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Companion operator

    This is documented here [https://docs.python.org/3/c-api/long.html?highlight=pylong_fromlong](https://docs.python.org/3/c-api/long.html?highlight=pylong_fromlong). It may depend on the python implementation.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in PyQt QPainter indent guides

    I don't see how tokenize can fail: it generates INDENT and DEDENT tokens that you could use to compute the indentation level. Also note that it is better to indent python …
  • Member Avatar for Gribouillis
    Gribouillis

    Edited PyQt QPainter indent guides

    so what I'm doing is building my own python IDE using PyQt. nothing can do what I need it to without a loss of something else, let alone properly. so …
  • Member Avatar for Gribouillis
    Gribouillis

    Edited PyQt QPainter indent guides

    so what I'm doing is building my own python IDE using PyQt. nothing can do what I need it to without a loss of something else, let alone properly. so …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Speeding Ticket Fine Calulation

    Please post the code that you tried and why it fails.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Stephen Hawking's speech system open-sourced

    Awesome story !
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to pritaeas in Stephen Hawking's speech system open-sourced

    http://blogs.msdn.com/b/cdndevs/archive/2015/08/14/intel-just-open-sourced-stephen-hawking-s-speech-system-and-it-s-a-net-4-5-winforms-app.aspx TL;DR: [GitHub repository](https://github.com/01org/acat).
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in First post in thread.

    It looks fine in qupzilla. I don't install chrome in an attempt to escape google's claws.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in i need help with this python program

    Here is function occur2() def occur2(n): for i, j, a, b in gen_sublist(n): s = [x for x in a if str(int(x) - 20) in b] for item in s: …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in First post in thread.

    Perhaps the beginning of the end for google chrome ?
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to megaflo in i need help with this python program

    I suggest that you use actual sets instead of lists for your working data. That way I'd guess you could throw away 95% of the code by using standard set …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in i need help with this python program

    Here is how you could write occur(n) more simply big_set = [ ['78','18','79','56'], ['13','40','16','04'], ['63','70','78','60'], ['10','35','66','13'], ['32','41','71','70'], ['50','58','02','11'], ['13','40','41','05'], ['12','52','50','60'], ['71','13','66','12'], ['50','90','73','41'], ['09','18','44','54'], ['12','41','32','67'], ] def gen_sublist(n): for i, seq …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Where is IOCTL defined?

    I suppose that you can obtain the implementation of `ioctl()` by downloading the source code of the `glibc` library [http://ftp.gnu.org/gnu/glibc/](http://ftp.gnu.org/gnu/glibc/).
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in HP printing

    > the latest isn't the latest version in the Ubuntu repositories This is not so unusual. I often have this issue with python modules, which I then install with pip …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Dealing with datetime objects

    You mean class `datetime.date` where datetime is the module, but as you imported `from datetime import datetime`, `datetime.date` is the descriptor `date` of `class datetime`. What you can do is …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Dealing with datetime objects

    If it is already a `datetime.time` instance, you can perhaps skip this step and use `strftime()` directly.

The End.