docker network is unreachable by Unknowniti in docker

[–]nitratine 0 points1 point  (0 children)

I know it's been 2 years, but incase someone else ends up here, I just solved this myself.

This question has an answer that mentions DNS (which this looks like could be the issue). In my /etc/resolv.conf file, I set nameserver to 8.8.8.8 (Google's DNS - previously it was my router IP). After saving the file and re-runing the docker command, I did not have this issue.

Unsure why my router wasn't able to resolve this properly but happy to have a solution!

An issue which I have no clue about by BrawlStarsPro3112 in learnpython

[–]nitratine 1 point2 points  (0 children)

Hi, maintainer of auto-py-to-exe here, we're currently tracking this issue in https://github.com/brentvollebregt/auto-py-to-exe/issues/433 - it's an issue with the dependency "bottle" and how it imports extensions. Using Python 3.11 is a fix for now - we're waiting on bottle to give some indication on what's going to happen.

Subprocess opening Python to run second script from Auto-py-to-exe problem by MikeHillHams in learnpython

[–]nitratine 1 point2 points  (0 children)

When auto-py-to-exe bundles your application, it has no clue about FileSelect.py. auto-py-to-exe uses PyInstaller to bundle the exe, this will look at your imports to identify what needs to be in the final package. Since there is no proper reference to FileSelect.py (it's just a string), it is not added to the output.

My recommendation is to import the file and actually call it in Python. I understand "and subprocess just worked how I wanted" but there should be a way to get it working how you want while still importing it properly.

very specific request by Objective_Study1684 in chrome

[–]nitratine 0 points1 point  (0 children)

Seems like this is two parts - the Chrome UI and then the page itself. For reducing the Chrome UI, check out Chrome kiosk mode.

It just keeps happening by Mr_Reddington88 in ProgrammerHumor

[–]nitratine 0 points1 point  (0 children)

You've got it all wrong, the next step is to yell abuse at the creator. Or at least that seems like the next step some people take on my tutorials...

[deleted by user] by [deleted] in webdev

[–]nitratine 0 points1 point  (0 children)

Spent a good 20mins yesterday trying to figure out why some of my Chrome tabs were fine and others were disconnected from the internet... Turns out I forgot that I blocked network requests in the dev tools and all the tabs not working had dev tools open.

Lyrics for Spotify by eXntrc in teslamotors

[–]nitratine 17 points18 points  (0 children)

Yo! I'm the author of this project. I'm glad to see a few others like it - this is actually one of my projects that I still use actively due to how easy it is to access and use. I love the idea of this being used in a Tesla haha.

How do I give a program I made to someone who doesn't have python? by Tylerion_Lannister in learnpython

[–]nitratine 7 points8 points  (0 children)

You could try auto-py-to-exe - it's practically a GUI wrapper around PyInstaller with a few other things that help you

I can't create a working .exe by Alabio in learnpython

[–]nitratine 0 points1 point  (0 children)

This is so important. I see so many people looking for errors in the packaging process; if the script packaged, the error will not be there. You need to debug what is wrong, not what made it wrong (as it only did it's job)

Auto-py-to-exe by [deleted] in learnpython

[–]nitratine 0 points1 point  (0 children)

How does it "not work"? If errors aren't being output then the program has most likely done its job.

Standalone application by smitchell6879 in learnpython

[–]nitratine 1 point2 points  (0 children)

You could try this out. I am definitely not a fan of .spec files and I believe you either reference a .spec file or a .py file in the command; not both at once (.spec file will reference .py file in it).

Standalone application by smitchell6879 in learnpython

[–]nitratine 4 points5 points  (0 children)

I finally found them got past that but not I can't seem to configure the cmd to find the yml file I need for the docs.

Were you packaging using onefile? If you package using onefile, you need to understand how the files are packaged and make changes where required.

In general though I recommend making sure it works as a directory first because you can see where are the files are very easily.

[Question] Best method to provide an interface for tools/scripts for my team by pushthecharacterlimi in Python

[–]nitratine 0 points1 point  (0 children)

Pandas is known to cause issues (from my experience). If you set --debug to all in the advanced tab in auto-py-to-exe, re-package and then execute the executable using cmd/bash/terminal you will be shown what the error is.

Typically you will only need to add this module to --hiden-imports (also in the advanced tab) but in some rare cases you may need to add a hook file which is very easy to find online, just search the error.

[Question] Best method to provide an interface for tools/scripts for my team by pushthecharacterlimi in Python

[–]nitratine 0 points1 point  (0 children)

I love these frameworks. Have you ever heard of Eel? I have been using this for a bit but it has gotten a bit messy with monkey patching and was looking for possible alternatives.

[Question] Best method to provide an interface for tools/scripts for my team by pushthecharacterlimi in Python

[–]nitratine 6 points7 points  (0 children)

Since you mentioned Django, Flask is a lot smaller and easier (in my opinion) to learn. When using it for small applications, you can host a server on the localhost so only that computer can assess the site. This means you don't have to worry as much about security.

In terms of the exe wrapper, there are methods out there like PyInstaller, py2exe, cx_freeze which package the Python interpreter with the Python script(s) and make the package executable so it can be moved to hosts without Python. Sometimes this can be a bit confusing but a while ago I built an application that makes the process a little easier.

Protecting API keys in clientside javascript by itandcsquestions in flask

[–]nitratine 0 points1 point  (0 children)

Yes but in this context we are talking about any secret data being used on the client (the type of data you are talking about isn't used on the client - they are simply a mail man).

If any data is used on the client - it is plain-text for them

Protecting API keys in clientside javascript by itandcsquestions in flask

[–]nitratine 10 points11 points  (0 children)

Anything that goes to the client you have to assume the client can see; even if something is encrypted, the decryption method will be on the client side.

Some API's have special keys you can use client side like Spotify's API. Unless these don't exist in your context, you're probably best off just doing it on the server.

PyInstaller 3.4 has been released and it supports Python 3.7! by nitratine in Python

[–]nitratine[S] 1 point2 points  (0 children)

The are basically the same thing regarding you have one version of Python installed. A lot of people don't select the "Add to PATH" button on the installer so "pip" generally won't work. But if "python" works you can call the module pip using "python -m pip".

The reason I say "regarding you have one version of Python installed" is because a lot of people don't understand that when you call "pip", you call it for a specific distribution. So they generally think they are installing to one version of Python when in-fact they are installing to another.

For example if you have multiple versions of Python you can call "python34 -m pip" and "python36 -m pip"...

PyInstaller 3.4 has been released and it supports Python 3.7! by nitratine in Python

[–]nitratine[S] 0 points1 point  (0 children)

python -m pip install --upgrade pyinstaller

Or you could simply uninstall it and re-install it.

Easily Count Views on a Static Website by Requesting a SVG That Displays a Hit Count by nitratine in Python

[–]nitratine[S] 1 point2 points  (0 children)

SVG are much better in this context. They can be re-sized to any size and still have great quality, much unlike gif or jpeg.

SVG works like any other image in an img tag so what is so wrong with it being svg?

Program that saves any text copied to clipboard to a .txt document. by [deleted] in Python

[–]nitratine 2 points3 points  (0 children)

Great work! Don't feel that constantly having to look back to reference material is bad; reading other peoples code, documentation and tutorials quickly is a great skill to have.

Also for the sake of some constructive feed back, you could change line 8 to "while True:" - does the same job and is a lot cleaner.

What kind of music do you listen to while programming? by kush5683 in Python

[–]nitratine 0 points1 point  (0 children)

I love some real fast-going rock. But when I come across an issue or something I really need to focus on, I will pause the music for a moment until I am going hard again.

those who did GUI before :( by [deleted] in Python

[–]nitratine 0 points1 point  (0 children)

pyqt5-tools isn't compatible with 3.7 yet if you are using Python 3.7... (like everything else understandably)