#π .py conversion
186 messages Β· Page 1 of 1 (latest)
@jolly tangle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
The code works fine, it draws images from a folder in its file group so as an exe it will need to be able to draw files or hidden files from attached folders
Only thing you could do to make it a "true exe" is re-write it in a compiled language like C#, C++, etc.
Okay, C# is a language I understand.
What's with the aversion to pyinstaller though? It works pretty well for most cases
But i still need it to have the core functionality of.
- Open random image on set interval from attached folder
- Repeat
Ive gotten a million errors, and I'm sure in the future ill figure it out, but right now i need the easy solution
Honest to god id love just an online converter
Like i have the fully finished .py, I have a folder where images are stored, and its all grouped in a main folder
Keep in mind. I am new to python, this is the first python script ive ever written
I had to self teach myself how to code in python
So what errors were you getting with pyinstaller?
That python wasnt installed, paths weren't set up, unknown commands, pip doesnt exist
Like I swear every error in the book
I looked to online resources that offered solutions that didnt work
Sounds like less of a pyinstaller issue then an environment issue
Oh and I couldn't even install pyinstaller
That too
Like I said. I dont wanna go through the troubleshooting right now. I will at a later date. For now i just want the easy solution
I am just unsure if C# will be able to do what i need the code to do.
There is no easy solution it sounds like. But there is an EASIER solution, which is to just setup your environment correctly and use pyinstaller. I could help, I've used it before to deliver an executable.
Well itd have to wait till I got off work.
I'm sure this would be easier on my personal laptop
I have the code if you want it. Its like a 45 line .py that opens images
Yeah you can post it if you want
Click here to see this code in our pastebin.
Okay, I'll take a look
It does work all n all tho
It opens images in rapid succession in random positions along the users screen
My code may be scuffed or rudimentary
As I kinda vibe codded and just used what i thought would work
So apologies in advance if its TERRIBLE
Do you really need to have .exe though? It often brings more unnecessary work as python is not really made for that
I need it to be executable on computers without python
It needs to be able to be opened regardless of having python
Would it be easier to have people install python? Because pyinstaller and tools as such just bundle the python to the exe, basically. Which results to the antivirus to flag them
That would be fine because its automatic
I know from experience that installing python is ANNOYING
So it would be best if it either ran without it, or installed it with the file
Not really? You just run the installer and click a couple times.
You do have to note that the user downloading would have the exe flagged as a virus when they install it, so if it's just random stranger you will have hard time having someone install that
Well its not going to random strangers
For my purposes. I need an exe
I want it to just work wherever you run it, without installation of anything extra (or if it installs, atleast automatically with the file)
I need to open this on 100 computers. And I dont want to manually install python 100 times
Do you need to avoid pyinstaller?
As stated above, I struggle to install it currently and set it up
So unless any of you want to package the file with pyinstaller, that wont work for this
I want to do ANYTHING but trouble shoot pyinstaller rn
Also do I need to bake the images and assets into the exe? Or can those stay in a seperate folder?
What command did you run? What is failing?
^^
But again. I dont want to troubleshoot pyinstaller rn
I want LITTERALLY ANY other solution
Whatever you want to do, either is possible. At least with pyinstaller
Sigh...
Dependsβ’ do you want images to be included with the exe? Or do people download their own images
I can try pyinstaller on my personal in a bit and get back to you
Predetermined images, based on the ones I currently have compiled
There should be --add-data flag for that
Let me give that a go
Though it might require code changes to the path handling
Immediately gave an error

At line:1 char:3
+ --add-data
+ ~~~~~~~
Unexpected token 'add-data' in expression or statement.
What was the full command you ran?
Oooh noted
Lets try that again then
I mean, same basic idea.
python is an interpreted language, but fundamentally needs a runtime
Ran it in shell, same thing
screenshot it
I cannot at this time
We can come back to this later
Im gonna try this all on my personal
I was able to compile to to exe by just copy pasting your code and running pyinstaller on it, the path handling requires some fixes there
I'm not sure where the errors you see happen?
This script seems kinda...malicious. You're hiding the main window and spawning windows rapidly all over the screen infinitely. I'm reminded of old javascript malware which did the same thing
Thought, it starts spam opening images
Yeah thats what it does!
Why would you want to do that....?
To spam open images on my computer
You don't need exe for that...
I want a code to do it
Do the people you are trying to distribute this to know about it, I kinda doubt it
Yes
Probably to scare or frighten a user I'm guessing. They were probably going to put it on another computer and have someone run it without knowing what it does.
I intend to not only verbally convey this
And also have a file in the folder say "hey, if you open this file, your computer will be image spammed"
Ye, I'm assuming there's really not great intent for this :/
Its for a convention im going to
It spams images of the charecter
Who is a computer head!
I intend to distribute this on floppy disks (a key charecter trait is they use floppy disks)
The program is also named after them!
Being "Scagtastic" their name is scag
Perhaps I could code a window that comes up first that says "are you sure you want to open this? It will ["warning"]"
I'm not sure how I'd do that, so if any of you know then thatd be great!
I could also put a limiter on how many images it loads as to not crash their pc!
-if I knew how to do that-
I think a limiter makes much more sense for this
!rule 5 I do wonder if this applies here
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
Good idea
Spamming windows on someone else PC...?
This is meant to be like a silly in charecter prank
I do not intend anything malicious
The original code had no intent of limiting it
As stated before. My first time coding
It has other sections there as well, "Inappropriate"
I have no idea how to set these things up, so I wanted opinions from others
Well id appreciate help making the code ethical then!
Code can be unintentionally malicious if not written properly. I'll give them the benefit of the doubt that it wasn't intentional
If I was being malicious I wouldnt ask for help being ethical lmao
But i appreciate the education! It hadnt crossed my mind that it may be malicious
Well, they did know it spams images without it stopping + intent to distribute to some people
How would I go about adding a limiter?
Like, does so many, then it stops the program (allowing all windows to be closed)
Well right now the code doesn't allow the program to ever end because you're hiding the main window in the background
Here let me run it on my PC
I believe there is still the X
Let me test!
And- its broken
How the hell-
The image folder isnt linked anymore?
Wow... python is FUN /sarc
You were talking of it showing images of X, and some convention. Why not just make a "slide show" out of it, no need to spam the images there, wouldn't the people there much more appreciate it
Whats a slideshow?
Just change the image within the single window
Like Google slides kinda sideshow? Or is there a python meaning
Im going for a visual effect, let me find an example
Sound Like Someting from Mimic From Tower Heroes
#dandyworld #soundeffects
Like so
Id probably need to slow down the rate of spawning, and add a cap to it
Maybe I could add a sound too!
Do you get the general concept though?
I may be explaining it poorly and i apologize if so
Possible less malicious idea: open a canvas the size of the screen, paste images in random parts of it
You could probably rotate, zoom, fade them as well
Not sure on that part
My idea with using windows is you can close them out
Same as these in game
And each image counts as its own window so it has to be closed out
I don't wanna overload the other laptop oppening it, so id likely go for a cap of 10 (as theirs 8 images)
There's still the problem of the main window being hidden. If the user can't close the main window the program will never end.
I'm pretty sure its there!
Everytime i use the program theres only the x
I went to double check but my code broke on line 7
And i dont know how
So first i need to fix that
Then test it
Then add nessesary limiters, maybe a warning window before the program starts
Then it should be done!
I appreciate the help offered thus far!!
Let me try and troubleshoot, and if I hit any roadblocks ill ask here!
Fixed it!!!
And i can confirm the window is still there
The minimize, fullscreen, and X
Now how would I add a warning before the program starts?
Im thinking a window with text, and buttons like "yes" and "no"
I have added this now
And my code broke-
Pyinstaller:
What?
ok bro if u want rly easy solution
download claude code
and ask it to do what u want
this task specifically is very easy for it to handle because its like a fire and forget type thing
no-one needs you to tell them that they can ask an AI
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.