Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: tk is not defined
Post: RE: tk is not defined
(Jan-09-2022, 07:43 AM)Gribouillis Wrote: The error message doesn't match your code on the screenshot. The code says fenetre = Tk() and the error message says fenetre = tk(). It is not possible.
wha... |
|
jip31 |
General Coding Help |
8 |
10,317 |
Jan-12-2022, 05:03 AM |
|
|
Thread: tk is not defined
Post: RE: tk is not defined
(Jan-08-2022, 09:28 AM)Larz60+ Wrote: tk is a nickname for tkinter when defined as such:
import tkinter as tk
thus your Tk() statement would be fenetre = tk.Tk()
or you can say:
from tkinter impor... |
|
jip31 |
General Coding Help |
8 |
10,317 |
Jan-09-2022, 06:53 AM |
|
|
Thread: tk is not defined
Post: RE: tk is not defined
It is what I have don elike explained in my email.... |
|
jip31 |
General Coding Help |
8 |
10,317 |
Jan-09-2022, 06:38 AM |
|
|
Thread: tk is not defined
Post: tk is not defined
Hi
The code below works when I execute it with idle or in CLI but when I execute it with vscode, I have the message "NameError: name 'Tk' is not defined"
from tkinter import *
fenetre = Tk()
The nam... |
|
jip31 |
General Coding Help |
8 |
10,317 |
Jan-08-2022, 07:55 AM |
|
|
Thread: help on django issue
Post: RE: help on django issue
(May-20-2021, 03:33 PM)jip31 Wrote: Hi
I follow the tuto below in order to display a simple "hello" message with django in windows
but when I launch my web page from http://127.0.0.1:8000/ I have th... |
|
jip31 |
Web Scraping & Web Development |
1 |
1,858 |
May-20-2021, 03:42 PM |
|
|
Thread: help on django issue
Post: help on django issue
Hi
I follow the tuto below in order to display a simple "hello" message with django in windows
but when I launch my web page from http://127.0.0.1:8000/ I have the message below:
OSError: [WinError 12... |
|
jip31 |
Web Scraping & Web Development |
1 |
1,858 |
May-20-2021, 03:33 PM |
|
|
Thread: help on pandas circular import
Post: RE: help on pandas circular import
(May-18-2021, 11:50 AM)snippsat Wrote: See if you have name i file pandas.py then rename of delete it.
import pandas as pd
a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar)Output:0 1
1 7
2 2... |
|
jip31 |
General Coding Help |
2 |
8,392 |
May-18-2021, 11:54 AM |
|
|
Thread: help on pandas circular import
Post: help on pandas circular import
hi
i try to test this basic code but i have the message AttributeError: partially initialized module 'pandas' has no attribute 'Series' (most likely due to a circular import)
import pandas as pd
a =... |
|
jip31 |
General Coding Help |
2 |
8,392 |
May-18-2021, 11:39 AM |
|
|
Thread: help on else condition
Post: RE: help on else condition
(May-18-2021, 06:31 AM)perfringo Wrote: As we don't know what tirage() does and what does 'doesn't work' mean it's very hard to provide any assistance.
But one thing you could consider writing diff... |
|
jip31 |
General Coding Help |
5 |
2,218 |
May-18-2021, 06:41 AM |
|
|
Thread: help on else condition
Post: RE: help on else condition
So does it mean that I cant use such a code or does it means I have to ident tirage()?
Because I tried to indent tirage() in the if block but it doenst works.... |
|
jip31 |
General Coding Help |
5 |
2,218 |
May-18-2021, 06:23 AM |
|
|
Thread: help on else condition
Post: help on else condition
hi
when I try to add an else condition, i have the message "(variable) else: Any"
what is the problem please?
if reponse == 'Oui' or reponse == 'oui':
print("Super,le tirage va commencer" '!')
t... |
|
jip31 |
General Coding Help |
5 |
2,218 |
May-18-2021, 05:38 AM |
|
|
Thread: help on def in if block
Post: RE: help on def in if block
(Apr-30-2021, 10:50 AM)ibreeden Wrote: Hi Jip,
I see no problem in calling the function from the if block. I think your indentation is still not correct. All the lines from the "if" block must have ... |
|
jip31 |
General Coding Help |
7 |
2,847 |
Apr-30-2021, 12:19 PM |
|
|
Thread: help on def in if block
Post: RE: help on def in if block
now indentation is good
import random
def tirage():
for i in range(6):
print(random.randint(1, 40))
print("Voulez-vous jouer au loto", "?")
reponse= input("Entrez votre réponse:")
prin... |
|
jip31 |
General Coding Help |
7 |
2,847 |
Apr-30-2021, 10:38 AM |
|
|
Thread: help for list printing
Post: RE: help for list printing
(Apr-29-2021, 10:44 AM)Larz60+ Wrote: If you are trying to print jp outside of the function (def), it won't work because jp has gone out of scope.
if you return the value, you will be able to print... |
|
jip31 |
General Coding Help |
8 |
3,664 |
Apr-30-2021, 09:37 AM |
|
|
Thread: help for list printing
Post: RE: help for list printing
(Apr-29-2021, 10:43 AM)ibreeden Wrote: How do you try this? Your function does not return anything. I think that is the problem. Your function must return a value and then you must use this return v... |
|
jip31 |
General Coding Help |
8 |
3,664 |
Apr-30-2021, 09:36 AM |
|
|
Thread: help on def in if block
Post: RE: help on def in if block
(Apr-30-2021, 08:02 AM)DPaul Wrote: The simplest editor will do.
Even IDLE will tell you that something in the syntax is not right.
You can also count TABs , can't go wrong.
But nothing will verify... |
|
jip31 |
General Coding Help |
7 |
2,847 |
Apr-30-2021, 08:52 AM |
|
|
Thread: help on def in if block
Post: RE: help on def in if block
(Apr-30-2021, 06:59 AM)DPaul Wrote: It looks like there is something wrong
with the indentation, it is inconsistent.
Especially lines 11-12 compared to 4-5
When fixed everything works fine.
Paul
sur... |
|
jip31 |
General Coding Help |
7 |
2,847 |
Apr-30-2021, 07:28 AM |
|
|
Thread: help on def in if block
Post: help on def in if block
Hi
I dont' understandard why the tirage() def doesnt execute (it works only after else block)
Could you help please??
import random
def tirage():
for i in range(6):
print(random... |
|
jip31 |
General Coding Help |
7 |
2,847 |
Apr-30-2021, 06:46 AM |
|
|
Thread: help on random methods
Post: RE: help on random methods
(Apr-29-2021, 11:50 AM)snippsat Wrote: Missing a )
>>> import random
>>>
>>> print(random.sample(range(40), 6))
[21, 5, 12, 37, 8, 20
>>> # Also when in REPL do... |
|
jip31 |
General Coding Help |
2 |
2,014 |
Apr-29-2021, 12:15 PM |
|
|
Thread: help for use print in REPL
Post: RE: help for use print in REPL
(Apr-29-2021, 10:45 AM)ibreeden Wrote: Hi Jip31,
Although it is right what Perfringo said, for the purpose of studying: what your code gives me is the following:
Error: File "forum03.py", line 3
... |
|
jip31 |
General Coding Help |
10 |
4,271 |
Apr-29-2021, 11:17 AM |