|
yaoi prophet posted:I don't know how good Python is but I do know that you can run a Debian virtual machine on any computer that's not powered by a potato battery.
|
# ? Jun 23, 2012 16:59 |
|
|
# ? May 9, 2024 19:18 |
|
The biggest pain in the rear end for me with Python and Windows was having to have so many different SDKs and toolchains installed. I guess *nix spoiled me in that regard. What I'm saying is that someone needs to port Homebrew to Windows.
|
# ? Jun 24, 2012 21:20 |
|
There's cygwin, but it's not tremendously awesome.
|
# ? Jun 24, 2012 21:30 |
|
http://sourceware.org/cygwinports/ helps if you're using CygWin.
|
# ? Jun 25, 2012 15:59 |
|
I hope you guys don't mind if I plug an upcoming sprint for a project I've been working with a lot recently, Salt. If there's a meet near you feel free to stop by, or pop by IRC if you're stuck somewhere remote. More details here
|
# ? Jun 26, 2012 00:07 |
|
Captain Capacitor posted:I hope you guys don't mind if I plug an upcoming sprint for a project I've been working with a lot recently, Salt. If there's a meet near you feel free to stop by, or pop by IRC if you're stuck somewhere remote. Tell them to put "Say what SALT does on the front page of the website" as a sprint task. Seriously. I found it in the documentation, but that website really looks like its been fistfucked by a marketing person who actually has no idea what the products for.
|
# ? Jun 26, 2012 02:39 |
|
duck monster posted:Tell them to put "Say what SALT does on the front page of the website" as a sprint task. Seriously. I found it in the documentation, but that website really looks like its been fistfucked by a marketing person who actually has no idea what the products for. Yes. I gave up before making it to the documentation.
|
# ? Jun 26, 2012 02:53 |
|
Yep, I clicked around and gave up. I see it has ACLs though!
|
# ? Jun 26, 2012 03:06 |
|
The site recently went under a redesign, so the new look still has some fixes needed. Basically it's a server configuration and remote execution system. Fabric meets Puppet, minus Puppet's DSL and more centrally managed than Fabric.
|
# ? Jun 26, 2012 03:30 |
|
Captain Capacitor posted:The site recently went under a redesign, so the new look still has some fixes needed. Basically it's a server configuration and remote execution system. Fabric meets Puppet, minus Puppet's DSL and more centrally managed than Fabric. See this poo poo here, it needs to be on the front page. Attention spans are short, especially for IT people who are desparately trying to research a solution on a lovely limited time span. A 2 sentence description right up the top on the front page, followed by a "Learn more" link that clearly enumerates what it does will make a world of difference. e: Even better just give the loving thing a slogan that appears near the logo on every god drat page, so that no matter what direction I land from google, I'll see "SALT , a remote configuration toolkit for people who forgot to stab the marketing guy" and I'll see it and go "Hey, this poo poo is useful, wheres the "ABOUT" link?" and go find out more. duck monster fucked around with this message at 04:31 on Jun 26, 2012 |
# ? Jun 26, 2012 04:29 |
|
What is a good module for visualising graphs of python module imports? pycallgraph is for calls, but i'm looking into python module dependencies. A quick google shows something called snakefood, has anyone used one they'd recommend?
|
# ? Jun 26, 2012 05:11 |
|
duck monster posted:See this poo poo here, it needs to be on the front page. Attention spans are short, especially for IT people who are desparately trying to research a solution on a lovely limited time span. A 2 sentence description right up the top on the front page, followed by a "Learn more" link that clearly enumerates what it does will make a world of difference. Yeah, I agreein' with this. I literally would never get to the documentation page if I were working on something that could use this tool. Also, the front page really barely indicates it's a python toolkit. If I got to the front page through a google search, I'd literally say "what the poo poo is this?" and click back. So yeah, as DuckMonster said, it seems like the marketing guy is loving over the dev team because they can't be arsed to even learn what y'all do. Also, I'm a scientific programmer who probably isn't your target audience, so keep that in mind anyway.
|
# ? Jun 26, 2012 18:22 |
|
JetsGuy posted:Also, I'm a scientific programmer who probably isn't your target audience, so keep that in mind anyway. Looks like a useful tool, though I'm not sure why I'd use it over the more established competitors -- that's probably another thing that should be on the site.
|
# ? Jun 26, 2012 20:47 |
|
For what it's worth I thought with the word stack in there it was a web framework. It's a ridiculously ambiguous web site, and someone really needs to just get onto the front page's CMS now and plug in a few words about what this thing actually is, especially if you're trying to pass around the link and make conversions.
|
# ? Jun 27, 2012 02:50 |
|
Is there some way to make an installable python package usable in-place as a git submodule? For instance, if I have numpy or something as a submodule of my repository, which is rooted at foo/ (so the submodule is at foo/numpy), is there some way to make numpy importable and usable from foo/ ? That is, if my CWD is foo/, I want to be able to just go 'import numpy' and have it work. I've been experimenting with setup.py develop, but it's obsessed with having even develop mode install to somewhere on your python path, whereas I just want to be relatively importable from its parent directory like any old package directory. I'm driving myself mad with virtualenvs, but something always escapes scope. Trying to have this work with Eclipse isn't helping.
|
# ? Jun 27, 2012 06:24 |
|
Just postin' to share a story of stupidity. As I've said, I use PyFits a LOT. Nontheless, I just made a dumb, dumb mistake. I was screaming at my program trying to figure out *why* a certain procedure was only working part of the time, and part of the time it wasn't. Turns out that I forgot that I forgot that while the tables in a FITS files are indexed from 0,1... the tables are indexed as 1,2... This made the values I was returning off by 1. It was part of the time because the conditions I wanted were actually screwing up in a wonky way because I forgot about this dumb thing. Essentially, while I was reading the tables in fv, I was like "WHY ARE YOU RETURNING INDEX 71 YOU STUPID PYTHON" when fv was clearly saying it should be 72. Oh, it turns out I am the stupid one, because Python was reading them as 0,1 to make my life easier. Sigh.
|
# ? Jun 27, 2012 18:15 |
|
So for years I've been saying that what Python needs is a notebook interface. (Or rather "What I need is a Python notebook interface.") So having belatedly found out about IPython's notebook, I went to install it. Frustrating. After a few stops and starts, I get it installed and run the server. Seems fine, until I go to the web interface and start to use it. After a few seconds, it reports that that the kernel has stopped (at the console it says "kernel has failed to respond to heartbeat") and do I want to restart it? Do so. After a few seconds the situation repeats. Chased a few bug reports and there were some suggestions about altering the config stayalive values. Did so, made no difference. The conversation in the bug tracker alternates between "yeah, that's fixed" and "well, it works for me". Any insight on this? Running this on Ubuntu 10.04.
|
# ? Jun 28, 2012 10:01 |
|
how do I run a file with a space in it in ipython? ex. cat 5.py run cat 5.py doesn't work run "cat 5.py" doesn't work run 'cat 5.py' doesn't work
|
# ? Jun 28, 2012 23:42 |
|
Trycode:
|
# ? Jun 29, 2012 00:02 |
|
So I've got a colleague, who desperately needs to learn how to program for the purposes of munging and analysing data. (Seriously: we're going over this detailed, hardcore analysis of thousands of points that he's done and then I found out that he did it by hand.) But he's self-labelled as not good at learning stuff by himself and is in a remote location. Any recommendations for online classes or communities where he can learn Python in a group?
|
# ? Jun 29, 2012 08:52 |
|
I'm doing a Python assignment for a Physics class. We're doing a simple projectile problem, where I'm given a velocity and a launch angle and plotting the x versus y position. The professor said, for extra credit, it would be nice if the plot would scale depending on the x and y values that I end up with. So, I have code:
So, what I'd like is to make the plot stop at whatever x value exists when y = 0. This is slightly tricky because y = 0 at two points, the initial launch and then when it "hits the ground" again. So how do I do this?
|
# ? Jun 30, 2012 21:37 |
|
Look up where() in the numpy docs.
|
# ? Jul 1, 2012 01:11 |
|
the posted:So how do I do this? I usually do something like Python code:
|
# ? Jul 1, 2012 15:54 |
|
You know, as I've said before, pylab is really not needed, and you should use pyplot. http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related You should *only* use pylab if you want interactive graphs. Interactive in this case not meaning simply zooming, you can do that in pyplot too. I understand the biggest draw for people to use pylab is it includes numpy in the same namespace. That's really just asking for trouble later on.
|
# ? Jul 1, 2012 16:34 |
|
I don't like having to know which module they're all from when I can just say pylab.blah Is that a bad habit to get into? Why?
|
# ? Jul 1, 2012 19:21 |
|
My intro to Python 2.7 class is asking for a recursive functions that counts the vowels in a string.code:
|
# ? Jul 2, 2012 04:35 |
|
Blenheim posted:My intro to Python 2.7 class is asking for a recursive functions that counts the vowels in a string. Wrap the if in a for loop over the characters.
|
# ? Jul 2, 2012 04:43 |
|
Blenheim posted:My intro to Python 2.7 class is asking for a recursive functions that counts the vowels in a string. I would do something like this: EDIT: I missed the "recursive function" part of your post. Basically, you don't need to do "lst = list(s)" as a string can be iterated over just like a list.
|
# ? Jul 2, 2012 04:45 |
|
i don't know why you'd ever want to do that recursively but this is the best i could do:Python code:
|
# ? Jul 2, 2012 04:49 |
|
Ridgely_Fan posted:I would say you shouldn't just do someone's homework for them, but it looks like you haven't since you ignored what was asked for, ha. Oh my god I thought I hit new post not edit, welp, there goes all my code Jewel fucked around with this message at 05:02 on Jul 2, 2012 |
# ? Jul 2, 2012 04:52 |
|
Blenheim posted:Problem 1 is that the program claims the global name "character" is not defined. Problem 2 is everything else. (Also, the professor wants a recursive version of the program without the idx argument, but one thing at a time, I suppose.) I've been struggling with this for a while now and could use some guidance. Problem 1: well yeah you haven't defined the variable 'character'. Did you mean to put a line like 'character = s[idx]' but forgot or something? Problem 2: Yes you don't need the idx because you can pass a substring to the recursive calls. The bigger problem though is you're only checking whether the very last character is a vowel. Don't you think you should check the other ones also? Try thinking it out in pseudocode first if you can -- something like "Ok I'll check if this first character is a vowel, then if so I'll just return 1 plus the count of the vowels left over. To get the vowels left over I'll take the remaining string, now I'll just check if this first character is a vowel, then if so..." I would say you shouldn't just do someone's homework for them, but it looks like you haven't since you ignored what was asked for, ha.
|
# ? Jul 2, 2012 04:55 |
|
Ridgely_Fan posted:I usually do something like Thanks, but could you explain in a little bit more detail what you did there in the if statement?
|
# ? Jul 2, 2012 05:00 |
|
the posted:Thanks, but could you explain in a little bit more detail what you did there in the if statement? Python code:
Python code:
code:
code:
Then you'll want the value of x where y crossed 0, which is 'xmax = x[max_i]'. Now read some documentation you lazy person.
|
# ? Jul 2, 2012 05:07 |
|
Jewel posted:
Haha, sorry. I didn't notice someone else had already actually done the assignment in the post before yours. Didn't mean to make you obliterate your post!
|
# ? Jul 2, 2012 05:13 |
|
xtal posted:because it copies each segment of the string on each iteration, it's very inefficient. perhaps there's a better solution? It showed me the way, and that's good enough for me. Thanks very much for the help.
|
# ? Jul 2, 2012 05:35 |
|
the posted:I don't like having to know which module they're all from when I can just say pylab.blah Personally, I think it's a bad habit since it essentially doesn't teach you what is from numpy and what's from pyplot. Hell, even if I used pylab, I'd still import numpy just because that's what I'm used to using. It's a bit of a picky point to be sure, but you probably want to know *exactly* what you're doing. What happens if pylab ever becomes depreciated? What if one day you're coding something that you don't need to graph, and it's just easier to import numpy? How would you know if you've never used them separately? In addition, numpy is updated a lot more often than matplotlib, so you'll also benefit from more updated modulues.
|
# ? Jul 2, 2012 18:33 |
|
This might not really be a Python question, but I am slowly compiling a bunch of methods I use into a program I'll be releasing as open source with a scientific paper thats hopefully getting published soon. In trying to make it as flexible as possible I've started using the argparse module. I end up with an object containing all of my parameters. In possible coding horror fashion, my program consists of a cascade of small functions passing data around. I am wondering what the correct way to distribute parameters is. Do I pass the argparse object around like a toy, do I take the parameters out and pass them around or make it global somehow? The problem I am discovering is that I get 5-6 function calls deep and my methods have all sorts of parameters in them that they really have no use for except to pass to their grandchildren for use.
|
# ? Jul 3, 2012 15:09 |
|
OnceIWasAnOstrich posted:This might not really be a Python question, but I am slowly compiling a bunch of methods I use into a program I'll be releasing as open source with a scientific paper thats hopefully getting published soon. In trying to make it as flexible as possible I've started using the argparse module. I end up with an object containing all of my parameters. In possible coding horror fashion, my program consists of a cascade of small functions passing data around. I am wondering what the correct way to distribute parameters is. Do I pass the argparse object around like a toy, do I take the parameters out and pass them around or make it global somehow? The problem I am discovering is that I get 5-6 function calls deep and my methods have all sorts of parameters in them that they really have no use for except to pass to their grandchildren for use. Some options in ascending order of complexity. In terms of "elegance" we kinda descend from least elegant to most elegant.
I'm excited you're even worrying about this. We're having a related discussion right now in another thread starting right here.
|
# ? Jul 3, 2012 15:24 |
|
In my Python for Dummies class, we're doing an exercise where we compile a dictionary of terms from a text file and make a simple translator. The keys are all one-word, but the values vary from one word to several. So: code:
|
# ? Jul 5, 2012 06:50 |
|
|
# ? May 9, 2024 19:18 |
|
Blenheim posted:In my Python for Dummies class, we're doing an exercise where we compile a dictionary of terms from a text file and make a simple translator. The keys are all one-word, but the values vary from one word to several. If you're asking what I think you're asking, I think you can use "value = pairs[1:]" which means "1 and everything after it". I didn't know about that terminology for a while since it's hard to search for it. There's also other tricks like [::2] being every second key, and [::-1] being the list in reverse.
|
# ? Jul 5, 2012 07:00 |