Search Results

Showing results 1 to 40 of 106
Search took 0.01 seconds.
Search: Posts Made By: zachabesh
Forum: Python Sep 15th, 2009
Replies: 5
Views: 827
Posted By zachabesh
From what you've said, it sounds like you have to print out elements 3 through 6 (if 0 is the first element) of a list. This will print those 4 elements, doesn't matter how long the list is.

n =...
Forum: Python Aug 28th, 2009
Replies: 7
Views: 314
Posted By zachabesh
I would suggest that instead of storing the data in separate lists, store all the data in a class.

example:

class Data:
def __init__(self,row,value,var1,var2):
self.row = row
...
Forum: Python Aug 27th, 2009
Replies: 2
Views: 223
Posted By zachabesh
Very interesting. Thanks. I'll keep this in mind.
Forum: Python Aug 27th, 2009
Replies: 2
Views: 223
Posted By zachabesh
Hi all,

Here's my issue:

>>> a = [1,2,3] #all good so far
>>> b = a #make a copy of a, called b
>>> b.remove(1) #remove value 1 from b ONLY
>>> print a #grrr, value has also been removed...
Forum: Python Aug 14th, 2009
Replies: 194
Read Me: Starting Python
Views: 85,516
Posted By zachabesh
Or, sort a list of class objects by an attribute (similar idea as above):

import operator
import string

def normcaps(strg):
s = string.upper(strg[0]) + strg[1:]
return s
Forum: Python Aug 14th, 2009
Replies: 3
Views: 291
Posted By zachabesh
Should be noted that Python won't mutate your string. If you say s = "'Quote Example'\tby person\n" s will always be that string unless you reassign it. When you print it, python interprets the...
Forum: Python Aug 14th, 2009
Replies: 7
Views: 390
Posted By zachabesh
Here's where you should always start:

What is your input to the script? This should be something tangible, a trigger, a file, some sort of a parameter you are going to pass.

What will your...
Forum: Python Aug 13th, 2009
Replies: 7
Views: 500
Posted By zachabesh
Also, you might want to make sure you are always dealing withe floats:

>>> float(499.99)
499.99000000000001
>>> float(500) - float(499.99)
0.0099999999999909051
>>> round(float(500) -...
Forum: Python Aug 12th, 2009
Replies: 2
Solved: Mimic HTML form
Views: 214
Posted By zachabesh
Yea, I'm trying to figure out the Net Panel. Firebug seems pretty powerful.

I did get this working though. Turned out to be an issue about using 'www' or not using 'www.' Durrrr....
Forum: Python Aug 12th, 2009
Replies: 2
Solved: Mimic HTML form
Views: 214
Posted By zachabesh
Hi all,

I'm trying to mimic an html form that calls a script on the web. When I put the form together on a page, it works, and I was wondering if there was a way I could "scrape" this post...
Forum: Python Aug 11th, 2009
Replies: 7
Views: 390
Posted By zachabesh
More info, plz.

State clearly what you are trying to to. Are you going to try and use python to parse the results (via html scrape)? Because that would likely mean regular expressions and that...
Forum: Python Aug 10th, 2009
Replies: 8
Views: 345
Posted By zachabesh
Whenever I start a script I usually write out in plain English what I want to do. It will keep you organized and you will never not know "where to start." Comment out the plain english, and script...
Forum: Python Aug 10th, 2009
Replies: 1
Views: 225
Posted By zachabesh
Hey all,

Here's my problem: I have a class that I want to be able to save and and load. But I need the class to be mutable I guess. Check it out:

class Tool:
def...
Forum: Python Aug 5th, 2009
Replies: 4
Views: 282
Posted By zachabesh
Heh heh, I might have jumped the gun there a bit. It doesn't look like you can attach a scrollbar to a Frame. I just gave you the first answer off the top of my head. Seems like you should be able...
Forum: Python Aug 5th, 2009
Replies: 5
Views: 323
Posted By zachabesh
What does this line do?

Pmw.initialise(root)

Check if you're getting an error, run it from IDLE. Even if the window remains open there could still be an error.
Forum: Python Aug 5th, 2009
Replies: 14
Views: 604
Posted By zachabesh
No way, was that a spammer? That was way slick. Had me fooled.
Forum: Python Aug 5th, 2009
Replies: 4
Views: 282
Posted By zachabesh
Stick both canvases in a mainframe, and attach the scrollbar to the mainframe.
Forum: Python Aug 5th, 2009
Replies: 1
Views: 597
Posted By zachabesh
Neither am I. Interacting with mail servers like yahoo and gmail is unfortuanaetly not as simple as: connect, login, email. See below for what I use, but you may need to experiment with yahoo. The...
Forum: Python Aug 5th, 2009
Replies: 2
Hi
Views: 195
Posted By zachabesh
That's nice. Have a question? ;)
Forum: Python Aug 5th, 2009
Replies: 5
Views: 323
Posted By zachabesh
Your code looks somewhat roundabout. Quick sanity check, make the Label this and see if it works:

label = Label(parent,text = 'Hi world!',background = 'yellow')

If theres a highlighted piece...
Forum: Python Aug 4th, 2009
Replies: 12
Solved: Good IDEs?
Views: 613
Posted By zachabesh
Hmmm, interesting. I'm going to check out PyCrust, since I'm NOT a fan of IDLEs many issues...
Forum: Python Aug 4th, 2009
Replies: 12
Solved: Good IDEs?
Views: 613
Posted By zachabesh
Heh heh, I love eclipse, but the interactive shell (a la IDLE) is pretty darn awesome for testing stuff out. Example:

>>> #start with your function
>>> def count_chars(char,string):
"""A...
Forum: Python Aug 3rd, 2009
Replies: 3
Views: 181
Posted By zachabesh
Well you can say Label(root,text="I'm a label!").grid(row = 0,column = 0) so no, you don't have to.
Forum: Python Aug 3rd, 2009
Replies: 2
Views: 265
Posted By zachabesh
I would say it depends on your server configuration. Python has a MySQLdb module that lets it interact easily with MySQL databases (you would likely have to install it), but I'm not totally sure in...
Forum: Python Aug 3rd, 2009
Replies: 1
Views: 230
Posted By zachabesh
http://www.google.com/search?q=flash+command+line+arguments

Welcome to the interwebs. Use 'em.
Forum: Python Aug 3rd, 2009
Replies: 3
Views: 181
Posted By zachabesh
Hey all,

Working on a medium sized Tkinter app. I have it working fine, but I feel like the app isn't as clean as I would like it to be, namely because I have a million labels and different...
Forum: Python Aug 3rd, 2009
Replies: 16
Views: 701
Posted By zachabesh
playground.nubeachfilms.org
nudebeachfilms.org/playground

Now you've seen everything! :)
Forum: MySQL Jul 31st, 2009
Replies: 2
Views: 314
Posted By zachabesh
Durrr... Thanks for the snippet, I'll try and implement, and post back when I'm done.
Forum: Python Jul 31st, 2009
Replies: 16
Views: 701
Posted By zachabesh
Errrr...stop me if I'm stating the obvious, but if your domain is mycompany.com, and the subdomain is pstats.mycompany.com, "pstats" will be a folder in the main "www" directory of mycompany.com. ...
Forum: Python Jul 31st, 2009
Replies: 10
Views: 765
Posted By zachabesh
What is the obsession with global variables? Seriously.

Pass the necessary elements to your function, and return them back. You seem to be doing half of this, but you are not putting your return...
Forum: Python Jul 31st, 2009
Replies: 7
Views: 278
Posted By zachabesh
Honestly you should never cut and paste. Ask questions about bits you don't understand. Rename variables at the very least so that you know where everything is going.

When you say it's not...
Forum: Python Jul 30th, 2009
Replies: 7
Views: 278
Posted By zachabesh
Here's a function to send email from a gmail account:

def email(usertuple,sender,to,subject,msg):
"""Sends an email from a gmail account"""
(login,pswd) = usertuple
print...
Forum: Python Jul 29th, 2009
Replies: 7
Views: 278
Posted By zachabesh
How's this for a solution:

Instead of worrying about what email client your users are using, have python send the email for them, through an account that you set up!

It's fairly easy to get...
Forum: MySQL Jul 29th, 2009
Replies: 2
Views: 314
Posted By zachabesh
Hey all,

Here's my problem: php/mysql noob here.

I have an admin section on the website, and I have successfully password protected all the php pages in that directory using sessions. I...
Forum: Python Jul 28th, 2009
Replies: 33
Views: 978
Posted By zachabesh
This thread makes my head hurt. Do you need to store all the info about the cars in a python module? What about a csv? Also, if you're going to call a class in a module, that class has to be part...
Forum: Python Jul 28th, 2009
Replies: 25
Views: 1,070
Posted By zachabesh
Link directly to it.

ie: somesite.com/myscript.py

But make sure your print statements are "html"

ie: print "<P> Hello shadowickman </p> "

There are certain rules you have to follow for...
Forum: Python Jul 28th, 2009
Replies: 4
Views: 431
Posted By zachabesh
Okay, I quickly glanced over your code. It doesn't look like it works at all. Am I right?

Note that subprocess.Popen only creates the instance, it doesn't run the command line. You need to use...
Forum: Python Jul 28th, 2009
Replies: 11
Views: 956
Posted By zachabesh
def get_xml(uri,login):
netlock = urlparse.urlparse(uri)
pswdMngr = urllib2.HTTPPasswordMgrWithDefaultRealm()
...
Forum: Python Jul 28th, 2009
Replies: 1
Views: 229
Posted By zachabesh
Mmkay. The first step is determining what your input and output are. I believe the input is the cheques.data file, and your output is the XHTML that looks something like this:

<!DOCTYPE html...
Forum: Python Jul 28th, 2009
Replies: 52
Views: 1,400
Posted By zachabesh
You should really check out the tutorial on python.org. Anyway, since you're having trouble wrapping your head around try except, here's a basic outline that handles bad choice slightly differently...
Showing results 1 to 40 of 106

 


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

©2003 - 2009 DaniWeb® LLC