Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 7th, 2004, 03:22 AM
ain ain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 49 ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
poll - SVG

hi,

i am suppsoed to make a simple poll with SVG and python,
can anybody help me??
i need some suggestions, and maybe some links where i can find code exmples, and so on ???

pllzzz,
thanks,
ain

Reply With Quote
  #2  
Old October 7th, 2004, 05:55 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Just a few things to check, really just for more spacific info on what you want here. By SVG you mean Scalable Vector Graphics right? I've never used this. But I'm assuming that you want something like the polls on Devshed? Or the little green lines on Google?

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old October 7th, 2004, 02:01 PM
ain ain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 49 ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
yeah, youre right SVG is Scalar Vector Graphics. i want to make a poll which have three options like "yes" "no" and "dont know". i wants show results these results with diagram and i wants to write that code in python ??

hope its helps,

ain

Reply With Quote
  #4  
Old October 7th, 2004, 06:25 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Ok, I think I know what you're getting at. But, before I have a go at this - using Python CGI - it would be great if you could post a link to something similar .

Reply With Quote
  #5  
Old October 8th, 2004, 05:40 AM
ain ain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 49 ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
something like this: http://www.sfgate.com/polls/

Reply With Quote
  #6  
Old October 9th, 2004, 08:35 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
If you can execute dynamic Pages then SVG is probably overkill. But, after messing around with it for a bit I didn't really come up with anything useful/relevent in that area... that is except a function for calculating the length of the precent bar:

Code:
def percentBar(votes, total, length):
    
    #Takes the number of votes for this bar, the 'total' number of votes and
    #the length of the bar and calculates the size of this bar to be drawn.
    
    positiveSize = (votes / total) * length

    #Returns a Tuple containing the actual percentage of votes and the length
    #(as a float) of the two sides; if you're only interested in the positive
    #side of the bar then ignore the third value in this Tuple.

    return ((votes / total) * 100, positiveSize, length - positiveSize)


This was mainly due to not having PIL installed on my system anymore - though I will be changing that later today. Anyway, I'd suggest that you take a look at the PIL module, available from:

http://www.pythonware.com/downloads/index.htm

There is also an article on devshed regarding this (first link), though it doesn't really cover drawing shapes, so you might want to look here aswell (second link):

http://www.devshed.com/c/a/Python/Imagine-Python/
http://www.pythonware.com/library/pil/handbook/

Have fun,

Mark.

Last edited by netytan : October 9th, 2004 at 08:38 AM.

Reply With Quote
  #7  
Old October 9th, 2004, 08:18 PM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
Mark,
Just a small tweak:
Code:
positiveSize = int((votes / float(total)) * length)


The float to make sure you have a non-zero result when integers are passed and the int to round down positiveSize to the nearest pixel.

grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #8  
Old October 10th, 2004, 06:01 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Thanks Grim! I don't know why I didn't think of that .

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > poll - SVG


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT