Search Results

Showing results 1 to 19 of 19
Search took 0.01 seconds.
Search: Posts Made By: daviddoria ; Forum: Python and child forums
Forum: Python Jun 30th, 2009
Replies: 2
Views: 222
Posted By daviddoria
Forum: Python Jun 30th, 2009
Replies: 2
Views: 222
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
Cool - is it available for download?
Forum: Python May 3rd, 2009
Replies: 5
Views: 490
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
Forum: Python Apr 20th, 2009
Replies: 5
Views: 375
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Posted By daviddoria
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
Solved: Simple GUI
Views: 326
Posted By daviddoria
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
Posted By daviddoria
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...
Showing results 1 to 19 of 19

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC