How to properly use .itemconfigure() in tkinter - python-3.x

I am trying to remove the underline from the items in my list box when i select it. I tried giving the entire list box the "activestyle=None" but i learned that you need to use the "itemconfigure". What i am lost on is what i should be putting for index. I have my .insert index as 'end' and it works properly but when i do that for the item configure it says its out of range. Here is the code if anyone can assist me here.
taskList = Listbox(setBox, bg="#1B2834",fg="white")
taskList.configure(width=183,height=39, activestyle=None, fg="#4299E9", selectbackground="#061523",
selectforeground="#4299E9")
taskList.itemconfigure('end', activestyle=None)
taskList.insert('end', taskIDnum)

You don't use itemconfigure to set the activestyle attribute. You should use the configure method of the listbox. The documented value to turn off the ring around active item (or underline, depending on platform) is the string "none", not the python value None.
taskList.configure(activestyle="none")

Related

Set animation position

I'm using Godot 4 beta. I want to skip to a specific frame in an AnimationPlayer, but I'm getting:
Invalid set index 'current_animation_position' (on base: 'AnimationPlayer') with value of type 'float'.
Here's the related documentation: https://docs.godotengine.org/en/latest/classes/class_animationplayer.html#class-animationplayer-property-current-animation-position
I currently have one AnimationPlayer in my scene, named 'animation', with an animation named 'Animation' with "Autoplay on Load". The animation 'Animation' has a length of 4.x seconds.
Here's my code attached to the scene:
func _process(_delta):
if Input.is_action_just_released("skip_intro"):
if animation_player.current_animation_position < 1.3:
animation_player.current_animation_position = 1.3
else:
skip_intro()
Update (2)
I know I can use animation_player.advance(), but it adds to the relative time. I'm looking for a way to go to a fixed frame, not a relative frame.
As you can read in the documentation you linked current_animation_position only has a getter. It is a read-only property.
If you want to go to an specific time you can use the seek method.
I found that I can use play() before advance() to go to an absolute frame. But I'd appreciate any other way to do it inliner.
animation_player.play("Animation")
animation_player.advance(1.3)
IMO it should be allowed to rewrite the current_animation_position property.

Selenium Select Input Box that Changes Name Every Session

I'm trying to access a search text box inside of our company's ERP system using Selenium. The screenshot shows the text box and the Xpath of the element.
This is a little tricky, because that Menu Search pop-up isn't really a pop-up. It somehow shows up when a user types Control + M.
By installing ChroPath and testing I've found the text-box always starts with the following string:
txtMenuSearch_Namespace_
I've tried to imitate what's described here, here and here with no luck.
The latest attempt in the snippet of my code looks like this:
menu_search_input_box_elements = driver.find_elements_by_xpath("//*[contains(#id, ‘txtMenuSearch_Namespace_’)]")
for item in menu_search_input_box_elements:
print(item)
I get the following error message:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*[contains(#id, ‘txtMenuSearch_Namespace_’)]' is not a valid XPath expression.
In all my attempts to get the syntax right I keep getting this message. Any help in figuring out how to .send_keys() to this field is greatly appreciated.
You get en error because of the ‘’ quotes, replace them with correct ones.
# id starts with txtMenuSearch_Namespace_
menu_search_input_box_elements = driver.find_elements_css_selector("[id^='txtMenuSearch_Namespace_']")
menu_search_input_box_elements = driver.find_elements_by_xpath("//*[contains(#id, 'txtMenuSearch_Namespace_')]")

Dynamically passing a row number to Session.findbyid method

I am trying to write a script which posts invoices in SAP through Excel (fairly new to this), and am running into the following error:
"The control could not be found by id".
The error is coming up at the below line:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,w_counter]").Text = w_glacc
Here, I am trying to pass the GL account number in the first row. There can be multiple rows, so I was hoping that instead of passing ctxtACGL_ITEM-HKONT[1,0]").Text, ctxtACGL_ITEM-HKONT[1,1]").Text etc. I wanted to initialize a counter and pass that value into this method.
Is there any way this can be achieved?
Found a solution:
Instead of passing just w_counter I had to pass "&w_counter&".
Previously, code was:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,w_counter]").Text = w_glacc
Now, it is:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,"& w_counter &"]").Text = w_glacc

how to use scrollToIndex with infiniteLoader?

I use the List+InfiniteLoader combination and I'd like to specify the index at which the list should start rendering at load time. I tried setting the scrollToIndex property on the List component without success.
What would be the proper way to set the start index to render with InfiniteLoader+List ?
setting scrollToIndex to the line number and scrollToAlignment to "start" on the list did the trick.

How to create TI-BASIC (TI-84+) input forms?

In the TI-BASIC programming language (Specifically TI-84+), how do you create input forms, such as the ones included in the default apps on the TI-84+.
The image included here shows an example of what I'm trying to create: A menu that you can scroll through and input multiple variables freely before executing a function
Additionally, is it possible to make this menu dynamically-updating as variables are entered?
You've set a rather tall order for TI-Basic to fill. user3932000 is correct; there is no built in function to create an input form of the type you request.
However, there is nothing stopping you from creating an interactive interface yourself. Creating it from scratch will be a time consuming and, it will consume a significant amount of memory on your calculator. There is no boilerplate code you plug your variables into to get the results you want, but you might have some luck modeling it after this quadratic solver I wrote.
ClrHome
a+bi
Output(1,1," QUADRATIC
Output(2,1," AX²+BX+C
Output(3,1,"ZEROS:
Output(6,1,"A=
Output(7,1,"B=
Output(8,1,"C=
DelVar YDelVar D
" →Str1
While Y≠105
getKey→Y
If Ans
Then
Output(X,4,Str1
Output(3,7,Str1+Str1+Str1+"
End
X+(Ans=34)-(Ans=25
If Ans<6:8
If Ans>8:6
Ans→X
Output(Ans,16,"◄
D(Y≠45→D
If Y=25 or Y=34
sum({A,B,C}(X={6,7,8→D
If Y=104:⁻D→D
10not(Y)+Y(102≠Y)-13int(Y/13(2>abs(5-abs(5-abs(Y-83
If Ans≤9
D10+Ans-2Ans(D<0→D
If X=6:D→A
If X=7:D→B
If X=8:D→C
If A
Then
2ˉ¹Aˉ¹(⁻B+{1,⁻1}√(B²-4AC
Else
If B
Then
⁻C/B
Else
If C
Then
"No Zeros
Else
"All Numbers
End
End
End
Output(3,7,Ans
Output(6,3,A
Output(7,3,B
Output(8,3,C
End
ClrHome
Ans
Here's a GIF of what it does for you.
With a little more work. This code could be used on the Graph screen instead of the home screen, giving more option in terms of layout and design.
In the TI-BASIC programming language (Specifically TI-84+), how do you create input forms, such as the ones included in the default apps on the TI-84+.
There are many ways to ask for input in your program:
Prompt: Asks for input and stores it in a variable. For example, Prompt A. Simplest way to ask for input, but not very visually appealing.
Input: Similar to the Prompt command, except that now you can include text within the input. For example, Input "What is your name?",A.
Menu(: Multiple choice input, and each choice is connected to a Lbl marker somewhere else in the script. Much like the error screen with the quit/goto choices that you've probably seen. For example, Menu("Are you a boy or a girl?","Boy",B,"Girl",G).
getKey: Checks if a certain key is pressed, and will output True (1) if that key is pressed. For example, getKey 105. See here for which numbers each key corresponds to.
The image included here shows an example of what I'm trying to create: A menu that you can scroll through and input multiple variables freely before executing a function http://imgur.com/ulthDRV
I'm afraid that's not possible in programs. You can either put in multiple inputs, or you might be interested in looking into making apps instead.
Additionally, is it possible to make this menu dynamically-updating as variables are entered?
If you're talking about the text on top of the screenshot, yes you can; just put a Disp command or something after each line of Input, so that it continuously overwrites the text above with new text after you input a variable.

Resources