Forum: Python Jun 30th, 2009 |
| Replies: 2 Views: 222 |
Forum: Python Jun 30th, 2009 |
| Replies: 2 Views: 222 If I do something like this:
print "%08d" % 2
It will print '00000002'. However, I want to change the "8" to a "3" at runtime (to get '002' instead). I tried this:
MyLength = 3
print "%0"... |
Forum: Python May 29th, 2009 |
| Replies: 1 Views: 964 I'm just starting python and it seemed reasonable to go ahead and learn the new version. I read that numpy wont be available for python3 until at least 2010. All I need is a basic "vector", "matrix",... |
Forum: Python May 15th, 2009 |
| Replies: 6 Views: 839 sneekula - you'd still have to put a line for every single subdirectory though, right?
What I'm saying is I'd just want to add "/home/doriad/PythonScripts" to my PYTHONPATH and then any subfolders... |
Forum: Python May 13th, 2009 |
| Replies: 6 Views: 839 If I have /home/doriad/Scripts/Python/
and inside I have a bunch of folders, ie Geometry, Math, Other, etc that each contain scripts (.py files), is there a way I can just add... |
Forum: Python May 3rd, 2009 |
| Replies: 5 Views: 490 Cool - is it available for download? |
Forum: Python May 3rd, 2009 |
| Replies: 5 Views: 490 Thanks, I haven't used classes in python yet so this is a good example for me.. For future readers, there is a small typo. In the Pt class, the return statements say Point(...) when they should say... |
Forum: Python May 2nd, 2009 |
| Replies: 5 Views: 490 Is there a library that has a function that will take (theta,phi) and return (x,y,z)?
Thanks,
Dave |
Forum: Python Apr 28th, 2009 |
| Replies: 4 Views: 371 Thanks for the quick response! That'll work for now. However it doesn't scale particularly well (if I wanted a 1000x1000 matrix, I couldn't fill all those entries manually the first time!). Is there... |
Forum: Python Apr 28th, 2009 |
| Replies: 4 Views: 371 I usually make a matrix like this
from Numeric import *
A=zeros([3,3])
print str(A[0,1]) #access an element
I would like to store a pair of values in each element, that is have a matrix... |
Forum: Python Apr 21st, 2009 |
| Replies: 5 Views: 375 |
Forum: Python Apr 20th, 2009 |
| Replies: 5 Views: 375 thanks, that's a good start for now, but eventually it would be nice to do
--files *.txt --Size 4.2 --Duration 5
Dave |
Forum: Python Apr 20th, 2009 |
| Replies: 5 Views: 375 What I'm really trying to do is loop though a list of files
python ./MyScript.py *.jpg
should be able to do something like this
for MyFile in *.jpg |
Forum: Python Apr 20th, 2009 |
| Replies: 5 Views: 375 I need to get an unknown number of file names from the command line, ie
./python MyScript.py --Files 1.txt 2.txt 3.txt
parser.add_option("-n", "--NumFiles", type="int",
... |
Forum: Python Apr 20th, 2009 |
| Replies: 4 Views: 382 Also, how do you handle required options? I saw a lot of threads about a philosophical debate of if options can be required, but no information on how to actually use them.
Dave |
Forum: Python Apr 20th, 2009 |
| Replies: 4 Views: 382 I see, I didn't realize that optparse was built in. I'm coming from c++, so almost nothing is built in, and adding libraries is usually pretty annoying. |
Forum: Python Apr 20th, 2009 |
| Replies: 4 Views: 382 I want to parse some simple arguments from the command line. This shows all of the arguments:
#!/usr/bin/python
import sys
#print all of the arguments
for arg in sys.argv:
print arg |
Forum: Python Apr 20th, 2009 |
| Replies: 1 Views: 326 A friend of mine said that python could be used to make simple GUIs (ie. a couple of buttons and a text box). I googled "python gui" and it looks like there are 30934 libraries to make GUIs. Is there... |
Forum: Python Apr 17th, 2009 |
| Replies: 6 Views: 369 Does anyone have a good 2 line summary of WHEN to use perl/python/bash/etc? To do easy-ish things, they can clearly all be used, but there is likely an ideology behind each that indicates WHEN/WHY to... |