Re: urlopen exception

2009-01-10 Thread alex goretoy
I would try: site="http://www.bput.org/"; payloads="alert('xss')" attack= urllib2.urlopen(site+payloads,80).readlines() -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Sun, Jan 11, 2009 at 2:49 AM, Steve Holden wrote: > Paul Rubin w

Re: urlopen exception

2009-01-10 Thread alex goretoy
"/usr/local/lib/python2.6/urllib2.py", line 427, in error return self._call_chain(*args) File "/usr/local/lib/python2.6/urllib2.py", line 361, in _call_chain result = func(*args) File "/usr/local/lib/python2.6/urllib2.py", line 510, in http_error_default

Re: File layout in development stage

2009-01-11 Thread alex goretoy
sys.path.append() -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Mon, Jan 12, 2009 at 2:00 AM, Steven Woody wrote: > Hi, > > Adapted your kindly suggestions in a previous post, I now decide to > organize my source tree in a pattern like below: > &g

error: cannot invoke setopt() - perform() is currently running

2009-01-14 Thread alex goretoy
tries to setopt again? Has anyone come across this? Any help in this matter will be highly appreciated, I've spent a week on this and can't seem to figure it out. Googling hasn't brought me any thing except my own codehahaha go figure TIA -- -Alex Goretoy http://www.

Re: error: cannot invoke setopt() - perform() is currently running

2009-01-14 Thread alex goretoy
more info for all: the class I'm trying to use threading on top of called pcrunchly. I've posted it previously on here, but you can find it at this link. http://article.gmane.org/gmane.comp.python.general/604050 How can i make this work with threading Thread? On 1/15/09, alex gore

Re: error: cannot invoke setopt() - perform() is currently running

2009-01-14 Thread alex goretoy
sorry for multi posting It's a habit I have. The closest thing I can come up with is this http://pycurl.cvs.sourceforge.net/viewvc/pycurl/pycurl/examples/retriever-multi.py?revision=1.29&view=markup but how to make this work with pcrunchly and threading Thread? On 1/15/09, alex goret

Re: ifconfig in python

2009-01-19 Thread alex goretoy
ifconfig -a|grep "inet addr"|awk '{print $2}' wget http://myip.dk&&; cat index.html|grep "http://www.alexgoretoy.com somebodywhoca...@gmail.com On Tue, Jan 20, 2009 at 3:42 AM, Дамјан Георгиевски wrote: > Something *like* this could work: > >myip = > urllib2.urlopen('http://whatismyip

PyNutButter BETA 1.0.0 - Automates CSV data Importation into any website http/https and/or mysql database

2009-01-31 Thread alex goretoy
o. If you can please donate or something somehow. Upcoming Features: use of parsed data from more than one file at a time. pyGTK for ease of configuration creation(any help?) gui creation of custom functions automatic form parsing based on given urls in config -Alex Goretoy http://www.alexgoret

reconstruct html form in pyGTK window and create dict from pyGTK

2009-02-05 Thread alex goretoy
ction(filefield2)"} headers = {"filefield1":"somefield","filefield2":"anotherfield"} What would be the best way for me to construct this dict from a user friendly form in pyGTK Sorry this is alot of questions. Any advise on this matter will be greatly appreciated. Thank you. -Alex Goretoy http://www.alexgoretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to host a (Python) project?

2009-02-05 Thread alex goretoy
I use google code. http://code.google.com/p/pynutbutter -Alex Goretoy http://www.alexgoretoy.com On Thu, Feb 5, 2009 at 6:55 PM, Ben Finney < bignose+hates-s...@benfinney.id.au >wrote: > a...@pythoncraft.com (Aahz) writes: > > > In article < > 6dcb8ce5-

Re: Where to host a (Python) project?

2009-02-07 Thread alex goretoy
If you don't mind changing dns entries. You can also use Google App Engine. It's really nice. http://code.google.com/appengine/docs/python/tools/webapp/overview.html -Alex Goretoy http://www.alexgoretoy.com On Fri, Feb 6, 2009 at 1:07 AM, alex goretoy wrote: > I use google

GAE open()

2009-02-08 Thread alex goretoy
deError: 'ascii' codec can't decode byte 0xd0 in position 14: ordinal not in range(128) but when I try to read binary with b, I get IOError. raise IOError('invalid mode: %s' % mode) IOError: invalid mode: b -Alex Goretoy http://www.alexgoretoy.com -- http://mail.python.org/mailman/listinfo/python-list

GAE read binary file into db.BlobProperty()

2009-02-09 Thread alex goretoy
How to read Binary file into GAE(Google App Engine) db.BlobProperty() datastore? -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: GAE read binary file into db.BlobProperty()

2009-02-10 Thread alex goretoy
(urlfetch.Fetch("http://www.example.com/ "+k.image).content) img.rotate(90) jpg_data= img.execute_transforms(images.JPEG) k.image_blob=jpg_data k.put() -Alex Goretoy http://www.goretoy.com On Mon, Feb 9, 2009 at 11:07 AM, alex goretoy wrote: > How to read Binary

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread alex goretoy
GAE (Google App Engine) uses WSGI for webapps. You don't have to overhead of managing a server and all it's services this way as well. Just manage dns entries. Although, there are limitations depending on your project needs of what libs you need to use. appengine.google.com -Alex Go

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread alex goretoy
> > > GAE is definitely not suitable in this case... The servers are >> provided and maintained as part of a large scientific project for >> which I am providing just a few services... Other groups are running >> services in other platforms on tomcat through soaplab/instantsoap - >> but I was hopin

Re: Python Module for console text formatting?

2009-02-18 Thread alex goretoy
I created a little script for doing stdout coloring for me a while back. Maybe this will get you closer to what you are looking for. It's kinda hackish, but it works. http://code.google.com/p/python-stdout-colors/ -Alex Goretoy http://www.goretoy.com On Wed, Feb 18, 2009 at 10:

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread alex goretoy
Thank you for clerification Christian, when using trailing comma with print statement/function, does it not mean to output newline after printed data? -Alex Goretoy http://www.goretoy.com On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes wrote: > Carl Schumann wrote: > > I coul

parsing csv files class

2008-12-27 Thread alex goretoy
Hello All, I have this class that I use in one of my projects. I know it's missing functionality and some things could have been done differently. Can you ehlp me make this class better? What can I do to make it more resistant to error? You can find the stdout_colours class on Google if you want i

Re: parsing csv files class

2008-12-27 Thread alex goretoy
e On Sat, Dec 27, 2008 at 4:54 AM, alex goretoy wrote: > Hello All, > > I have this class that I use in one of my projects. I know it's missing > functionality and some things could have been done differently. Can you ehlp > me make this class better? What can I do to make i

Re: parsing csv files class

2008-12-27 Thread alex goretoy
oon. Thanks for helping me. On Sat, Dec 27, 2008 at 2:15 PM, Gabriel Genellina wrote: > En Sat, 27 Dec 2008 11:02:13 -0200, Gary M. Josack > escribió: > >> alex goretoy wrote: >> > > I know it's messy with all those self.soc.* functions, but it works in one >>

Re: parsing csv files class

2008-12-27 Thread alex goretoy
less error. On Sat, Dec 27, 2008 at 5:18 PM, alex goretoy wrote: > It's main concern is to grab the file into the buffer for use in other > classes. The self.soc.me_him is just so I know when its ENTERING or EXITING > in that function when I run it in terminal. It's pri

how to make a class to get all forms and input fields from webpage

2008-12-27 Thread alex goretoy
Hello All, How do I make a class for retrieving all forms and input fields on a web page. Meaning, form name, form url,all input fields, text,textarea,select,etc...I have something currently and it kinda works. It also kinda works for retrieving all images on webpages. My main concer here is to ma

Re: parsing csv files class

2008-12-27 Thread alex goretoy
same for lower code, where it appends to a dict with header of each column? Thank you. On Sat, Dec 27, 2008 at 5:31 PM, alex goretoy wrote: > I might as well add a UnicodeReader and UnicodeWriter and support for > passing delimiter in from other classes. At the same time. Anyone have a >

Re: parsing csv files class

2008-12-28 Thread alex goretoy
works much better for me. Any other suggestions are appreciated. Thank you. -A On Sun, Dec 28, 2008 at 5:46 AM, Tim Roberts wrote: > "alex goretoy" wrote: > > > >class parsercsvy(object): > >"""Return a line from a csv file or total am

Re: parsing csv files class

2008-12-30 Thread alex goretoy
t. On Mon, Dec 29, 2008 at 6:15 AM, alex goretoy wrote: > Tim, Thank you for your suggestions that you made. I will modify my class > to what you said. I will also remove find_and_replace. seeing as I won't use > it anywhere else. I think I put it there for some test and forgot t

pycurl urllib fallback

2008-12-30 Thread alex goretoy
Hello All, I have this class I like to call pcrunchly. That works to do all my request via libcurl library. What I want to do is add capability for this class to fallback to urllib if pycurl module is not install or is not importable for some reason. I'm posting my whole class. Use it however you

Re: Videocapture in python

2009-01-01 Thread alex goretoy
Can you post your code or a code segment? I would be interested in seeing how this works. On Thu, Jan 1, 2009 at 3:29 AM, wrote: > I face issues in videocapture in python. Cant find anyplace where we > can raise bug reports, so mentioning here. Also help required if > somebody has solved it earl

Re: Creating an application for Linux

2009-01-01 Thread alex goretoy
I found a great video on how to do this last night. I wasn't even looking for it. Check it out. It's really good. Makes me want to start making videos as well. Thanks. Ubuntu: Making a .deb package out of a python program (English) tutorial video - Ubuntu: Making a .deb package out of a python pro

Re: Pass by reference

2009-01-01 Thread alex goretoy
I recently conquered this pass by ref thing. This is how I did it. Python 2.4.3 (#1, Apr 3 2006, 14:02:53) [GCC 3.4.6] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def f1(v): ... v="asdf" ... >>> def f2(v): ... v=["asdf"] ... >>> def f3(v): ...

list iteration if statement

2009-01-02 Thread alex goretoy
Hello All, I'm doing this in my code [[v.append(j) for j in i] for i in self.value] if works and all, but I need to add a if statement in the mix. Can't seem to remember the syntax to do so and everything I've tried seems to fail. How do I add a check to see if j is not int("0") then append to v

Re: Pass by reference

2009-01-02 Thread alex goretoy
example.com/login";, "user":l["user"], "pass":l["pass"] } and it wouldn't work. So I had to do some research on how to make it work. passing a mutable object resolved my problem. Thank you for correcting me. -A On Thu, Jan 1, 2009 at 6:22 PM,

Re: Pass by reference

2009-01-02 Thread alex goretoy
You are correct, terminology is a must. In order to stay on the same page. And yes, it;s not technically by ref. but it works for me at the moment. I was doing this in my code: l={"user":"asdf","pass":"goog"} d= { "login_url":"http://example.com/login";, "user":l["user"], "pass":l["pas

Re: list iteration if statement

2009-01-02 Thread alex goretoy
uys rock, thanks for helping me learn python. On Sat, Jan 3, 2009 at 2:09 AM, Steve Holden wrote: > alex goretoy wrote: > > Hello All, > > > > I'm doing this in my code > > > > [[v.append(j) for j in i] for i in self.value] > > > > if works a

Re: list iteration if statement

2009-01-02 Thread alex goretoy
v should have ['3','4','1'] sorry if I made it confusing. On Sat, Jan 3, 2009 at 2:43 AM, alex goretoy wrote: > rather, how do I suppress the output of the list with all None in it? > > >>> l=[['3'], ['0', '4'], [

Re: list iteration if statement

2009-01-02 Thread alex goretoy
rather, how do I suppress the output of the list with all None in it? >>> l=[['3'], ['0', '4'], ['0', '1'], ['0']] >>> v=[] >>> [[v.append(j)for j in i if j != "0"] for i in l] [[None], [None], [Non

Re: Is there a better algorithm?

2009-01-02 Thread alex goretoy
I personally like this solution the best. Thanks mr. tuples = [(1, 2), (3, 4, 5), (6, 7)] def triple_or_pair(seq): u = None try: k, u, v = seq except ValueError: k, v = seq return k, u, v for k, u, v in [ triple_or_pair(seq) for seq in tuples ]: print k, u, v On Sat

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread alex goretoy
for each his own. Any more word on userio? On Sat, Jan 3, 2009 at 6:14 PM, Russ P. wrote: > On Jan 2, 10:50 pm, Ben Finney > > > > wrote: > > s0s...@gmail.com writes: > > > On Jan 2, 7:20 pm, Ben Finney > > > > > > > > wrote: > > > > They don't need to be creative; they merely need to confo

Re: simple turn-based multiplayer game via TCP server/client

2009-01-03 Thread alex goretoy
Since we are on the subject of Rock, Paper, Scissors. I've recntly watched this one video on how to make a .deb out of .py files and the tutor was using a rock, paper scissors game. Not sure how this may come of use to you but, I'll post it anyway for you to look at. May help somehow. http://www.

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread alex goretoy
My gmail did that. FYI, it wasn't intentional. А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я Paula Poundstone - "I don't have a bank account because I don't know my mother's maiden name." On Sun, Jan 4, 2009 at

Re: math module for Decimals

2009-01-04 Thread alex goretoy
sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 ^ SyntaxError: invalid syntax Although, It may be only because I ran it through python 2.4.3 Thanks for quick response, I wasn't expecting so quick. :) On Sun, Jan 4, 2009 at 10:21 AM, Mark Dickinson wrote: > On Jan 4, 9:52 am

Re: math module for Decimals

2009-01-04 Thread alex goretoy
I've been watching this thread for couple days now. I followed the bug report and all that stuff. It's very interesting to me how you guys talk about this stuff. I like it alot. I a new guy to python, just fyi. I'm one of my current projects I'm using Decimal as well and I think it be a huge pain i

Re: deleting a method

2009-01-04 Thread alex goretoy
HAHAHAHA, I like your sig Ben. So much that I blogged about it. starnixalpha.blogspot.com Oh yeah, and the info on this thread was helpful. Thanks, -A А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я On Sun, Ja

Re: Python training in Colorado, January 27-30

2009-01-04 Thread alex goretoy
I'd be interested in attending if you make it to Tulsa,OK. Are your courses only in Colorado? -Alex Goretoy http://www.alexgoretoy.com On Sun, Jan 4, 2009 at 7:29 PM, Mark Lutz wrote: > Python author and trainer Mark Lutz will be teaching a 4-day > Python class on January 27-30,

Re: Package / Module Hierarchy question

2009-01-04 Thread alex goretoy
You might try this in qwe.py import os,sys sys.path.append(os.getcwd()+"../") This will allow you to then import modules from module(dir). Hope this helps. OTOH, there maybe a better solution. -Alex Goretoy http://www.alexgoretoy.com On Sun, Jan 4, 2009 at 9:10 PM, Torsten Mohr wr

threading a 10 lines out of a file

2009-01-04 Thread alex goretoy
works on 10 at the same time. How would I achieve something like this in my program? Can someone please recommend something for me. I would greatly appreciate. My program would appreciate it too, seeing as it will be multi-threaded :) Thank you for your help. -Alex Goretoy http://www.alexgoretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: threading a 10 lines out of a file

2009-01-04 Thread alex goretoy
anyone. I like to get as much info from as many places as possible and compare. This way I think I may have a better solution for a problem. Plus people that Google will find this post or any words in it. Any more information on threading a for loop would be greatly appreciated. TIA -Alex Go

Re: Python training in Colorado, January 27-30

2009-01-05 Thread alex goretoy
lease help me some how to achieve this goal. I want people to really harness the true power of there computer and stop eating BS for applications and development environments. If there is more sand, then there's more sand castles, holes and fun. Why would someone want to pass up the ability to use

Re: math module for Decimals

2009-01-05 Thread alex goretoy
> > Hmm. Maybe we shouldn't be using this syntax in from_float, if it's > the only thing that prevents the trunk version of decimal.py from > being used with Python 2.4. On the other hand, from_float isn't > going to work until 2.7 anyway, since it uses a whole bunch of > new stuff: as_integer_r

Re: threading a 10 lines out of a file

2009-01-05 Thread alex goretoy
than that would be great. TIA for all your help. -Alex Goretoy http://www.alexgoretoy.com On Mon, Jan 5, 2009 at 6:13 PM, Steve Holden wrote: > re, however, that the CPython implementation won't net you any > benefit if all threads are CPU-bound, since due to something called t

Re: threading a 10 lines out of a file

2009-01-05 Thread alex goretoy
esn't run on SMP but maybe one day. I also need to look into how to make a python package out of it. I researched some stuff awhile ago, but I didn't quite need it then. I just wanted to see what I'm getting into. Any other stuff about this would be appreciated to. Although of top

Re: multiprocessing vs thread performance

2009-01-05 Thread alex goretoy
about How the thread starts or a for loop. -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Sat, Jan 3, 2009 at 1:31 PM, Nick Craig-Wood wrote: > mk wrote: > > After reading http://www.python.org/dev/peps/pep-0371/ I was under > > impression that perfo

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread alex goretoy
Have you looked into scapy? www.secdev.org/projects/*scapy*/ There's another one, it comes with python I think. Can't seem to remember the name. I may be mistaken though. -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Mon, Jan 5, 2009 at 11:23 PM, Kangkook

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread alex goretoy
+1 for ubuntu -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Tue, Jan 6, 2009 at 12:39 AM, wrote: > Hi, > > I would have to put in a vote for Ubuntu. > > There seems to be a working ubuntu package for most of the things that I > have tried. Instead

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread alex goretoy
utput, either logged to pcap output file or by other means. -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Mon, Jan 5, 2009 at 8:14 PM, Grant Edwards wrote: > On 2009-01-05, Kangkook Jee wrote: > > > I'd like to measure number of bytes sent(or recv

Re: Is there a better algorithm?

2009-01-05 Thread alex goretoy
#x27;age', 18), entry('pic', picture_data, > 'path/to/file')] Gabriel thank you for this. I just now realized I've being doing things the hard way. :) -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Mon, Jan 5, 2009 at 8:58 PM, Gabriel Genellina wro

Re: math module for Decimals

2009-01-06 Thread alex goretoy
}) = 0 mmap2(NULL, 15588, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb7f2b000 mmap2(0xb7f2e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x2) = 0xb7f2e000 close(4)= 0 close(3) = 0 It's probab

Re: python is great

2009-01-06 Thread alex goretoy
otancohen.com to that they will > be publicaly accessible. > Any more news on this research? -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Tue, Jan 6, 2009 at 9:24 PM, Mike Driscoll wrote: > On Jan 6, 2:24 pm, Joe Strout wrote: > > M.-A. Lemburg wrote: &g

Re: Why does numpy.array(a[0],b[0]) have this meaning?

2008-11-02 Thread alex goretoy
just a shot in the dark. second arg to numpy.array is of type see numpy.array.__doc__ -nop On Mon, Nov 3, 2008 at 1:26 AM, Rick Giuly <[EMAIL PROTECTED]> wrote: > Hello All, > > Case 1 > This generates an error, which makes sense because the argument should > be a list of numbers: > numpy.arr

[PyGTK] Singleton Window

2009-03-05 Thread alex goretoy
de()) self.singleton_child_window.connect("delete_event", lambda w,e: self.singleton_child_window.hide()) self.vbox = gtk.VBox(False, 0) self.singleton_child_window.add(self.vbox) self.vbox.show() self.label = gtk.Label("SINGLETON") self.vbox.pack_start(self.label

Re: [PyGTK] Singleton Window

2009-03-05 Thread alex goretoy
Correction, it's not True singleton..... -Alex Goretoy http://www.goretoy.com On Thu, Mar 5, 2009 at 10:38 PM, alex goretoy wrote: > Hello All, > > I am trying to create a singleton window in pygtk and for the life of me > can't seem to figure out a better way to go abo

__import__ with dict values

2009-03-12 Thread alex goretoy
th']]) and how come does above line doesn't give me diff value than below line? d['syspath']=__import__(d['sys']) Meaning, when I do this doesn't work. Which makes sense. d['syspath']() d['syspath'].d['path'] but this works both with fromlist and without. d['syspath'].path -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
I have resolved this problem in my code. It has something to do with your current working directory when you append cwd/jars to sys.path and try to import from interactive console -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 4:58 AM, alex goretoy wrote: > How would I imp

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
yay, no more exec ("import " + "sys") in my code -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:42 AM, alex goretoy wrote: > I have resolved this problem in my code. It has something to do with your > current working directory when you append cwd/j

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
or eval for that matter -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:43 AM, alex goretoy wrote: > yay, no more > > exec ("import " + "sys") > > in my code > > -Alex Goretoy > http://www.goretoy.com > > > > On Thu, Mar

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
note i would still like to be able to do __import__("sys")."path" maybe if __import__ had __str__ defined, How is my thinking on this? and how would I achieve something like this? -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:44 AM, alex goretoy wrote:

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
__import__(opt['imp_mod']).options eval(opt['imp_mod']+"."+opt['imp_opt']) how to make top work like bottom? -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:56 AM, alex goretoy wrote: > note i would still like to be able to do __imp

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
t site_name and files_name, also many other variable that overwrite the configuration that is set from the jar.properties This was working when I was using exec and eval. I was not able to just use exec I had to use exec on import and eval on module.module it was wierd, can someone tell me why? -Al

Re: __import__ with dict values

2009-03-13 Thread alex goretoy
;,""),getattr(B,x)) for x in dir(B) if x.startswith("b_") ) ) -Alex Goretoy http://www.goretoy.com On Fri, Mar 13, 2009 at 1:46 AM, Lie Ryan wrote: > Gabriel Genellina wrote: > >> En Thu, 12 Mar 2009 09:27:35 -0200, alex goretoy < >> aleksandr.

Re: __import__ with dict values

2009-03-14 Thread alex goretoy
e(["FUNC NOT FOUND:",pfhpv[pfhpvi],self._pfmp[pfhpv[pfhpvi]]],'red') #if self._pfmp[pfhpv[pfhpvi]]== pfhp: self.opt['data']['defaults'][optv][optvvv]=self.value self.last_item=self.val

Re: __import__ with dict values

2009-03-14 Thread alex goretoy
I'm actually still getting to this section of my code, I've been working a logging,stdout colors lately, Although I am going to need __import__ in several places in this program -Alex Goretoy http://www.goretoy.com On Sat, Mar 14, 2009 at 3:05 AM, alex goretoy wrote: > I d

Re: __import__ with dict values

2009-03-14 Thread alex goretoy
I can show you people more code if you want :) I like to learn -Alex Goretoy http://www.goretoy.com On Sat, Mar 14, 2009 at 3:09 AM, alex goretoy wrote: > I'm actually still getting to this section of my code, I've been working a > logging,stdout colors lately, Although I

Re: __import__ with dict values

2009-03-14 Thread alex goretoy
as smoked during the making #list( ( self.__setattr__(x.replace("b_",""),getattr(B,x)) for x in dir(B) if x.startswith("b_") ) ) for smoke in dir(crack): if smoke.startswith("b_"): setattr(self, smoke[2:], getattr(crack,

Re: converting a string to a function parameter

2009-03-14 Thread alex goretoy
""" me - determines current function prepends class name, takes value=__name__,color="" """ #self.frames() value="".join(str(value)) + "." + "".join(sys._getframe(1).f_code.co_name) sel

Re: converting a string to a function parameter

2009-03-14 Thread alex goretoy
This is a file that is going into the new version of python-stdout-colors > project location: > http://code.google.com/p/python-stdout-colors/ -Alex Goretoy http://www.goretoy.com On Sat, Mar 14, 2009 at 10:45 AM, alex goretoy wrote: > My new class I've been working on migh

how to repeat function definitions less

2009-03-14 Thread alex goretoy
self.write(value,color,level) def write(self,value,color="red",level="INFO"): """ write - output message,take value string or list,color="" """ self._hero(value,color,level) -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: how to repeat function definitions less

2009-03-14 Thread alex goretoy
ions[1] is not "": self.opt['properties']['imp_opt'] = "".join(__options[1]) self.soc.debug( "%s"%("args imp_opt: ",self.opt['properties']['imp_opt']) ) #XXX#13

Re: how to repeat function definitions less

2009-03-14 Thread alex goretoy
ite_names'], "jar_name":["j","jar",'jars','jar_name','jar_names'], ... } Once again, I haven't been sleeping regularly latelyworking on pynutbutter 24/7...Thanks for all your help -Alex Goretoy http://www.goretoy.com On

Re: how to repeat function definitions less

2009-03-14 Thread alex goretoy
sweet, I've been wondering how those work. I've read some stuff about them and still doesn't make sense to me. Why would I want to use itPlease explain, thank you -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 1:05 AM, Michele Simionato < michele.simion..

suggestion for python function calling

2009-03-14 Thread alex goretoy
ons later duck().().() or fuck(().()) or something like that, I'mma go to sleep nowI think this way it might the language even stonger, but who knows, what do you all think? Not trying to make it like ruby, just more options to the interpreter, and syntax styles -Alex Goretoy http://www

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
basically import os def quacks(self,value): return (1,0)[value] _aduck="~/goose" duck = if os.path.exists quacks str(_aduck) duck()() or does this get in the way with some other pre-existing syntax interpretation implementations? -Alex Goretoy http://www.goretoy.com On Sun, Ma

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
s that return something though, I believe -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 2:08 AM, alex goretoy wrote: > import os > def quacks(self,value): > return (1,0)[value] > _aduck="~/goose" > duck = if os.path.exists quacks str(_aduck)

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
or use . (dot) where variable and () (parans) where function duck()(). or duck.().() or for long sentences duck.[].()()... using dot seperator or double dot separator for application where its currently not being used, but for syntax errors -Alex Goretoy http://www.goretoy.com On Sun, Mar 15

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
maybe this is like decorators -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 2:20 AM, alex goretoy wrote: > or use . (dot) where variable and () (parans) where function > > duck()(). > or > duck.().() > or > for long sentences > duck.[].()()... > >

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
r_names'], "options":{ "src_name":["ss","src","source"], "mod_name":['m',"mod",'mods',"module","modules"], } -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 10:51 AM, MRAB wrote: > d={ >>"site_name":["s","site",'sites','site_name','site_names'], >>"jar_name":["j","jar",'jars','jar_name','jar_names'], > > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
this means i have to check if d[i] is list or dict and iterate over properties -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 1:03 PM, alex goretoy wrote: > I will also actually need to nest it like so > > d={ >"site_name":["s","site&qu

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
FO": > self._hero(x,y,z) ) > Thanks to all of you for helping me learn python -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 1:05 PM, alex goretoy wrote: > this means i have to check if d[i] is list or dict and iterate over > properties > -Alex Goretoy > htt

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
Michele I tried your way but I dont seem to have a good grasp on the concept yet, will read up more for now I think I will try to make it work same way as colors only with decorator as def inside def instead of @, that doesn't make sense quite yet -Alex Goretoy http://www.goretoy.com O

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
on","options"], "imp_set":['s','ss',"sss","set","setting","settings"], "imp_files":["f","fn",'file','files','filename','filenames','file_name&#x

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
self.opt['properties'][k])) elif a is "download_files": if b is not "": if bool(b): print ("\nDOWNLOAD FILES",b) self.opt[&#

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
['properties'].keys(): self.opt[i] = getattr(self.opt['properties_object'], i) but not like this: for i in self.opt['properties'].keys(): setattr(self, opt[i], getattr(self.opt['properti

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
what is I just set "colors": self.opt['arg_opts_options']['imp_colors'] then they are both pointing to the same place, correct? -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 11:16 PM, alex goretoy wrote: > i did this because this will read colo

Re: A request (was: how to repeat function definitions less

2009-03-16 Thread alex goretoy
sorry, I'll try to keep it cool -Alex Goretoy http://www.goretoy.com On Mon, Mar 16, 2009 at 2:08 AM, Dennis Lee Bieber wrote: > On Sun, 15 Mar 2009 23:18:54 -0500, alex goretoy > declaimed the following in > gmane.comp.python.general: > > > what is I just set

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread alex goretoy
> > print(10 + 20 % 7) > a bug or a feature? It is a feature print ((10+20) % 7) -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: How do I add elements to **kwargs in a function?

2009-03-16 Thread alex goretoy
y in other: if key not in self: self[key] = other[key] -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

cool things you can do with dict

2009-03-16 Thread alex goretoy
: {}} >>> print a.b.c.__dict__ {'default': None, 'z': 3} >>> print a.b.c.z 3 >>> print a.b.c {} >>> a.b.b=peanutsdict() >>> class pdict(dict): pass ... >>> a.b.b.a=pdict() >>> a.b.b {} >>> a.b.b.__dict__ {'de

Re: having a function called after the constructor/__init__ is done

2009-03-16 Thread alex goretoy
__del__ I use it to close a mysql connection -Alex Goretoy http://www.goretoy.com E. B. White - "Be obscure clearly." On Mon, Mar 16, 2009 at 10:11 PM, thomas.han...@gmail.com < thomas.han...@gmail.com> wrote: > Hi all, > > We've been breaking our heads over

Re: Lambda forms and scoping

2009-03-20 Thread alex goretoy
tion, same as rename function a() #bind call to address space hope this helps -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: precision question

2009-03-20 Thread alex goretoy
I think you are looking for this: >>> (math.pi - (math.sqrt(math.pi)))**2 1.8745410610157363 >>> simple, multiplication and division have a higher precedence over addition and subtraction -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python worth learning as a second language?

2009-03-20 Thread alex goretoy
ou can use it too, so that adds to how powerful it is. -Alex Goretoy http://www.goretoy.com Samuel Beckett - "Birth was the death of him." 2009/3/20 Tomasz Rola > On Thu, 19 Mar 2009, Aahz wrote: > > > --===0027953262== > > > > In article <49

  1   2   >