|
Being pretty inexperienced I often have a hard time judging the quality/reliability/pitfalls of modules that don't have a lot of online ink written about them. So.... I ask, has anyone here used y_serial? On the surface, it seems like a pretty cool module for data persistence. I have a soft spot for useful modules that use nothing but standard library and are pure python. Thoughts? (As a side note it's some of the most usefully documented code I've ever read...very educational to an amateur like me)
|
# ¿ May 22, 2010 01:56 |
|
|
# ¿ May 20, 2024 11:36 |
|
Yakattak posted:I'm looking for a module that allows me to connect to a MySQL database. I've tried pymysql but it's bugged, so you can't SELECT more than one row (which sucks). Anyone have any good modules they wish to share? The standard answer is mysqldb. I've been needing something in pure python, so I've been using MySQL Connector/Python.
|
# ¿ Jun 5, 2010 00:14 |
|
Yakattak posted:
I don't know the answer in any case, but you should probably specify which of the two packages I mentioned you're trying.
|
# ¿ Jun 5, 2010 00:32 |
|
Habnabit posted:oursql is pretty much the best thing that's out there right now. The top of that link has a whole list of reasons why you should use it over mysqldb. I take it your a (the?) dev of oursql? Is it pure python?
|
# ¿ Jun 5, 2010 01:23 |
|
Habnabit posted:The only dev. It's written almost entirely in cython, with a bit of C and some code generation stuff in python. Too bad. That makes it not usable with things like greenlet or eventlet. king_kilr posted:I've never heard of ANYONE using MySQL Connector/Python. Then you're not reading this thread since I mention using it several posts up.
|
# ¿ Jun 5, 2010 05:04 |
|
This is a "point me in the right direction" question... I'd love to be able to analyze a video file and determine to some decent degree of accuracy if it contains a station logo (like if it says NBC or SyFy). I don't really care about what logo it is, just if it has a logo at all. I realize this is a fuzzy and ongoing area of research, but I'd at least like to experiment with it. Any libraries for this sort of thing? Any articles you can recommend? Any sort of pointers at all?
|
# ¿ Jun 10, 2010 20:15 |
|
I hate web design with a passion. What's the best library or framework for abstracting away as much of it as possible? Something useful for getting input from a user via forms or whatever web magic is possible and displaying results to them. I'm not horribly concerned with making it beautiful, just functional.
|
# ¿ Jun 18, 2010 02:27 |
|
Stabby McDamage posted:If you don't want to touch HTML, I think you'd want something higher level. I'm not sure what that is, but I'd be very surprised if there wasn't some framework for making CRUD apps without HTML. This is more along the lines of what I'm looking for. In my ideal world, I'm looking for "print" and "raw_input" for the web. bitprophet posted:That says to me he's doing the usual conflation of "web design" with "web development" and doesn't actually mean the visual design aspect of things. I don't want to do web development or design. If that's not possible, then I'm looking for the thing that gets me the closest.
|
# ¿ Jun 18, 2010 18:15 |
|
This is the sort of thing that I always do in 15 lines and someone shows me how to do in 2... Say I have a list of strings that are sorted the way I want them and that this isn't alphabetical...completely arbitrary sort order. Now I'm building another list of strings and I want to use the first list as the specification to sort the second list. Bonus points for sorting strings in the second list that aren't in the first list to the end. code:
code:
|
# ¿ Jun 23, 2010 20:48 |
|
Fayk posted:I think I'd be more comfortable if I understood the metaphors and methods used - like some commands don't work - it seems all special-cased, but I can't see how and where. I should look at it more, though... Yeah, this is why I installed ipython and then only used it once or twice.
|
# ¿ Jun 24, 2010 22:56 |
|
How the heck do you use virtualenv with ipython?
|
# ¿ Jun 25, 2010 00:23 |
|
Shaocaholica posted:How do I use non scrolling output? For instance, if I want to draw a progress bar in the terminal? Is there something I should be using other than print and sys.stdout.write()? I typically do something like: code:
|
# ¿ Jul 6, 2010 05:38 |
|
Shaocaholica posted:Ok, I got that working and it seems to do what I want but it only works if you only write one line. I understand your frustration with this. I first learned to program nearly two decades ago using QBasic, which had the awesome LOCATE statement which moved the cursor to any location on the text console. I wrote a whole text-based windowing system with that. Python's abilities in this area have left me wanting more.
|
# ¿ Jul 6, 2010 16:38 |
|
Shaocaholica posted:Also, what other not common ways to do stuff are there with Python? I like that you can use conditionals in list comprehensions. code:
|
# ¿ Jul 9, 2010 19:46 |
|
Shaocaholica posted:I guess another way about it would be to access the disk management module in windows. Not sure if there are any python modules to do that or just resorting to capturing command line stuff. I think you'd probably get more help with this in one of the Windows threads by just asking about general ways to get the info you need and then figuring out how to implement those ways in Python.
|
# ¿ Jul 15, 2010 21:57 |
|
onecircles posted:Is python a good language for a beginning programmer that wants to make games? You can make the games you describe just fine. Additionally, I don't think you'll ever regret having learned Python as it makes a great tool to solve problems. So if in the future you want to move on to C++ or whatever, Python is always going to be there for you with loving arms.
|
# ¿ Jul 18, 2010 22:06 |
|
AzraelNewtype posted:Doesn't it work as a function by default in 2.6 at least? No.
|
# ¿ Jul 21, 2010 00:26 |
|
hlfrk414 posted:What's wrong with I recently started doing: code:
|
# ¿ Jul 24, 2010 23:11 |
|
nbv4 posted:I looked into that, but it seems to be just for simple one-file scripts. I'm looking for a big installer that will install a bunch of dependencies. I've used py2exe for a script with something like 10 dependencies or something.
|
# ¿ Aug 8, 2010 17:25 |
|
Lurchington posted:Here's my interview whiteboard question from the yospos thread: link As a hobbyist programmer that item kind of stood out to me. Why would an employer care if you knew that? What problems does knowing that allow you to solve? (The link you provided is broken)
|
# ¿ Aug 19, 2010 03:39 |
|
I've been putting off learning web programming because it seemed like it was a completely different ballgame. I mean, I decided to learn Python a year or 18 months ago, and while Python is completely awesome, the general ideas weren't much different from when I did lots of QuickBasic programming back in the early 90's. My impression of web programming was that it was a lot different, and I didn't have a firm grasp on how all the pieces fit together. That coupled with the fact that I find any sort of HTML/CSS unfun, just put me off of the whole idea. Well yesterday, I took the plunge and installed Django and started working through the tutorials. I should have done this ages ago! As you can tell, I can't compare it to any other web frameworks, but man...Django is sweet stuff. Just though I'd throw that out there for any other newbish programmers.
|
# ¿ Sep 27, 2010 21:11 |
|
On Windows, trying to pip install packages that require compiling, I always get:code:
I've now installed mingw, and I have... code:
For some reason it's still trying to use Visual Studio, and I can't for the life of me figure out why. Anyone have any ideas where else I might look?
|
# ¿ Oct 5, 2010 17:56 |
|
I've used Komodo Edit and WingIDE. Prefer WingIDE, I think.
|
# ¿ Oct 9, 2010 01:53 |
|
Haystack posted:I really got a lot out of Think Python when I was starting out. Same. To give you guys some encouragement... I went through Think Python like 18 months ago with what amounted to zero modern programming experience. After I finished Think Python, I just went out to make solutions to several problems that I had, and Googled stuff that I didn't know or understand. I'm definitely not any type of guru, but I'm at the point where I'm contributing to a couple of open-source projects and have released some open-source stuff myself that is being used by others.
|
# ¿ Oct 12, 2010 22:42 |
|
tbp posted:Any tasks or problems I should set about trying to solve, sort of like how a 5th grader learns math? The universal answer to this is to write something to solve a problem you have. After you pick up the basics in Think Python, start solving a problem or automating something you do all the time. Some ideas taken from my projects directory: 1) Write something to organize your download directory. 2) Something to fetch album art for your mp3's. 3) Scrape sports scores/bus schedule/whatever from some website. 4) Write a script to fetch emails and then take actions depending on contents of email. (Remote control your PC!) 5) Same as 4 but with IRC. 6) Fetch your Google Reader shared items and post them to IRC/forum/IM/etc 7) Fetch and graph some data from your modem/router web-admin 8) Organize your photos into folders by date.
|
# ¿ Oct 13, 2010 00:39 |
|
tbp posted:Lets stick to it and learn this poo poo then. I'll continue with that PDF and soon we'll be taking on those tasks like its not problem Please do, it's worth it! Feel free to ask questions. Did the post by First Time Caller help give you an idea what you should be thinking about?
|
# ¿ Oct 13, 2010 20:00 |
|
I'm writing a script to sit between a program's web API (it's XBMC to be specific) and clients that access that API. For example, you can hit XBMC with... code:
My question is this...what's a lightweight framework/web server that would be good for implementing this? The only thing I'm somewhat familiar with is Django, which just seems too massive for such a thing, besides the fact that the docs constantly say not to use the built-in webserver for anything in production. I can't imagine any realistic scenario where there would be more than a few clients and a few XBMC installations, so I definitely don't need anything that is meant to handle massive amounts of requests. niff posted:I am used to working in visual studio, are there any IDEs for python that aren't too resource intensive for my (soon to be upgraded) 4 year old laptop? Or is it recommended to use notepad++ and a separate compiler so I learn without being auto-corrected? Give PyCharm a try, people seem to be diggin' it.
|
# ¿ Oct 19, 2010 22:32 |
|
bitprophet posted:And for the love of God, don't confuse it with the newer project that thought it would be a great idea to name itself "web2py". Totally different (and crap). I've checked out both Bottle and web.py. I like both of them quite a bit, but settled in to working up some test cases with bottle. Then I realized that I will probably eventually want basic HTTP auth, and I don't see an easy way to implement that with either of them. Right now I'm looking in to CherryPy. It seems like its a bit more heavy duty than what I really need, but it has basic and digest auth built-in.
|
# ¿ Oct 21, 2010 00:55 |
|
I posted about this before, but I've done some more troubleshooting to no avail... I'm having a real problem with distutils on Windows that I can't seem to figure out. So, I have a fresh install of Win7, along with a fresh install of Python 2.7, and an installation of mingw32. I set compiler=mingw32 in the "[build]" section of distutils.cfg. Any python library that tries to compile something (libxml, numpy, etc) errors out with "Unable to find vcvarsall.bat" which means that it's trying to use Visual Studio to compile. Through the use of some elite print statements in Lib\distutils\command\build.py, I determined that it is correctly reading the distutils.cfg file to get the compiler option. The problem is that, I can't quite figure out where in the distutils code it's trying to use Visual Studio instead of GCC. I assume that when when it finds that compiler is set to mingw32 it figures out somehow that it's located at C:\mingw32, but I'm not sure how it does that. I'm not even sure if actually gets to that point. It may read the option in from distutils.cfg and ignore it completely as far as I can tell. Someone kindly pointed me to a page with a lot of precompiled libraries, but I'm just really interested in figuring out what exactly is going wrong here. AFAICT, there's some bug in the distutils code causing this, but it's a little out of my expertise to track down what it is exactly.
|
# ¿ Oct 22, 2010 21:03 |
|
Huh, Sikuli looks pretty cool for automating GUI's with Python.
|
# ¿ Nov 2, 2010 04:24 |
|
This feels wrong to me:code:
code:
It can be "hours" or "hour" If it doesn't reach hours or minutes then it will only contain up to minutes or seconds, respectively.
|
# ¿ Nov 4, 2010 23:52 |
|
Hypnolobster posted:Which beginner book should I go with? My only programming experience is extremely unimpressive stuff in the Arduino software and some VB when I was like 13, so the official tutorial is pretty far over my head. I liked this.
|
# ¿ Dec 1, 2010 03:37 |
|
Rohaq posted:So, I've got a file I need to parse some details out of. str.split('--------------------')
|
# ¿ Dec 7, 2010 18:54 |
|
bc87 posted:I just tried it right now and I got this don't use int in the def for printMax. Use it when you call printMax.
|
# ¿ Dec 25, 2010 01:41 |
|
CrazyPanda posted:For the function open() is there a way to specify the directory it will look into? i dont want to type in the whole address into the function. You're using a programming language. Variables are your friend. Not knowing exactly what your question means...try this... code:
|
# ¿ Dec 26, 2010 23:20 |
|
GregNorc posted:I guess I should clarify that I'm not looking to do anything with said html, just strip out the data in a column in a table... Both of the suggestions provided are good for that.
|
# ¿ Dec 27, 2010 01:53 |
|
What's the practical difference between these?code:
code:
code:
|
# ¿ Dec 28, 2010 21:30 |
|
Yakattak posted:The first and second one don't inherit any classes, and the last one inherits from object. Well...duh. Why would a person care? Is there a difference between the first and second?
|
# ¿ Dec 28, 2010 21:39 |
|
Jarl posted:With windows it's never a problem, but boy is it a bitch with Linux. Try installing mysqldb on win7 for Python 2.7. I ended up having to figure out how to compile it myself, and this is a common problem with it.
|
# ¿ Jan 4, 2011 22:41 |
|
|
# ¿ May 20, 2024 11:36 |
|
Stabby McDamage posted:In that case, Python may not be your best bet. If there is really and truly no way to use this app other than the GUI, and you simply have to automate this program, then you'd be looking at some kind of GUI-driving macro tool, maybe AutoIt. He could use AutoIt's COM bindings in python. I gave a little example of how to do that on this StackOverflow answer.
|
# ¿ Jan 15, 2011 22:01 |