If i delete this line "self.textbox.delete(1.0, tk.END)" in my
enter_meaning function the listbox items won't lower down to 1 item and i
just want 1 item to be shown after user searches the item in entrybox.
what i want to do is: when user searches in entrybox, the listbox items
lowers down to that
On 06/08/18 20:50, Ali M wrote:
> If i delete this line "self.textbox.delete(1.0, tk.END)" in my
> enter_meaning function the listbox items won't lower down to 1 item and i
> just want 1 item to be shown after user searches the item in entrybox.
So just display 1 item.
What you are currently doing
Hi there,
I got this here:
file_path = "C:\\Users\\...\\MyFile.txt" # path shortened for better readability
with open(file_path) as file_object:
contents = file_object.read()
print(contents)
It works.
Now I want to convert the code above into a function.
This is what I wrote:
def FileR
On Tue, 7 Aug 2018 at 15:07, Rafael Knuth wrote:
> def FileReader(file_path):
> with open(file_path) as file_object:
> contents = file_object.read
> return contents
>
> print(FilePrinter("C:\\Users\\...\\MyFile.txt")) # path shortened for
> better readability
>
> I got this err
On 07/08/18 13:46, Rafael Knuth wrote:
> Now I want to convert the code above into a function.
> This is what I wrote:
>
> def FileReader(file_path):
> with open(file_path) as file_object:
> contents = file_object.read
> return contents
>
> print(FilePrinter("C:\\Users\\...\\
> You forgot the parentheses (), and are returning a reference to the
> function instead of calling it and returning its result. Do this:
> contents = file_object.read()
oh, my bad. Thanks!
> Also, consider using snake_case instead of PascalCase for your
> function name, since the latter
Greetings! How to print °F/°C etc in python3?
(This works on a WSL):
~$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.release()
'4.4.0-17134-Microsoft'
>
On 07/08/18 22:32, Evuraan wrote:
print('\u00b0'+ " F")
> ° F
>
> Elsewhere, it no longer seem to work:
>
> $ python3
> Python 3.5.2 (default, Nov 23 2017, 16:37:01)
> [GCC 5.4.0 20160609] on linux
> Type "help", "copyright", "credits" or "license" for more information.
import platfor
Question is already answered, just wanted to add a mini-note.
def FileReader(file_path):with open(file_path) as file_object:
contents = file_object.readreturn contents
you /can/ return the read method here, which is what this typo does. And
the caller of the function can use it to
On Tue, Aug 07, 2018 at 02:32:58PM -0700, Evuraan wrote:
> Greetings! How to print °F/°C etc in python3?
In Python 3, you should be able to do:
print('°F/°C')
directly. If you can't, your configuration is broken.
If you are including this is a .py file, make sure your text editor is
set
>
> You could try setting
>
> PYTHONIOENCODING="UTF-8"
>
> in your OS shell and see if that helps, but I suspect
> there's a better way to deal with it...
>
Thank you! That was it!
Exporting thusly made it behave:
$ export PYTHONIOENCODING="UTF-8"
$ python3
Python 3.5.2 (default, Nov 23 2017, 16
11 matches
Mail list logo