RE: Function Defaults - avoiding unneccerary combinations of arguments at input

2015-03-26 Thread Ivan Evstegneev
nneccerary combinations of > arguments at input > > On Thu, 26 Mar 2015 04:43 am, Ivan Evstegneev wrote: > > > Hello all , > > > > > > Just a little question about function's default arguments. > > > > Let's say I have this function: > > >

How to reassign the value of the variable on runtime?

2015-08-27 Thread Ivan Evstegneev
* But in this case I have some warning about "shadowing" I can know that I shadow outerscope variables but how can I achieve my goal other way? Tried __init__.py and other 10-20 things but still stuck with it, I'm sure this is because the lack of experience. Hope my situation is clear enough ^_^ Tried my best. Again thanks a lot for a help. Ivan. -- https://mail.python.org/mailman/listinfo/python-list

RE: How to reassign the value of the variable on runtime?

2015-08-27 Thread Ivan Evstegneev
8/27/2015 12:25 PM, Ivan Evstegneev wrote: >> Can some please (I mean very please) explain me how do I reassign > >"engine_object" and "meta_object" variables, so they would store(point > >to) a new connection objects of my database, while other functions >

RE: How to reassign the value of the variable on runtime?

2015-08-29 Thread Ivan Evstegneev
:46 AM, Ivan Evstegneev wrote: > It looks like, when the module is loaded (imported) for the first > time, all the functions that are defined within it and using a global > varialbles as their defaults, they would keep the first value of this globals. That's correct. When you def

Re: How to support a non-standard encoding?

2012-01-06 Thread Ivan Uemlianin
Dear Tim Thanks for your help. > If your system version of iconv contains that encoding, ... Alas, it doesn't: $ iconv -l |grep 6937 $ Also, I'd like to package the app so other people could use it, so I wouldn't want to depend too much on the local OS. Best wi

__class__ and type() implementation details in CPython

2013-02-10 Thread Ivan Yurchenko
ass associated with each PyObject - _typeobject struct, which is used to identify the class by type(). Am I right? Thank you. - Ivan Yurchenko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using XML w/ Python...

2005-12-11 Thread Ivan Herman
Look at the standard python library reference http://docs.python.org/lib/dom-example.html the handleSlide function almost does what you want, except that you should use 'parse' and not 'parseString'. Original Message From: "Jay" <[EMAIL PROTECTED]> To: Subject: Re:Using XML w

python configuration problems

2005-12-13 Thread ivan . pavlov
I am running Debian/Linux unstable. Trying to upgrade packages depending on python (via aptitude) has started to give errors and leaves all packeges unconfigured. When I run dpkg --configure pyhton2.3 the following errors occur. Any advice on what to do? Setting up python2.3 (2.3.5-8) ... Compili

Re: python configuration problems

2005-12-13 Thread ivan . pavlov
I solved the problem myself. Just removed the folder where the errors were occuring. Don't know how it came to exists in the first place though. Now everything seems to work fine, for now... -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-13 Thread Ivan Voras
Lawrence Oluyede wrote: > Python *does* have GUI, you only have to decide which one you prefer. > > ps. the customer wants Windows as a platform, we develop on Linux using > PyGTK, postgre and sql server for some old data. This is the true power of > cross-platform :) Maybe the OP really wants a

Re: Still Loving Python

2005-12-13 Thread Ivan Voras
Mike Meyer wrote: >>A GUI builder is more pleasant to work with, at least >>with a good one like Delphi or Qt designer. > > That is your opinion, and I'm sure it's true for you. It isn't true > for me. Not trying to start a war here, but I consider this discussion something like using regular e

Re: suppress pyc generation

2005-12-25 Thread Ivan Herman
There is a simple, though slightly ugly trick: if the directory where the python module resides, is not writable to the python process, the python runtime will silently ignore .pyc generation (as far as I know). It is not elegant, but it works... Ivan Original Message From

Re: suppress pyc generation

2005-12-25 Thread Ivan Herman
There is a simple, though slightly ugly trick: if the directory where the python module resides, is not writable to the python process, the python runtime will silently ignore .pyc generation (as far as I know). It is not elegant, but it works... Ivan Original Message From

ANN: xmldict 1.1

2005-12-28 Thread Ivan Voras
As it seems that few people are actually using this, I've made a small update to xmldict library, available here: http://ivoras.sharanet.org/xmldict.py.gz Some border-cases involving empty tags and atributes are resolved, and examples are updated. WHAT IS IT -- It's a very small (8KB,

Re: Multiway Branching

2006-01-08 Thread Ivan Voras
[EMAIL PROTECTED] wrote: > inefficient. Since these data are coming from an OMR scanner at 9600 bps (or > faster if I can reset it programmatically to 38K over the serial cable), I > want a fast algorithm. It depends on your actual environment, of course, but 38kbps is usually not considered "fa

Variables and none?

2006-01-20 Thread Ivan Shevanski
ame time to use it. . .Would I just have to catch the error, or could I have python look for the variable beforehand? Thanks,-Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables and none?

2006-01-20 Thread Ivan Shevanski
On 1/20/06, Ivan Shevanski <[EMAIL PROTECTED]> wrote: Alright first of all I'd like to say I'm a python noob.Now that thats over with, heres what I'd like to know about.  Is there a python way to detect if a variable exsists?  Say I had a program that needed a certain variable

Re: PyXML: SAX vs. DOM

2006-01-21 Thread Ivan Herman
ot the ideal answer, but maybe it helps... Ivan -- http://mail.python.org/mailman/listinfo/python-list

When writing text. . .

2006-07-14 Thread Ivan Shevanski
n=C:\windows\aawin.bat')I expected that to work, but instead of C:\windows\aawin.bat I get run=C:\windowsawin.bat. . .I assume /a is a code for  like /n is for a newline, is there a way to fix this? Thanks in advance,-Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: When writing text. . .

2006-07-24 Thread Ivan Shevanski
On 7/14/06, Gerhard Fiedler <[EMAIL PROTECTED]> wrote: On 2006-07-14 18:05:56, Ivan Shevanski wrote:> Hey I'm pretty new to python and I have a question.  I'm trying to write:> "[BOOT]> run=C:\windows\aawin.bat">> in my win.ini > So I went about it like

Re: Why do this?

2006-10-05 Thread Ivan Voras
Duncan Booth wrote: > print "There are"+number+"ways to skin a"+furryanimal > > or at least something equivalent to it. If I try to make the same mistake > with a format string it jumps out to me as wrong: > > "There are%sways to skin a%s" % (number, furryanimal) Related to this, formatting wi

subprocess cwd keyword.

2006-10-26 Thread Ivan Vinogradov
nit__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/subprocess.py", line 1051, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory perhaps if subprocess would indicate the abs path of the object in question I could figure it out, but as is I'm lost. -- Cheers, Ivan. -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess cwd keyword.

2006-10-27 Thread Ivan Vinogradov
On 27-Oct-06, at 2:25 AM, Leo Kislov wrote: > > Ivan Vinogradov wrote: >> ... >> >> call("core/main") works but uses .. of core for input/output. >> >> call("core/main",cwd="core") and call("main",cwd="core") b

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-30 Thread Ivan Zuzak
gmax2006 wrote: > Hi, > > I use RedHat linux. > > How can I find where exactly the current python script is running? Hi, Doesnt __file__ attribute of each module contain the full filepath of the module? So, try this: filepath = __file__ print filepath Works for me :) Cheers, i. zuzak -- htt

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-31 Thread Ivan Zuzak
and "module" in different contexts, while I use them as: script = module = file. I can't say which is right, though :). Cheers, ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python on a 64-Bit OS

2006-09-19 Thread Ivan Voras
Nico Grubert wrote: > Is there anything special I have to care about or is installing Python > on a 64 Bit OS just as easy as installing it on a 32-Bit OS? It is as easy. Look around, you'll probably find a pre-built binary package for your OS. -- http://mail.python.org/mailman/listinfo/python

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Ivan Voras
Ramdas wrote: > Well, > > I need to add users from a web interface for a web server, which runs > only Python. I need to add users, set quotas and in future even look at > managing ip tables to limit bandwidth. > > I know os.system(), but this has to be done through a form entry > through a web i

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Ivan Voras
Sebastian 'lunar' Wiesner wrote: > Carsten Haese <[EMAIL PROTECTED]> typed >> I don't think that that has anything to do with Linux or not. The >> script is not the actual executable, hence its suid bit is irrelevant. > > I don't think so. From what I know, the script is passed as executable > to

wxWindows off-screen?

2007-01-05 Thread Ivan Voras
Is it possible to draw a widget or a window in an off-screen buffer? What I'm trying to do is capture rendered HTML to a bitmap (in other words, something like html2bitmap) by using wxWindows' HTML widget. If anyone has a different way of doing it, I'd be glad to hear it... -- http://mail.python.o

Loop exception catching

2006-01-23 Thread Ivan Shevanski
avail:     try:    x = input("> ")    except SyntaxError:    while SyntaxError:    print "Please enter only the number beside your choice"    print     x = input("> "). . .Any suggestions?Thanks in advance,-Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop exception catching

2006-01-24 Thread Ivan Shevanski
t "explain the problem here"Cheers,AldoThanks, that seems to work fine.  But about your other comment. . . >Well, leaving aside the merits of using "input" (which should be avoided at all>costs)What do you mean?-- -Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop exception catching

2006-01-25 Thread Ivan Shevanski
On 1/25/06, Ivan Shevanski <[EMAIL PROTECTED]> wrote: On 1/25/06, Fredrik Lundh < [EMAIL PROTECTED]> wrote: Aldo Cortesi wrote:> > What do you mean?>> Well, the problem with "input" is that it allows the user to supply an> arbitrary Python _expression_, whi

Re: Using non-ascii symbols

2006-01-27 Thread Ivan Voras
Robert Kern wrote: > On OS X, > > ≤ is Alt-, > ≥ is Alt-. > ≠ is Alt-= Thumbs up on the unicode idea, but national keyboards (i.e. non-english) have already used almost every possible not-strictly-defined-in-EN-keyboards combination of keys for their own characters. In particular, the key com

Re: writing large files quickly

2006-01-27 Thread Ivan Voras
Steven D'Aprano wrote: > Isn't this a file system specific solution though? Won't your file system > need to have support for "sparse files", or else it won't work? Yes, but AFAIK the only "modern" (meaning: in wide use today) file system that doesn't have this support is FAT/FAT32. -- http://m

Re: writing large files quickly

2006-01-28 Thread Ivan Voras
Jens Theisen wrote: > Ivan wrote: >>Yes, but AFAIK the only "modern" (meaning: in wide use today) file >>system that doesn't have this support is FAT/FAT32. > > I don't think ext2fs does this either. At least the du and df commands > tell something d

Re: Using non-ascii symbols

2006-01-28 Thread Ivan Voras
Rocco Moretti wrote: > Could it be APL? No, it was much newer... someone did it as a hobby language. -- http://mail.python.org/mailman/listinfo/python-list

Re: writing large files quickly

2006-01-28 Thread Ivan Voras
Jens Theisen wrote: > cp bigfile bigfile2 > > cat bigfile > bigfile3 > > du bigfile* > 8 bigfile2 > 1032bigfile3 > > So it's not consumings 0's. It's just doesn't store unwritten data. And I Very possibly cp "understands" sparse file and cat (doint what it's meant to do) doesn't :

Re: would it be feasable to write python DJing software

2006-02-02 Thread Ivan Voras
Levi Campbell wrote: > Hi, I'm thinking about writing a system for DJing in python, but I'm > not sure if Python is fast enough to handle the realtime audio needed > for DJing, could a guru shed some light on this subject and tell me if > this is doable or if I'm out of my fscking mind? Any and al

Re: would it be feasable to write python DJing software

2006-02-03 Thread Ivan Voras
[EMAIL PROTECTED] wrote: > Actually, manipulating and mixing audio samples can be both fast and > elegant, in Python, if you use Numeric or a similar library. ... at which point you're actually doing it in C, not pure python... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: would it be feasable to write python DJing software

2006-02-03 Thread Ivan Voras
Fuzzyman wrote: > Only in as much as doing anything in Python is *really* doing it in C, > surely ? > > Come to that, you're **really** doing it in machine code... I've yet to see someone calling if a == '5': print "it's 5" machine code. It's the distinction on which level the program's l

Re: would it be feasable to write python DJing software

2006-02-03 Thread Ivan Voras
Grant Edwards wrote: > On 2006-02-03, Ivan Voras <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Actually, manipulating and mixing audio samples can be both fast and >>>elegant, in Python, if you use Numeric or a similar library. >> &g

Re: would it be feasable to write python DJing software

2006-02-03 Thread Ivan Voras
Terry Hancock wrote: > To me, "doing it in C" implies that I must write some C > code. Ok, perhaps it is a bit imprecise :) > In this case, that won't be required at all. Everything the > OP wants to do can be done exclusively by writing Python > code. He will, of course, be *using* some exten

Re: would it be feasable to write python DJing software

2006-02-04 Thread Ivan Voras
Fredrik Lundh wrote: > > uhuh? so why did you just argue that > > if foo.bar(): > bar.aba() > > means "doing it in C" if bar and aba happens to be parts of an extension > library ? Because "bar and aba happen to be parts of extension library" :) -- http://mail.python.org/mailman/

Re: would it be feasable to write python DJing software

2006-02-04 Thread Ivan Voras
Ivan Voras wrote: > Because "bar and aba happen to be parts of extension library" :) To end this disussion: I meant "doing it in C" as a colloquial expression, not a technical one. The expression holds true for every case where a function/class/module/etc is imple

Re: Thread imbalance

2006-02-04 Thread Ivan Voras
Tuvas wrote: > waits for a lul in the computing process. How can I ensure that this > does not happen? This thread uses little processing power, so it could > be set to a high priority, if there is a way to do this. Thanks! Python is bad for concurrently executing/computing threads, but it shoul

Re: Thread imbalance

2006-02-05 Thread Ivan Voras
Peter Hansen wrote: > Ivan, what makes you say that Python is bad for threads? Did the > qualifcation "concurrently executing/computing" have some significance > that I missed? Because of the GIL (Giant interpreter lock). It can be a matter of opinion, but by "good

Re: Learning Python

2006-02-05 Thread Ivan Shevanski
On 2/5/06, Ivan Shevanski <[EMAIL PROTECTED]> wrote: On 2/5/06, Florian Nykrin <[EMAIL PROTECTED] > wrote: Hi Byte!Your code should look like this:x = raw_input('Please enter your name: ')if x == 'myself': print 'OK' Because myself should be a string

Re: Learning Python

2006-02-05 Thread Ivan Shevanski
On 2/5/06, Ivan Shevanski <[EMAIL PROTECTED]> wrote: On 2/5/06, Ivan Shevanski <[EMAIL PROTECTED] > wrote: On 2/5/06, Florian Nykrin <[EMAIL PROTECTED] > wrote: Hi Byte!Your code should look like this:x = raw_input('Please enter your name: ')if x == 'my

Re: Thread imbalance

2006-02-05 Thread Ivan Voras
Neil Hodgson wrote: >Lua has coroutines rather than threads. It can cooperate with > threading implemented by a host application or library. I mentioned it because, as far as I know the Lua's intepreter doesn't do implicit locking on its own, and if I want to run several threads of pure Lu

Re: Thread imbalance

2006-02-05 Thread Ivan Voras
Aahz wrote: > > When did Perl gain threads? At least in 2001: http://mail.python.org/pipermail/python-dev/2001-August/017079.html http://www.xav.com/perl/lib/Pod/perlthrtut.html > If you read Bruce Eckel, you also know that > the Java threading system has been buggy for something like a decade

Re: Thread imbalance

2006-02-05 Thread Ivan Voras
Dennis Lee Bieber wrote: > FYI: That's GLOBAL Interpreter Lock Yes, sorry about the confusion. -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and memory

2006-02-07 Thread Ivan Voras
Lee Leahu wrote: > However, I have encountered the following error after I have started my 381st > thread: This number (actually, ~380) is suspicious when seen with threads because it almost always means running out of process address space. As threads are part of a single process, and that pr

Re: Pythonic gui format?

2006-02-13 Thread Ivan Voras
Gregory Petrosyan wrote: > I have to write _simple_ gui library, for embedding into game. My > first attempt was to use XML ... > But after reading "Python Is Not Java" > http://dirtsimple.org/2004/12/python-is-not-java.html (BTW I'm not a > Java programmer) I realised that it is actually not

Re: Pythonic gui format?

2006-02-15 Thread Ivan Voras
James Stroud wrote: > The reasons given in the blog were fairly precise. I think "only on > vague[...]" is misleading here. The idea of the article was to educate a > Java user how to change his or her frame of reference to better use Python. > > The author was not being territorial as you are

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-23 Thread Ivan Shevanski
. are you sure there is no floppy disk in your floppy drive?   8. are you sure your CPU/motherboard/RAM is not overheating? Claudio--http://mail.python.org/mailman/listinfo/python-listSo what exactly does the loop do? Try running the loop without sleep and then see how long that takes. -- -Ivan --

Re: So many things that need to be decided....

2005-05-03 Thread Ivan Voras
Heather Stovold wrote: > I still need to decide on a database I've really only used Access, > and my SQL skills aren't that great. It would also need to be free As many others have suggested, if you're comming from Access, SQLite or Gadfly would probably be good starting points, b

Re: Py2Exe security

2005-05-03 Thread Ivan Voras
Grant Edwards wrote: > On 2005-05-03, mahasamatman <[EMAIL PROTECTED]> wrote: >>password = pasword.decode("base64") > > That will delay the attacker for a few minutes. True, but a script kiddie that only knows about the 'strings' program will be forever baffled :) Though deprecated, I think the

wxPython custom list drawing?

2005-05-04 Thread Ivan Voras
Does wxPython (actually, the wx toolkit) support setting up ListCtrls or similar to allow custom element drawing? Something like generating an 'OnPaint()' event in which I could paint whatever I like in a listbox element. (example from some other toolkits) -- http://mail.python.org/mailman/list

Re: Encryption with Python?

2005-05-06 Thread Ivan Voras
Blake T. Garretson wrote: > I want to save some sensitive data (passwords, PIN numbers, etc.) to > disk in a secure manner in one of my programs. What is the > easiest/best way to accomplish strong file encryption in Python? Any > modern block cipher will do: AES, Blowfish, etc. I'm not looking

Re: stop a thread safetely

2005-05-13 Thread Ivan Voras
Peter Hansen wrote: > call to recv() does not guarantee that the full 608 bytes of data is Does read() have that guarantee? -- http://mail.python.org/mailman/listinfo/python-list

Resizing VListBox on parent (wxPython)

2005-05-15 Thread Ivan Voras
I hava a hierarhical sizer layout in which there's a panel in the upper part of a window with some buttons, and another panel with wxVListBox that's meant to occupy all the remaining space in the window. Both panels are put inside a vertical BoxSizer, and the VListBox in its panel is also in Bo

Re: Resizing VListBox on parent (wxPython)

2005-05-16 Thread Ivan Voras
Ivan Voras wrote: > - panel, vertical BoxSizer > - a single VListBox Forgot to mention it - I'm using wx.GROW flag on both of them. -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing VListBox on parent (wxPython)

2005-05-16 Thread Ivan Voras
Solved - I didn't know the importance of "proportion" parametar. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows distribution suggestions?

2005-05-17 Thread Ivan Voras
Paul Rubin wrote: >>your active code is then in some library.zip shared between the >>three, and you need never change alice.exe, bob.exe, and carol.exe > > I think I understand what you're saying and it sounds like a very > good idea. Thanks. One thing about updating files - sorry if I'm stati

processing a large utf-8 file

2005-05-20 Thread Ivan Voras
Since the .encoding attribute of file objects are read-only, what is the proper way to process large utf-8 text files? I need "bulk" processing (i.e. in blocks - the file is ~ 1GB), but reading it in fixed blocks is bound to result in partially-read utf-8 characters at block boundaries. -- ht

Re: Software licenses and releasing Python programs for review

2005-05-28 Thread Ivan Voras
poisondart wrote: > Ultimately I desire two things from the license (but not limited to): > - being able to distribute it freely, anybody can modify it > - nobody is allowed to make profit from my code (other than myself) GPL does something like this, except it doesn't forbid anyone to sell the

help with sending mail in Program

2005-06-06 Thread Ivan Shevanski
to send with it, but I can't figure out how to include my variables in it, such as the questions I ask them. Can someone explain this to me? -Ivan _ On the road to retirement? Check out MSN Life Events for advice on how

Re: Creating file of size x

2005-06-06 Thread Ivan Shevanski
ile, and then just write >the block. > >-- >Kind Regards, >Jan Danielsson >Nobody loves a cynic ><< signature.asc >> I don't know. . .have you searched through modules? That's all I can think of. . . -Ivan _

Re: Creating file of size x

2005-06-06 Thread Ivan Shevanski
What version of python do you use? I'll send you the module library. . .(sorry for double message) -Ivan _ FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/dire

Re: Creating file of size x

2005-06-06 Thread Ivan Shevanski
http://python.org/doc/2.4.1/modindex.html this is the global module index. I'd keep it handy to search through since it has some of the most useful stuff every intented! =D Try looking through here to help. . .That's the best I can think

Re: help with sending mail in Program

2005-06-06 Thread Ivan Shevanski
Ugh. . .I'm really confused. In the example I saw the message was taken from a file on the computer. . .Like it opened it and then sent it. I guess I just need to check out the whole thing a bit more before I get specific. I'll ask again if I need specific help. tha

Re: help with sending mail in Program

2005-06-06 Thread Ivan Shevanski
Could someone send me a good tutorial for sending mail then? The one I found is not what I'm looking for. Also please dont send me the stmp definition cause i've looked at that enough. thanks, -Ivan _ Express yourself

SMTP help please

2005-06-06 Thread Ivan Shevanski
end which sends me the form when they're done. I don't especially want them to have to input all the needed details though. . .Just thought I'd put this in so you'd know what its for. -Ivan _ Don’t just searc

Re: Help with SMTP

2005-06-07 Thread Ivan Shevanski
Ok, all my problems are solved except for one. . .If I want my program to send a message back to me do I need the from adress? Because I don't specifically know it for the person using the program. Any help is appreciated =D

Re: SMTP help please

2005-06-07 Thread Ivan Shevanski
>From: Larry Bates <[EMAIL PROTECTED]> >To: Ivan Shevanski <[EMAIL PROTECTED]> >Subject: Re: SMTP help please >Date: Tue, 07 Jun 2005 07:39:01 -0500 > >I have found that the SmtpWriter class "hides" all the >complexity in creating emails like you

RE: help

2005-06-08 Thread Ivan Shevanski
-Ivan >From: [EMAIL PROTECTED] >To: python-list@python.org >Subject: help >Date: Thu, 2 Jun 2005 11:11:41 EDT > >When i try to open IDLE(python GUI) it says that i have a socket error: >conection refused what do i do to fix this >-- Reinstall my friend. . .Rein

RE: identifying 64-bit Windows from 2.3.5?

2005-06-08 Thread Ivan Shevanski
you have, I have 64 bit and it works fine. -Ivan _ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ -- http://mail.python.org/mailman/listinfo/python-list

Re: help with sending mail in Program

2005-06-09 Thread Ivan Shevanski
;>if __name__ == '__main__': >> sendToMe('Testing', 'This is a test') --- I think this seems like it would work, but I still can't seem to get it to work. I turned on the debugging and everything seemed alright. I'll post how I modified i

Re: Start application & continue after app exits

2005-06-09 Thread Ivan Shevanski
ess function. This function will be called when the interpreter exits. Only one function may be installed in this way; to allow multiple functions which will be called at termination, use the atexit module. Note: The exit function is not called when the program is killed by a signal, when a Pyt

Re: help with sending mail in Program

2005-06-09 Thread Ivan Shevanski
#!/usr/local/bin/python ''' Send mail to me ''' from smtplib import SMTP def sendToMe(subject, body): me = '"Ivan Shevanski" <[EMAIL PROTECTED]>' send(me, me, subject, body) def send(frm, to, subject, body): s

RE: Exe file

2005-06-09 Thread Ivan Shevanski
t; >-- >Philip Seeger > > Yes there is and its very easy, simplely use the Freeze program. You can google it and download it, just run it and it will complile an exe for you, with a dll. Run it like any other apllication. -Ivan

RE: cx_freeze error : LookupError: no codec search functions registered:can't find encoding

2005-06-09 Thread Ivan Shevanski
and the version of Python match? Also, which freeze did you use, the one off the internet or the one included with Python. I may be able to help you. -Ivan _ FREE pop-up blocking with the new MSN Toolbar – get it now! http

RE: smtpd module

2005-06-09 Thread Ivan Shevanski
So youre wondering how to send mail in python? I have a lot of examples if you want the smtp module. I don't have anything for anything other than the smtp module. -Ivan _ Express yourself instantly with MSN Messenger! Dow

RE: A question about time

2005-06-09 Thread Ivan Shevanski
combination of the modules to get the complete time. Use time.sleep() to sleep for a certain amount of SECONDS. Not minutes. So: from sleep import time sleep(5) would have the program or script stop and wait for 5 seconds. I hope this was what your were asking for, I didn'

Re: help with sending mail in Program

2005-06-15 Thread Ivan Shevanski
l.MIMEText import MIMEText from smtplib import SMTP x = 'python' y = 'python2' def sendToMe(subject, body): me = '"Ivan Shevanski" <[EMAIL PROTECTED]>' send(me, me, subject, body) def send(frm, to, subject, body): s = SMTP() s.set_debugl

Re: high performance/threaded applications in Python - your experiences?

2007-06-23 Thread Ivan Voras
Jay Loden wrote: > I was hoping for some experiences that some of you on the list may have had > in dealing with Python in a high performance and/or threaded environment. In > essence, I'm wondering how big of a deal the GIL can be in a real-world > scenario where you need to take advantage of

__dict__ for instances?

2007-05-12 Thread Ivan Voras
While using PyGTK, I want to try and define signal handlers automagically, without explicitly writing the long dictionary (i.e. I want to use signal_autoconnect()). To do this, I need something that will inspect the current "self" and return a dictionary that looks like: { "method_name" : self.

Re: __dict__ for instances?

2007-05-13 Thread Ivan Voras
[EMAIL PROTECTED] wrote: > I think you want "dir(instance)" __dict__ returns the instance Part of the problem is that dir(instance) returns a list of strings, so iterating the dir(instance) gets me strings, not methods. Alternatively, is there a way to get a "bound" instance by its name - some i

Re: __dict__ for instances?

2007-05-13 Thread Ivan Voras
Marc Christiansen wrote: > Nope, at least for PyGTK 2 :) See below. Aaah, but! > [...] >> This looks like it should be easy, but I can't find the solution :( > > Use the doc, Luke, oops, Ivan :) > Citing the gtk.glade.XML.signal_autoconnect documentation: >

Re: __dict__ for instances?

2007-05-13 Thread Ivan Voras
Bruno Desthuilliers wrote: > You're not doing anything wrong, that's just how Python works. "methods" > are wrapper objects around function objects attributes. The wrapping > only happens at lookup time, and returns different kind of "method" > wrapper (resp. unbound or bound methods) if the attri

Re: GUI tutorial

2007-05-13 Thread Ivan Voras
John K Masters wrote: > Can someone point me in the direction of a good tutorial on programming > python with a GUI? I'm just starting out with python and have written a > few scripts successfully but would like to add a graphical front end to > them to make it easier for my work colleagues, most o

Re: __dict__ for instances?

2007-05-13 Thread Ivan Voras
Bruno Desthuilliers wrote: >> "WARNING: "on_button_clicked" not callable or a tuple" > > Please post the relevant code and the full traceback. The code: Class W: def __init__(self): self.xml = gtk.glade.XML("glade/mainwin.glade") self.window = self.xml.get_widget("mainwin") self

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-21 Thread Ivan Tikhonov
Use php. I am lead programmer/maintainer of big website with a lot of interactive stuff in user's backoffice and with a lot of interraction to our non-web apps. PHP is a crap, but programming for web in python is a pain in the ass. And php programmers are cheaper. Especialy avoid mod_python. IMHO

Re: __dict__ for instances?

2007-05-26 Thread Ivan Voras
Bruno Desthuilliers wrote: >> The error (not an exception, only the message appears and the handler >> doesn't work): >> >> ** (finstall.py:7551): WARNING **: handler for 'on_button_next_clicked' >> not callable or a tuple > > Is this the full message, or did you skip the preceding lines ? The f

PyGTK and HTML rendering?

2007-05-26 Thread Ivan Voras
Hi! Is there an easy off-the-shelf way to get HTML formatting inside the TextArea widget? I've looked at TextBuffer but it appears to have only support for manual applying of attributes to portions of text. I don't need anything complex, bold, italic and font-size would be enough. -- (\__/) (O.o

Re: Tkinter program with a usable interpreter console

2007-07-27 Thread Ivan Johansen
t this: http://lfw.org/python/Console.py I haven't really used it myself yet, but it looks really great. Ivan Johansen -- http://mail.python.org/mailman/listinfo/python-list

Biased random?

2007-08-27 Thread Ivan Voras
Hi, I have a list of items, and need to choose several elements from it, "almost random". The catch is that the elements from the beginning should have more chance of being selected than those at the end (how much more? I don't care how the "envelope" of probability looks like at this point - can

Re: Biased random?

2007-08-30 Thread Ivan Voras
Jeffrey Barish wrote: > If you take the difference between two uniformly distributed random > variables, the probability density function forms an isosceles triangle > centered at 0. Take the absolute value of that variable and the pdf is a > straight line with maximum value at 0 tapering to 0 at

Re: Biased random?

2007-08-31 Thread Ivan Voras
Mark Dickinson wrote: > That's because the call to abs() usually collapses two values to one > (e.g. -2 and 2 both end up being 2), > but there's only one integer n for which abs(n) == 0. Ah. Need to sleep more. signature.asc Description: OpenPGP digital signature -- http://mail.python.org/ma

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-02 Thread Ivan Wang
On Sep 2, 9:45 pm, [EMAIL PROTECTED] wrote: > [snip code] > > Thanks for that. I realise that improving the algorithm will speed > things up. I wanted to know why my less than perfect algorithm was so > much slower in python than exactly the same algorithm in C. Even when > turning off gcc's optimi

<    1   2   3   4   5   6   >