Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Convert .bmp images to .gif inside script
Post: RE: Convert .bmp images to .gif inside script

(Apr-25-2018, 07:48 PM)wavic Wrote: You are opening the image in 'r' mode. You should use 'b' If I use "b" mode, I get: [inline]Traceback (most recent call last): File "test.py", line 11, in <...
Arontbt General Coding Help 5 5,772 Apr-25-2018, 08:52 PM
    Thread: Convert .bmp images to .gif inside script
Post: RE: Convert .bmp images to .gif inside script

(Apr-25-2018, 05:26 AM)wavic Wrote: You can use io module. Something like this: from io import BytesIO with BytesIO()as image: img.save(image, format='GIF') # the img is the picture you have a...
Arontbt General Coding Help 5 5,772 Apr-25-2018, 07:36 PM
    Thread: Convert .bmp images to .gif inside script
Post: Convert .bmp images to .gif inside script

I am writing a python program that applies filters to images. I am running an image through two different functions. One of them only takes .bmp files and the other doesn't take .bmp files but can tak...
Arontbt General Coding Help 5 5,772 Apr-25-2018, 03:19 AM
    Thread: Print every multiplication of recursion
Post: RE: Print every multiplication of recursion

(Apr-24-2018, 06:37 AM)Gribouillis Wrote: You can replace a * b with a function call mul(a, b) and do the print in mul(): def mul(a, b): res = a * b print('{} * {} ⁼ {}'.format(a, b, res)) return r...
Arontbt General Coding Help 4 3,758 Apr-24-2018, 10:01 PM
    Thread: Print every multiplication of recursion
Post: RE: Print every multiplication of recursion

(Apr-23-2018, 08:31 PM)pyghorz Wrote: The solution to the problem is: def expo(a,n): if n == 0: return 1 elif n%2 == 0: return expo(a*a, n/2) elif n%2 == 1: return a*expo(a*a, (n-1)/2) a = int(inpu...
Arontbt General Coding Help 4 3,758 Apr-23-2018, 08:39 PM
    Thread: Print every multiplication of recursion
Post: Print every multiplication of recursion

I need to print every multiplication step that happens in the following recursion code. I tried printing the return statement itself before returning it (as you can see) but that doesn't help. How sho...
Arontbt General Coding Help 4 3,758 Apr-23-2018, 08:15 PM
    Thread: Python openCV "img" is not defined error
Post: RE: Python openCV "img" is not defined error

(Apr-23-2018, 12:15 PM)buran Wrote: Please, post your full code (minimal runnable script). My guess is img is a variable, defined in the example code somewhere before that line and it is missing (i....
Arontbt General Coding Help 2 8,133 Apr-23-2018, 07:55 PM
    Thread: Python openCV "img" is not defined error
Post: Python openCV "img" is not defined error

I'm using openCV to write an image to a new file. I got the following method from an openCV textbook but I get an error that says "img" is not defined. cv2.imwrite("myimage.png", img)
Arontbt General Coding Help 2 8,133 Apr-23-2018, 03:15 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020