|
Totally coming to PyCon next year, have the talks list open but haven't read it yet but excited already! nbv4, you want to use pip, e.g. pip install -e git://github.com/username/projectname or pip install -e git+ssh://server:repo.git or whatever. king_kilr is pretty handy with it I hear.
|
# ? Nov 5, 2009 19:26 |
|
|
# ? May 9, 2024 13:32 |
|
bitprophet posted:Totally coming to PyCon next year, have the talks list open but haven't read it yet but excited already! OK I see now. The repo I want to install is here: http://bazaar.launchpad.net/~django-openid-auth/django-openid-auth/trunk when I do this: code:
code:
code:
nbv4 fucked around with this message at 20:20 on Nov 5, 2009 |
# ? Nov 5, 2009 20:13 |
|
nbv4 posted:virtualenv nub here. Whats the recommend way to install a module from svn or git or something? Do you just navigate to the /site-packages/ directory within the virtualenv then do a checkout? Just get into the virtualenv (source/bin activate) then just run setup.py like normal or like you said... just drop it in site-packages Pretend like it's the normal site-packages directory
|
# ? Nov 5, 2009 20:22 |
|
Avenging Dentist posted:Ok design question: I have several related C interfaces which may or may not be present in a given implementation. The interfaces look like: Incidentally, the solution to this is a la namedtuple.
|
# ? Nov 5, 2009 20:24 |
|
nbv4 posted:OK I see now. The repo I want to install is here: http://bazaar.launchpad.net/~django-openid-auth/django-openid-auth/trunk You're getting a zsh error caused by the # in the url. Try putting the url in quotes, or escaping the #, or something like that.
|
# ? Nov 5, 2009 20:30 |
|
Is there any way to "freeze" a python application such that it could be used on osx, from Windows? I've used py2exe before for making exe's and it worked perfectly, but if I want to be able to give someone on a mac a single file they can run without having to install any python libraries, would I need to do that from a unix based system? I don't have any c compiler available on windows at the moment if that makes any difference.
|
# ? Nov 6, 2009 16:28 |
|
tripwire posted:Is there any way to "freeze" a python application such that it could be used on osx, from Windows? I've used py2exe before for making exe's and it worked perfectly, but if I want to be able to give someone on a mac a single file they can run without having to install any python libraries, would I need to do that from a unix based system? I don't have any c compiler available on windows at the moment if that makes any difference. py2app
|
# ? Nov 6, 2009 16:29 |
|
ATLbeer posted:py2app Thanks!
|
# ? Nov 6, 2009 16:30 |
|
On a related note, does anyone have any idea what to do if py2app fails with KeyError: "There is no item named 'pkg_resources.pyc\\\\' in the archive" Kind of scratching my head here. I can see the file sitting in my C:\python26\Lib\site-packages\ directory. is it breaking because of all those extra backslashes in there? Anyone seen something like this before? tripwire fucked around with this message at 17:22 on Nov 6, 2009 |
# ? Nov 6, 2009 17:14 |
|
Am I retarded or does py2app simply not work from windows? Maybe it was stupid but I dug right in that son of a bitch and made it strip trailing backslashes from files it was trying to grab. Then it tripped up trying to make a symlink, which it obviously cannot do if its not a posix platform.
|
# ? Nov 6, 2009 17:43 |
|
tripwire posted:Am I retarded or does py2app simply not work from windows? py2app is supposed to be run from a mac, some googling suggest things like VMWare to get a Mac environment, but that might be just as ornery. edit: I'm going to just vent here, but after playing with collections.MutableMap and anydbm, I spent 2 hours trying to figure out why my data wasn't persisting. I thing realized that I was setting my item as pre:obj[value] = key pre:key in obj Lurchington fucked around with this message at 18:07 on Nov 6, 2009 |
# ? Nov 6, 2009 17:51 |
|
time to boot into linux
|
# ? Nov 6, 2009 17:57 |
|
My project uses django, PIL, matplotlib, Basemap, numpy, and a few others, as well as a number of django specefic apps. Should I be putting all of those into my virtualenv, or should I be installing the bigger ones such as PIL and matplotlib into dist-packages? Or is that defeating the whole point of virtualenv?Sailor_Spoon posted:You're getting a zsh error caused by the # in the url. Try putting the url in quotes, or escaping the #, or something like that. actually i just removed everything beyond the "#" and it seemed to work vv
|
# ? Nov 6, 2009 18:14 |
|
nbv4 posted:My project uses django, PIL, matplotlib, Basemap, numpy, and a few others, as well as a number of django specefic apps. Should I be putting all of those into my virtualenv, or should I be installing the bigger ones such as PIL and matplotlib into dist-packages? Or is that defeating the whole point of virtualenv? Some people put super global, fixed version, things in their global site packages (like psycopg, PIL, numpy, etc.). Personally I keep everything in my virtualenv, and I use the --no-site-packages option when I create my venvs.
|
# ? Nov 6, 2009 18:23 |
|
tripwire posted:Is there any way to "freeze" a python application such that it could be used on osx, from Windows? I've used py2exe before for making exe's and it worked perfectly, but if I want to be able to give someone on a mac a single file they can run without having to install any python libraries, would I need to do that from a unix based system? I don't have any c compiler available on windows at the moment if that makes any difference. Opps.. Sorry, I read your post way too fast. As far as I know, you won't be able to compile something to run on a Mac without using a Mac itself. Sorry about leading you down the py2app path by accident there.
|
# ? Nov 6, 2009 18:47 |
|
On the subject of free books and printable online docs, I've checked the OP and printed out several binders of free books, but are there any other recommendations? My office has a bindery that I use after hours so I can print stuff and organize it really well. I'd love some more books to add to my nerd library, or just helpful things to print out and have posted in my office.
|
# ? Nov 10, 2009 16:15 |
|
Docs for GUI frameworks could be useful for you. Maybe something like: http://www.wxpython.org/onlinedocs.php
|
# ? Nov 10, 2009 16:43 |
|
I'm trying to write a handler using mod_python that will process all requests on a specific directory and perform some action before serving the originally requested file. Is this possible? I'm really only familiar with the mod_python publisher which is a completely different animal.
|
# ? Nov 12, 2009 19:55 |
|
Hey guys, just decided to learn python. I used to consider myself a pretty good VB6 programmer, and was waiting for microsoft to realize what a huge mistake they made with VB.net, yeah I got tired of burning that torch. I downloaded and installed the latest version from python.org and since then I have been doing some reading, haven't gotten any further then "hello world" but that's fine by me, I'm in no big hurry. I then find this thread which led me to pyglet which sounds bad as hell. So I download it and try to install: 3.1 < 2.4? Yeah I'm gonna love python
|
# ? Nov 13, 2009 23:56 |
|
aSSbAG. posted:Hey guys, just decided to learn python. I used to consider myself a pretty good VB6 programmer, and was waiting for microsoft to realize what a huge mistake they made with VB.net, yeah I got tired of burning that torch. Python 3.0 is a huge departure from 2.x and as such many libraries need to be updated to do things the new way. You need to either get the latest 2.x release or wait until Pyglet supports 3.x. I'm not sure why that information isn;t front and center on the Pyglet website. But yeah, that's a pretty terrible message that doesn't describe the actual problem.
|
# ? Nov 14, 2009 00:14 |
|
Should I just keep going with 3.x and wait for everything else to catch up then? I don't see the point of learning something that's already on the way out.
|
# ? Nov 14, 2009 00:27 |
|
aSSbAG. posted:Should I just keep going with 3.x and wait for everything else to catch up then? I don't see the point of learning something that's already on the way out. There's very little real difference on the surface, and most code is convertible with a simple tool. Stick to 2.x for now - you'll have a much better time - but be aware of what's changing.
|
# ? Nov 14, 2009 00:40 |
|
aSSbAG. posted:Hey guys, just decided to learn python. I used to consider myself a pretty good VB6 programmer, and was waiting for microsoft to realize what a huge mistake they made with VB.net, yeah I got tired of burning that torch. The only mistake with VB.NET was that they used VB6 as a basis. Also I really question the notion that Py3k is a "huge departure" from Python 2.x. There are some important differences, but it's still more-or-less the same syntax, and the number of stuff that changed (as opposed to being added) could probably be summed up in a page.
|
# ? Nov 14, 2009 00:56 |
|
Avenging Dentist posted:Also I really question the notion that Py3k is a "huge departure" from Python 2.x. There are some important differences, but it's still more-or-less the same syntax, and the number of stuff that changed (as opposed to being added) could probably be summed up in a page. Probably. I'm still developing for 2.3 so for me it feels much bigger than for everyone else.
|
# ? Nov 14, 2009 00:59 |
|
Avenging Dentist posted:The only mistake with VB.NET was that they used VB6 as a basis. Sure, it's not (on my opinion) a "huge departure". However, I think the developer is still in the position of deciding whether they code for 2.x or 3.0, rather than "2.x or higher". And - for anyone but language wonks - the best advice is to program for 2.x for the meanwhile.
|
# ? Nov 14, 2009 01:19 |
|
HatfulOfHollow posted:I'm trying to write a handler using mod_python that will process all requests on a specific directory and perform some action before serving the originally requested file. Is this possible? I'm really only familiar with the mod_python publisher which is a completely different animal. Yes, it's incredibly trivial. SetHandler in a <Directory> block and return apache.DECLINED from the handler. Even better, don't use mod_python at all.
|
# ? Nov 17, 2009 11:12 |
|
outlier posted:Sure, it's not (on my opinion) a "huge departure". However, I think the developer is still in the position of deciding whether they code for 2.x or 3.0, rather than "2.x or higher". And - for anyone but language wonks - the best advice is to program for 2.x for the meanwhile. Agreed on both counts - 3.x feels pretty much the same-old-same-old to me, but there's enough minor differences that a module probably has to be developed for 2.x or 3.x. To those who are just learning Python - 2.x is the way for the moment, and when the time comes 3.x won't be that big a change.
|
# ? Nov 17, 2009 14:49 |
|
I think people are confused about the way a project like Python works. The 2.x and 3.x distinction is really about compatibility. The idea is that within a major version number, your code should be forward compatible, and in some cases backwards compatible depending on if you're using new features. All that number really means is that if you write something on 2.3, it will continue to work for 2.3 through 2.x. So the introduction of Python 3 is mostly sending a signal about compatibility. They are breaking the forwards compatibility thing because of a few features they feel are necessary. These don't have to be giant sweeping changes. They can be small changes to the way Python works that end up breaking compatibility. It's not really a lot of work to transition code from 2.x -> 3, but the change in major version number is a signal that you can't just run 2.x code straight in 3.x. Just because version 3 exists doesn't mean you have to use it, and in most cases, it's recommended that you not use it for apps you'd like to easily distribute until it becomes commonly pre-installed like 2.x is. That said, I still think the most commonly installed version of Python in the ecosystem is 2.3 or 2.4 even though there exist versions after them. These things can take a bit of time to work their way into distros. The way the system is now with the introduction of 3 while 2.x is still entrenched is a pretty decent way of handling compatibility issues while still pushing forward with development of the language. It also means that programmers have a very reasonable amount of time to transition their code.
|
# ? Nov 17, 2009 18:28 |
|
Thought I'd post this here as esr wrote ForgePlucker in python. He's had a couple blog posts about the wisdom of scraping HTML with regex, and as always, the posts and the comments are entertaining. http://esr.ibiblio.org/?p=1411
|
# ? Nov 17, 2009 18:52 |
|
Thermopyle posted:Thought I'd post this here as esr wrote ForgePlucker in python. He's had a couple blog posts about the wisdom of scraping HTML with regex, and as always, the posts and the comments are entertaining. He's talking out his arse as normal. Also, real men use lxml to scrape webpages. The comments are simply more noise. On the other hand this is a comparatively more useful and informative post about scraping: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 tef fucked around with this message at 19:16 on Nov 17, 2009 |
# ? Nov 17, 2009 19:13 |
|
ErIog posted:I think people are confused about the way a project like Python works. This is what everyone else already said, only with fewer words.
|
# ? Nov 17, 2009 20:06 |
|
tef posted:He's talking out his arse as normal. Also, real men use lxml to scrape webpages. The comments are simply more noise. People with poo poo to do use PyQuery, beautiful API, fast as hell (it's built on lxml), I can't say enough good about it, if you are parsing HTML any other way you are an idiot.
|
# ? Nov 17, 2009 20:25 |
|
king_kilr posted:People with poo poo to do use PyQuery, beautiful API, fast as hell (it's built on lxml), I can't say enough good about it, if you are parsing HTML any other way you are an idiot. (We had an existing team that knew how to use xpath over css selectors. xpath is pretty awesome)
|
# ? Nov 17, 2009 20:29 |
|
tef posted:(We had an existing team that knew how to use xpath over css selectors. xpath is pretty awesome) I'll take your word for it I build websites so we all know CSS selectors.
|
# ? Nov 17, 2009 21:55 |
|
Avenging Dentist posted:This is what everyone else already said, only with fewer words. I realize. It was just that I got a vibe from people saying it wasn't a "huge departure," like that was news that there was somehow a lot of people who thought it was supposed to be.
|
# ? Nov 17, 2009 22:48 |
|
So I've been using Python for a couple of years now for my graduate research, for data reduction and plotting and whatnot. I'm currently using the Spyder IDE as another goon referred me to the project, and I'm very happy with it as a MATLAB replacement for many reasons. I even got the chance to talk to one of the high up MATLAB developers as to why I prefer the Python setup versus a commercial package like MATLAB. I'm currently using python + numpy + scipy + matplotlib with it happily thus far. I've also tried the Sage implementation, which includes the above mentioned packages and then some others related to numerical computing. The notebook browser interface is handy, but I find myself sticking to the text editor or Spyder approach so far. I know Sage includes other packages useful for numerical and math work, but are there any math/Python/science folks that can chime in on if I should consider using Sage full time versus the setup I have now? I realize that it's all about personal preference and all, but I just don't see a reason to use a packaged setup like Sage for now. Any insight is appreciated, and in the end, it's really a big pleasure to use either setup over MATLAB for many reasons.
|
# ? Nov 18, 2009 08:16 |
|
sonic bed head posted:I just downloaded pydev for eclipse and I am having a lot of trouble figuring out why I get unresolved imports when the code runs without errors. The code that I'm working with is very basic and the problem still happens. After I got an unresolved import for logging (the standard library module), I just turned them off. Go to Window->Preferences->PyDev->Editor->Code Analysis and open up the imports tab. Change Import not found from Error to Ignore. nbv4 posted:virtualenv nub here. Whats the recommend way to install a module from svn or git or something? Do you just navigate to the /site-packages/ directory within the virtualenv then do a checkout? Packages should have a setup.py file in the root, if so, use that to install (or make an egg and then install that).
|
# ? Nov 18, 2009 19:08 |
|
What's the right way to debug a function? Specifically, I'm working on a script right now with a function that's giving me some problems. When it drops back to the interactive interpreter I'd like to explore the values of various variables that are local to the function, but we're not in the function anymore so those variables aren't accessible. code:
|
# ? Nov 18, 2009 23:25 |
|
well, I usually stick a few printouts (or logger calls) inside of the function and take a look at the change over time. Your code is intentionally pretty vague so that's all I could say. Maybe you stick in a few assert statements if you want to ensure a particularly bad result isn't happening.
|
# ? Nov 18, 2009 23:30 |
|
|
# ? May 9, 2024 13:32 |
|
Thermopyle posted:What's the right way to debug a function? Add the following where you want the debugger to kick in: code:
code:
|
# ? Nov 18, 2009 23:48 |