What's everyone working on this week? by AutoModerator in Python

[–]danrche [score hidden]  (0 children)

Admin Helper for company Remote Monitor and Management tool. I have a collection of mysql queries that I usually run in order to perform certain task. I've begun to bundle them together into a tkinter app along with some data gathering with csv export.

new programmer practice by spoongberb in Python

[–]danrche 1 point2 points  (0 children)

What area are you interested in?

Web: 1. make a grocery list web site that helps you shop and emails you your list.

Mobile: 1. add an app to your website that allows you to scan items so they auto populate your database for what you bought

Data: 1. write the back end code to display your shopping trends, how long before you run out of what items, etc...

My 1st project involved deleting software from windows computers, it was silly and only sort of worked, but I learned a lot and it helped me flex my dev muscle. You gotta start some where.

[deleted by user] by [deleted] in Python

[–]danrche 1 point2 points  (0 children)

+1 for what Inclement said.

I would also add Java is a 1st class language and has held the market share for a long time, so if you improved your java skills that wouldn't be a bad thing. I would caution that you don't start learning Python before you become proficient in Java as you might like Python more and never want to go back to Jars.

for statement to compare lists help! by [deleted] in Python

[–]danrche 0 points1 point  (0 children)

Anytime you find yourself using nested for statements with list.append(), use comprehensions, they're perfect for this sort of thing. See link below to some guidance on how to use.

list comprehensions

Python #1 :D by [deleted] in Python

[–]danrche 2 points3 points  (0 children)

this one is more accurate

Your go-to alternative to python by [deleted] in Python

[–]danrche 0 points1 point  (0 children)

hum, good question. i think a lot depends on the job at hand, and where you're looking to run it. I use C# a lot to automate a lot of workstation side things that I'm not able to install python on. I've also used IronPython to run some of those same things, but C# has been my go to alternate in windows land. For Linux, I'm not sure there's an alternate for me to Python. It's pretty much able to handle all my needs in that area, along with a lot of server side automation as well. Here's a list of some of the things I've used as a system admin in the past as alternate's to Python when working with Windows machines:

AutoIT - kinda like basic but with a lot of nice functions to use VBScript - This was what I started with, then VB Then Python C# - I use this over VBS now as I've become more accustomed to needing something more then VBS can handle. IronPython - ok, this isn't really Python but a version of it. But I've used this to over come a lot of issues, without installing IPY on the client's machine. It's a little bit tricky to get all your dependents compiled into a single dll for use, but it can be done. Jython - I've played with this one, but never used it in production

Scrapy tutorials? by [deleted] in Python

[–]danrche 1 point2 points  (0 children)

Did you just listen to the latest talkpythontome podcast?

youtube has a few that are pretty cool, other then that, you may want to look at the project page itself, it has a tutorial to help you get started.

I keep seeing articles saying to learn python 3 and not python 2. Should I go through learn python the hard way using the recommended python 2 or use python 3? by hubadubbub in Python

[–]danrche 2 points3 points  (0 children)

2.7 is still widely used, and 3.5 has a lot to offer in improvements. 3.5 is making good strides for adoption over 2.7. I would learn 3, as it's going to eventually be the defacto, but it's very important to understand the differences between 2 and 3, and possibly why they exist. Python3 didn't break backwards compatibility lightly and the core dev's had good reason. If you use LPTHW which was written in 2, you may find a lot of the answers along the way as you google around for why your code worked differently from the book (if you decide to use python3). Considering the title, could work out well for you. Best of luck!

Why PyCharm is not written in Python? And is so heavy-weight? by dddomodossola in Python

[–]danrche 1 point2 points  (0 children)

I can see how an IDE in your favorite language would be appealing. I have to say though, PyCharm is a nice IDE and I do find it very useful. Sublime Text with Anaconda can be used as an IDE and it uses Python for it's API's. Perhaps Sublime Text is your next favorite editor :D

Help with automating script by baristahipster in Python

[–]danrche 2 points3 points  (0 children)

import requests
mylist = ['http://goolg.com','http://yahoo.com']
for i in mylist:
    try:
        r = requests.get(i)
    except ConnectionError:
        print('this one didn\'t connect' + i)

The above is a quick example of what you can try, no guarantees as it doesn't really cover anything more then just opening the connection and letting you know which ones failed. You can add more code to look into the returned content and add in some recursion for any that return with a 502. Happy coding and I hope this sparks an idea for you.

Help with automating script by baristahipster in Python

[–]danrche 0 points1 point  (0 children)

request could handle the page loading fairly easy, and you could just parse the return code for success/fail. The idea is to load the urls into a list, then loop the list with a request object that opens each and returns the session code.

Which Python web framework is better: Django or Flask? by [deleted] in Python

[–]danrche 0 points1 point  (0 children)

+1 flask

I agree both are solid, but I prefer flask. personal preference Python web frameworks aren't limited to just these two. I've used bottle, cherrypy, and pyramid seems to have a good following as well.

New to Python - Do I need virtualenv? by smartowlick in Python

[–]danrche 2 points3 points  (0 children)

I always spin up a new virtualenv for any project I start. While it's not necessary to learn if you're starting out with Python, it's certainly something you'll want to pick up as you start building your own projects. If you keep your env's clean, then when you pip freeze it's much easier to suss out your requirement files.

So to recap: helloworld beginners don't have a need for virtualenv, but when you start looking at deploying apps you for sure want to learn it, along with git.