#I have a question about my python project

102 messages · Page 1 of 1 (latest)

visual roostBOT
#

@proper idol

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

susmi Said

I make a Selenium project, the current issue is that i want to set a label in a contentlayout(kivy) in another class but i rally dont know how to solve this
pls help me

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
#

@proper idol

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
#

@proper idol

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
  • new.txt
smoky eagle
#

Nice

visual roostBOT
#

@proper idol

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
  • message.txt
proper idol
#

BRO WWTF

smoky eagle
#

No files

proper idol
#

ahaha

#

what yshould i do

smoky eagle
#

.txt files has been illegal, since the Secret Coders' Convention of 1973,

proper idol
proper idol
smoky eagle
#

Mf kommt mit Taekwondo aber fällt nach 'nem Jab und so...

#

Now just post about the actual issue

proper idol
#

I make a Selenium project, the current issue is that i want to set a label in a contentlayout(kivy) in another class but i really dont know how to solve this
pls help me

smoky eagle
#

Setting a label in contentlayout(kivy) in another class

#

Let's see

proper idol
#

thanks

proper idol
smoky eagle
#

This one's the issue yeah?

proper idol
#

yessir

smoky eagle
#

Your class Selenium has no access to that method

#

You define the class Screen1 with the methods on it and then later on in the Main class you instantiate instances of the MyScreenManager and Screen1

proper idol
smoky eagle
#

But that instance doesn't know about your instance of Screen1

proper idol
#

hmm

smoky eagle
#

So you'd have to pass in the method (or self) into the Selenium constructor, then you can call it whenever you need it

proper idol
smoky eagle
#

Selenium still doesn't know about the specific instance of Screen1

#

(On a sidenote: I generally wouldn't recommend building UIs in Python, some people here claim it's easy and works well, I personally don't think it's a good idea)

proper idol
#

ok so how do i add the self from screen1 in the selenium constructor?

proper idol
smoky eagle
#

Well you'll need to change the constructor to take in your screen

Then you have to save that argument into a variable on your Selenium class (so you can access it in the method later)

And then you have to pass in self to the constructor call in line 156

proper idol
smoky eagle
#

Well you call the constructor to Selenium in line 156

#

But when you add a new argument to that constructor you have to pass it in as well

proper idol
#

yes

#

aaaah

smoky eagle
#

So you just pass in self to that constructor

proper idol
smoky eagle
proper idol
smoky eagle
#

Why?

proper idol
#

File "c:\Users\Susmi\Downloads\Typefucker-main\new.py", line 184, in start_typing
Selenium.startTyping(self, self.username, self.password)
File "c:\Users\Susmi\Downloads\Typefucker-main\new.py", line 60, in startTyping
self.selenium_instance.setContent(self,"Starting Selenium")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Selenium' object has no attribute 'setContent'

smoky eagle
#

this one's wrong

#

I guess

#

Let's check the error

smoky eagle
proper idol
#

also the startTyping method is executed properly but not setContent

smoky eagle
#

Add some prints

proper idol
smoky eagle
#

Is setContent executed?

proper idol
#

oh you mean in setContent

#

wait

smoky eagle
#

I mean everywhere

#

single step through with your debugger

proper idol
#

@smoky eagleok i tested it i can add a label to content_layout out of the setContent but in it it doenst function

smoky eagle
#

So the setContent machine is broken

proper idol
#

wtf

smoky eagle
#

😂

#

POV: Synchronous programming

proper idol
#

broo i am so cursed it doesnt work with threading either

smoky eagle
#

That was fast

proper idol
smoky eagle
#

I could go on my normal "Selenium is trash" rant

proper idol
smoky eagle
#

Browser automation in general sucks ass

#

But threading is the way to go here, one thread for the UI, one for the logic and off you go

proper idol
smoky eagle
#

You already answered your own question 😛

proper idol
smoky eagle
proper idol
smoky eagle
#

"it isn't a method"

#

-> so make it a method

proper idol
#

oh my god you are genious

proper idol
smoky eagle
#

kivy sucks and selenium sucks

proper idol
#

shit

#

thats too much work for a shitty output

#

i will just use console i guess

smoky eagle
#

This is the way

proper idol
#

and for opening my eyes about kivy and selenium

smoky eagle
#

😂

proper idol
smoky eagle
#

I'm fluent 🤓

#

Genderfluid and also nationalityfluid...

proper idol
smoky eagle
proper idol