Extending the 'function' built-in class

2013-12-01 Thread G.
Hi, I can't figure out how I can extend the 'function' built-in class. I tried: class test(function): def test(self): print("test") but I get an error. Is it possible ? Regards, G. -- https://mail.python.org/mailman/listinfo/python-list

Re: Extending the 'function' built-in class

2013-12-01 Thread G.
not an acceptable base type > > So, we're back to asking what version you're using and what error > message you got. Hi, I don't care that much for the version, since I wanted rather to perform some tests. I tried your code with various versions and got the same message

Re: Extending the 'function' built-in class

2013-12-01 Thread G.
es, indeed. The 'function' built-in class was the following one: >>> type(lambda x: 2*x) but I am interested by answers concerning other similar types also. Regards, G. -- https://mail.python.org/mailman/listinfo/python-list

Re: Extending the 'function' built-in class

2013-12-02 Thread G.
Le 02-12-2013, Steven D'Aprano a écrit : > There are plenty of ways to extend functions. Subclassing isn't one of > them. Thank you very mych for your complete answer; I falled back to your last proposal by myself in my attempts; I am happyt to learn about the other ways a

Could you please give me some advise on this piece of code?

2011-09-12 Thread G.
uld have a look on my code and could maybe see why it does nothing after "print test", please. Thank you very much. Kind regards, G. # To change this template, choose Tools | Templates # and open the template in the editor. __author__="User" __date__ ="$11.09.2011 1

i need your help

2005-12-18 Thread g
hi.i dont know it is true or not to write you about that.I ve problem to run phyton in my personal computer.I install it and there is no error when installing but when i want to run pythonw.exe, no window opened.Only i can run python.exe in dos shell when i click.when cilicking to w9xpopen.exe gi

Re: HTML parsing bug?

2006-01-30 Thread G.
> // - this is a comment in JavaScript, which is itself inside > an HTML comment This is supposed to be one line. Got wrapped during posting. -- http://mail.python.org/mailman/listinfo/python-list

Subclassing int

2007-07-23 Thread G
Hi, I am trying to subclass int to allow a constructor to accept None. I am trying the following class INT(int): def __init__(self, x): if x is None: return None else: int.__init__(x) b = INT(x=None) When i run the previous code i get the following er

Re: Subclassing int

2007-07-23 Thread G
Thanks a lot Matt and Steve. I replaced __int__ with __new__ and it worked On 7/23/07, Matt McCredie <[EMAIL PROTECTED]> wrote: Do you guys know why the if statement is not evaluated? For immutable types __new__ is called before __init__. There are some details here: http://docs.python.org/r

With Statement Contexts and Context Managers

2007-07-31 Thread G
Hi, Could somebody please point me to a good resource to read about the contexts, context managers, and with_statement Best Rgd, G. -- http://mail.python.org/mailman/listinfo/python-list

Re: With Statement Contexts and Context Managers

2007-07-31 Thread G
Great thanks. On 7/31/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-07-31 at 14:57 -0400, G wrote: > > Hi, > > > >Could somebody please point me to a good resource to read about > > the contexts, context managers, and with_state

wxpython with python 2.5

2007-08-02 Thread G
Hello, I am trying to get wxpython to run with python 2.5 without any success. wx works prefectly in python 2.4. below is the error code i get when i try to run the code. File "demo.py", line 3, in import Main File "/tmp/wxPython/Main.py", line 32, in import wx #

os.system with cgi

2008-03-03 Thread G
Hi, I have the following peace of code def getBook(textid, path): url = geturl(textid) if os.path.isfile(path + textid): f = open(path + textid) else: os.system('wget -c ' + url + ' -O ' path + textid) f = open(path + textid) return f The reason I am no

Re: question about string formatting

2008-04-09 Thread G
>>> import locale >>> locale.setlocale(locale.LC_ALL, '') 'en_US.UTF-8' >>> locale.format('%.2f', 1021212.12, True) '1,021,212.12' >>> On Wed, Apr 9, 2008 at 1:04 PM, Kelie <[EMAIL PROTECTED]> wrote: > Hello, > > Is there something in Python built-in function or library that will > convert a numb

Re: Can't run any script without it failing due to calling tkinter for no reason

2012-10-14 Thread Adam G
On Sunday, October 14, 2012 7:19:24 PM UTC-7, Benjamin Kaplan wrote: > On Sun, Oct 14, 2012 at 6:47 PM, wrote: > > > Hello All, > > > > > > > > > I'm running python 3.2 on Freebsd 9.0 Release and I must've screwed up my > > environment somehow, because now I can't run any script without it f

SMS

2011-07-20 Thread TERESA G
One method you can use is to connect to an SMS API provider from your web application, which will enable you to send SMS via an internet connection, typically using a protocol like HTTP; You can try Nexmo SMS API, it supports HTTP REST and SMPP and we have documentation published in our website wi

Run Windows commands from Python console

2017-09-03 Thread g . morkvenas
Hello, I run Python console in Windows. Can I run cmd prompt commands there? If I run command dir I have: >>> dir What does it means? If i trying to create file I have error: >>> type NUL > hh.txt File "", line 1 type NUL > hh.txt ^ SyntaxError: invalid syntax What means

acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
My program has two circles: one stationary circle, drawn at a random location; and one moving circle, consistently drawn in the same place in the graphics window. The moving circle moves towards the stationary one. However, when the moving circle hits the stationary one (when the x-coordinates

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
I did try that. The problem is that I already declared a point moving_object_center = (-555,-555), because that's the point I used as the center to draw the moving_object circle itself. So the moving_object_center.getX() will return -555 no matter what I do. That's why I need to calculate the

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread G Yu
> But your code has: > > moving_circle.move(P_to_R/P_to_E, E_to_R/P_to_E) > > so won't that move the circle and change what: > > moving_circle.getCenter() > > returns? Yes, moving the circle changes the value of moving_circle.getCenter(). The problem is interpreting the output. The

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-24 Thread G Yu
Ah, I get it now. I have to store the acircle.getCenter() in a point Point, and then access Point.getX() and Point.getY() separately. It was just that middle step that I was missing. Thanks so much! -- https://mail.python.org/mailman/listinfo/python-list

recent-files

2023-03-28 Thread g...@uol.com.br
In Python 3.11.2,  the recent-files list keeps always increasing because it is impossible to edit the list; the corresponding .txt file has disappeared. Please help! Giorgio Gambirasio g...@uol.com.br       -- https://mail.python.org/mailman/listinfo/python-list

How best to handle SystemError in ctypes callback

2022-01-05 Thread Jarrod G
With the following code: import ctypes > import readline > from ctypes.util import find_library > > rl = ctypes.cdll.LoadLibrary(find_library('readline')) > > rl_redisplay = rl.rl_redisplay > rl_redisplay.restype = None > rl_redisplay.argtypes = None > > rl_redisplay_function = ctypes.c_void_p.in_

correct way to catch exception with Python 'with' statement

2016-11-28 Thread g thakuri
Dear Python friends, Any suggestion on how to add exception and make the below program look better , I am using Python 2.7 and Linux def create_files_append(): """ """ try: os.makedirs

Simple code and suggestion

2016-11-30 Thread g thakuri
Dear Python friends, I have a simple question , need your suggestion the same I would want to avoid using multiple split in the below code , what options do we have before tokenising the line?, may be validate the first line any other ideas cmd = 'utility %s' % (file) out, err, exitcode = co

Tracing memory in production django process with systemtap

2016-08-04 Thread Lei G
Hi all, Recently I met some python memory problems with Django and uwsgi, and found to find exactly which part is causing the problem, so I went to use systemtap to tracing the problem, and here are some problems that I met: It seems python needs to patch some 'probes' into the source code,

Re: Tracing memory in production django process with systemtap

2016-08-04 Thread Lei G
在 2016年8月5日星期五 UTC+8上午1:41:04,Lei G写道: > Hi all, > > Recently I met some python memory problems with Django and uwsgi, and found > to find exactly which part is causing the problem, so I went to use systemtap > to tracing the problem, and here are some problems that I met:

Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Marcin G
My boss wants my code to run on Python 3.5, so I thought I'd install 3.5 to be able to ascertain this. But Linux Mint 19 ships with Python 3.6 and python.org only provides source code for 3.5.6. So I thought I'd try compiling 3.5.6 myself.

RE: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Marcin G
Hmm. From looking at your full log (THANK YOU for posting that, btw - so many people don't), it looks like an issue with certificate checking. Might be a bug in the test itself. Does the same thing happen with a more recent Python build? It could be a weirdness with specific versions of OpenSSL. H

'python' is not recognized as an internal or external command

2019-09-01 Thread G Kishore
Hi Team, I was installing python in my new windows 10 machine and cpuld able to access python from command window when the location is where I have installed python. The same I have tried to enter the command from Desktop location but "'python' is not recognized as an internal or external comma

Errors in python\3.8.3\Lib\nntplib.py

2020-04-29 Thread G Connor
module: python\3.8.2\Lib\nntplib.py lines 903-907 --- for line in f: if not line.endswith(_CRLF): line = line.rstrip(b"\r\n") + _CRLF if line.startswith(b'.'): line = b'.' + line --- When I try

Re: Errors in python\3.8.3\Lib\nntplib.py

2020-04-29 Thread G Connor
On 4/29/2020 5:29 PM, Chris Angelico wrote: > Try opening the file in binary mode instead. Changed: f = open(postfile,'r')to : f = open(postfile,'rb') and it worked. Thanks man! -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Tim G
Thomas Heller wrote: > FYI, if you don't know this already: You also can resize the console without > going through the properties menu with 'mode con cols=... lines=...'. Good grief! I haven't used "mode con" in years; forgotten it even existed! Thanks for bringing that back, Thomas. TJG -- ht

Re: Windows vs Linux

2005-10-26 Thread Tim G
Bernhard Herzog wrote: > "Tim Golden" <[EMAIL PROTECTED]> writes: > > > But as far as I can tell > > from my experience and from the docs -- and I'm not near a > > Linux box at the mo -- having used ctrl-r to recall line x > > in the history, you can't just down-arrow to recall x+1, x+2 etc. > > O

Re: Problems with threaded Hotkey application

2005-11-23 Thread Tim G
And just to confirm, it does in fact work. If you move the RegisterHotKey line to within the thread's run method, the thread's message loop picks up the hotkey press. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with threaded Hotkey application

2005-11-23 Thread Tim G
One obvious point is that, according to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cerefWM_HOTKEY.asp the WM_HOTKEY message is posted to the queue *of the thread which registered the hotkey*. I haven't yet tried it myself to see, but in your example the main th

Call for a cooperation

2005-12-06 Thread G. Sica
Dear all, I'm a PhD researcher in logic at the University of Leiden in Holland. At the present I'm doing a work about the implementation of some parts of the Braille code related to the representation of the logical and mathematical symbols. In order to the well development of this work I will need

Re: Problem remotely shutting down a windows computer with python

2005-01-04 Thread Tim G
> I have a problem when using the python script found here: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/360649 > > It is a script to remotely shutdown a windows computer. When I use it, > the computer shuts down, but doesn't power off like with a regular > shutdown. It stays on the

Re: Installing IPython on win2k

2005-01-08 Thread Tim G
Dave Merrill wrote: > Hi, I'm new to python, and ipython, but not to programming, having trouble > getting ipython installed on windows 2000, python 233. Any help would be > much appreciated; I'm sure I'm being some basic flavor of dense... First of all, rest assured that it does work (and quite e

Re: COM problem .py versus .exe

2005-06-29 Thread Tim G
Greg Miller wrote: > I tried the code snippet using win32api.GetFileVersionInfo(), what I > get now is the following when running on the executable machine: > > . . . FileFlagsMask => 63 > FileType => 2 > FileVersionMS => 65536 > FileVersionLS => 1 > Signature => -17890115 > FileSubtype => 0 > File

Re: [Tutor] How to get 4 numbers from the user in one line for easycomparision?

2005-07-03 Thread Alan G
7;Type 4 numbers separated by spaces: ') numbers = [int(n) for n in line.split(' ')] HTH, Alan G. -- http://mail.python.org/mailman/listinfo/python-list

c/c++ extensions and help()

2005-07-28 Thread Lenny G.
Is there a way to make a c/c++ extension have a useful method signature? Right now, help(myCFunc) shows up like: myCFunc(...) description of myCFunc I'd like to be able to see: myCFunc(myArg1, myArg2) description of myCFunc Is this currently possible? Thanks, Lenny G. --

constructing bytestrings

2005-08-11 Thread Lenny G.
I use 's = os.read(fd, 12)' to grab 12 bytes from a file. Now, I want to create a string, s1, which contains 16-12=4 bytes: 4,0,0,0, followed by the contents of s. I know how to 's1 = "\x04\x00\x00\x00"' and how to 's3 = s1+s', but I don't know how to construct s1 dynamically (i.e., given N, cons

fully-qualified namespaces?

2005-09-12 Thread Lenny G.
thon-crypto 'import Hippo.Crypto' # to refer to Hippo.Crypto but the 2nd item doesn't seem to work from within the Hippo module. What am I missing? Thanks, Lenny G. -- http://mail.python.org/mailman/listinfo/python-list

Re: fully-qualified namespaces?

2005-09-12 Thread Lenny G.
amespace takes precendence. I tried using the renaming trick inside of Crypto.py, but it still can't find the original python-crypto Crypto. Maybe there's something I can do in the __init__.py? Maybe something with __path__? Is there a better way to access namespaces from the modul

Re: fully-qualified namespaces?

2005-09-12 Thread Lenny G.
with these facts (with a little bit of discomfort ;) ) -- just wanted to make sure that I understood. Lenny G. -- http://mail.python.org/mailman/listinfo/python-list

FTP Error: Windows AS/400

2005-09-13 Thread Tim G.
I am trying to use Win Python to ftp files from an AS/400 IFS directory down to my Windows machine. I seem to get stuck when I am trying to send a command to the AS/400 to switch file systems from native to IFS and then to issue a cd to my folder. I get the error below. If anyone has had experie

FTP Windows AS/400

2005-09-13 Thread Tim G.
I am trying to execute a win python script that connects to an AS/400; changes from the native lib to the IFS file system; then, changes to a directory in IFS; gets a file. Any help would be greatly appreciated. I cannot get the script to switch from native to IFS. I get the following error: Tr

Re: simple input that can understand special keys?

2005-02-28 Thread Tim G
Gabriel B. wrote: > i'm writting an application that will use Tinker in a newer future. > Now it's console only. I simply ommit some data on the display, > print() some other and go on. The problem is that i can't test the > actions tiggered by special keys, like Page Up/Down or the F1...12 > > Rig

Re: HELP: Python equivalent of UNIX command "touch"

2005-03-03 Thread Tim G
Since no-one's suggested this yet, I highly recommend UnxUtils: http://unxutils.sourceforge.net/ which includes a touch.exe. Obviously, this doesn't answer your call for a Python version, but if you're happy with touch under Unix, maybe this will work for you. TJG -- http://mail.python.org/mailm

newbie: dictionary - howto get key value

2005-03-10 Thread G. Völkl
Hello, I use a dictionary: phone = {'mike':10,'sue':8,'john':3} phone['mike'] --> 10 I want to know who has number 3? 3 --> 'john' How to get it in the python way ? Thanks Gerhard -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.islink()

2004-12-08 Thread Tim G
You may well be able to do it with the win32file module functions: GetFileAttributesEx or GetFileInformationByHandle It's not my area of expertise, but usually a bit of poking around in msdn.microsoft.com yields some results, as does Googling around for other people (often VB or Delphi-based) who h

JSON translated into SQL by python

2013-11-22 Thread Aaron G.
I am new to programming python for JSON to SQL and I was wondering why this does not work. All the values for entering the DB are correct. The EnterpriseValue data is not entering the database. #collect data from JSON source at Yahoo url = ["db", "http://y.ahoo.it/wlB89";] #check all sites che

Re: How to write in to already opened excel file by using openpyxl

2013-09-27 Thread somesh g
Hi..joel what is said is correct i dint added save to that after adding its working perfect thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: How to write in to already opened excel file by using openpyxl

2013-09-27 Thread somesh g
hi..Neil yes i dint saved that time and i added the save option and it saved Thanks for the response -- https://mail.python.org/mailman/listinfo/python-list

unable to read combo boxes in excel by xlrd package in python

2013-09-27 Thread somesh g
Hi..there I want to read the combo box in excel by using "xlrd" but in the output it is showing empty message, its not reading the combo box can u guys help me how to read the combo box in excel by "xlrd" code written like this workbook = xlrd.open_workbook('path of the file') worksheet = work

How to read a particular cell by using "wb = load_workbook('path', True)" in openpyxl

2013-09-30 Thread somesh g
Hi..there I have written code for reading the large excel files but my requirement is to read a particular cell in a excel file when i kept "True" in "wb = load_workbook('Path', True)" any body please help me... CODE: from openpyxl import load_workbook wb = load_workbook('Path', True)

Programming Games with python, I know this subject was disccused need help

2006-08-04 Thread Over G
HI I would like to start to program games, with python, where to start? What packages I need,? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Games with python, I know this subject was disccused need help

2006-08-04 Thread Over G
Goalie_Ca wrote: > Well, with these libraries you won't need much else. > > http://www.pygame.org/news.html > and > http://sourceforge.net/projects/pyallegro/ > > > Over G wrote: > > HI > > > > I would like to start to program games, with pytho

Re: A problem about File path encode

2006-10-10 Thread Gabriel G
At Tuesday 10/10/2006 11:32, Kevien Lee wrote: I agree with the problem caue of the the escape character,but when i folllow these meth,it still didn't work. Explain "didn't work". A full traceback would be useful. It is so strang that the code work on another computer (OS is WinXP),but throw

MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Hi there. I have been receiving MemoryErrors using the Windows version of Python 2.5. The script I have written times the sending and the reception of emails with various attachments. I get many exceptions when using the IMAP downloads. This happens randomly; sometimes the file downloads OK,

Re: MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Fredrik, Thanks for the response. I did see that, but having been dated 2005 I thought that it might have been patched. I am also sometimes getting the same problem with the urllib.py module. T his may have to do with the interaction between Python and the mobile optimization client that I

Re: "best" rational number library for Python?

2006-10-31 Thread Gabriel G
At Tuesday 31/10/2006 21:16, [EMAIL PROTECTED] wrote: casevh> You must use "gmake". "make" fails during "make check" Very weird: piggy:% make -v GNU Make 3.80 piggy:% gmake -v GNU Make 3.80 Nevertheless, using "gmake" instead of "make" did indeed work. Thanks for the hint

Re: unpickling Set as set

2006-11-08 Thread Gabriel G
At Wednesday 8/11/2006 05:26, George Sakkis wrote: Or you may have this done automatically by hacking the Set class: from sets import Set import cPickle as pickle Set.__reduce__ = lambda self: (set, (self._data,)) s = Set([1,2,3]) x = pickle.dumps(s) print pickle.loads(x) This doesn't work

Re: is this the right way to do subclasses?

2006-11-08 Thread Gabriel G
At Wednesday 8/11/2006 16:33, John Salerno wrote: > class Character(object): > def __init__(self, name, strength, dexterity, intelligence): > self.name = name > self.health = 10 > self.strength = strength > self.dexterity = dexterity > self.intelligenc

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Nicolas G
On 11/9/06, Tim Williams <[EMAIL PROTECTED]> wrote: On 8 Nov 2006 15:35:31 -0800, NicolasG <[EMAIL PROTECTED]> wrote:> How can I use python to get the real IP address of my DSL router (when> my PC is part of the local home LAN) ? The router will the PC's default gateway IP address,  if you are on a

Re: how do i map this?

2006-11-12 Thread Gabriel G
At Monday 13/11/2006 01:55, John Machin wrote: Ben Finney wrote: > "ronrsr" <[EMAIL PROTECTED]> writes: > > > #row is a dictionary with keys: zid, keywords, citation, quotation > > def print_row(row): > >print """ > > [...] > > """ > > You're printing a string, and never using th

Re: lazy arithmetic

2006-08-24 Thread Gabriel G
At Friday 25/8/2006 02:18, [EMAIL PROTECTED] wrote: > x+y get translated to x.__add__(y) No that's not true at all. The self argument to __add__ ends up being the Add instance, not the Item instance: z=x+y is translated to z.__add__(y) Well, I deleted my response after I noticed that Simon

Re: question about class, functions and scope

2006-08-28 Thread Gabriel G
At Saturday 26/8/2006 06:13, nephish wrote: i have an app that runs three classes as threads in the same program. some of them need to be able to share some functions. Can i set a function before i define a class and have the class use it ? Kinda like this. def some_function(var1, var2): do

Re: Python web service ...

2006-08-28 Thread Nicolas G
or there is something better in mind ? > > is that webservice or webserver? > if webservice try ZSI of it's a webserver why don't you try CherryPy? > > > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > -- Nicolas G mobile: +30 69 45 714 578 -- http://mail.python.org/mailman/listinfo/python-list

Re: a question about my script

2006-08-31 Thread Gabriel G
At Thursday 31/8/2006 10:01, alper soyler wrote: I changed the script as you wrote below: directory = 'pub/kegg/genomes' Sorry, in the original comment I said "change it to be an absolute path" but didn't write it well. This line should read: directory = '/pub/kegg/genomes' Gabriel Gene

Re: a question about ftplib

2006-09-01 Thread Gabriel G
At Friday 1/9/2006 06:32, alper soyler wrote: Thank you very much for your help. The program works however, after downloading 121 '.pep' files, it gave me time out error: Traceback (most recent call last): File "ftp1.0.py", line 18, in ? for filename in ftp.nlst(): ... File "/usr/lib

Re: A critique of cgi.escape

2006-09-25 Thread Gabriel G
At Monday 25/9/2006 11:08, Jon Ribbens wrote: >> What precisely do you think it would "break"? > > existing code, and existing tests. I'm sorry, that's not good enough. How, precisely, would it break "existing code"? Can you come up with an example, or even an explanation of how it *could* brea

Re: A critique of cgi.escape

2006-09-26 Thread Gabriel G
At Tuesday 26/9/2006 04:16, Lawrence D'Oliveiro wrote: >> >> What precisely do you think it would "break"? > FWIW, a *lot* of unit tests on *my* generated html code would break... Why did you write your code that way? Uhm, maybe because I relied on the published documentation of a published s

Re: A critique of cgi.escape

2006-09-26 Thread Gabriel G
At Tuesday 26/9/2006 12:53, Jon Ribbens wrote: > BTW, I am curious about how you do unit testing. The example that I used > in my summary is a very common pattern but would break in cgi.escape > changed it's semantics. What do you do instead? To be honest I'm not sure what *sort* of code people

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Gabriel G
At Thursday 28/9/2006 12:23, Ramon Diaz-Uriarte wrote: Going back to the original question, a related question: does anybody know why there are so few books on data structures and algorithms that use Python? I remember that, at least ~ 12 years ago there were many (and very good) books that use

Re: where the extra space comes from on the stdout

2006-10-02 Thread Gabriel G
At Saturday 30/9/2006 19:09, Steve Holden wrote: > while 1: > print 'Question [Y/[N]]?', > if sys.stdin.readline().strip() in ('Y','y'): > #do something > pass > > $ python q.py > Question [Y/[N]]?y > Question [Y/[N]]?y > Question [Y/[N]]?y > Yup. When you execute

Re: saving an exception

2006-10-03 Thread Gabriel G
At Tuesday 3/10/2006 02:15, Bryan wrote: >i would like to save an exception and reraise it at a later time. >def foo(): >Â Â try: >Â Â Â Â 1/0 >Â Â except Exception, e: >Â Â Â Â exception = e > >if exception: raise exception > >with the above code, i'm able to successfully raise the ex

Re: Howto pass Array/Hash into Function

2006-10-03 Thread Gabriel G
At Tuesday 3/10/2006 06:05, Wijaya Edward wrote: How can I pass Array, Hash, and a plain variable in to a function at the same time. I come from Perl. Where as you probably know it is done like this: sub myfunc { my ($plain_var, $hash_ref,$arref) = @_; # Do sth with those variables

Re: PEP 358 and operations on bytes

2006-10-03 Thread Gabriel G
At Tuesday 3/10/2006 21:52, Ben Finney wrote: Gerrit Holl <[EMAIL PROTECTED]> writes: > operations that aren't currently defined in PEP 358, like: > > - str methods endswith, find, partition, replace, split(lines), > startswith, > - Regular expressions > > I think those can be use

Re: Python Question About Compiling.

2006-11-29 Thread Gabriel G
At Thursday 30/11/2006 03:40, Scheol Service wrote: i know this. Is there better directions on how to use it? Have you tried it? What's your actual problem? See http://www.py2exe.org/ -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio

Re: One detail...

2006-12-01 Thread Gabriel G
At Saturday 2/12/2006 00:40, [EMAIL PROTECTED] wrote: I'm trying to do in Zope, which doesn't allow "_" characters at the beginning of identifiers. Even in an external method, it gives me an error when I try to reference the o.a. Is there a trick to do it some other way? Better to ask on a Z

cgi - secure sessions

2006-02-01 Thread infini . g
Hey, I was just wondering if / how would it be possible to create secure sessions for a website using Python CGI... I thought of using cookies, and things looked promising for a while; I could login through a form which pointed to a cgi script which created sent the user cookies, but I found that

Checkbuttons in a Text widget

2006-02-17 Thread Lou G
e into the Text widget. I've tried text.insert and it doesn't seem to do the job. Help? Thanks, Lou G -- http://mail.python.org/mailman/listinfo/python-list

Re: Checkbuttons in a Text widget

2006-02-17 Thread Lou G
For anyone who might be able to use this technique: I kept playing around and got it to work: for i in nameList: btnText = name[i] self.sv = [] cb = [] cb.append(Checkbutton(self.datalist, text=btnText, variable=self.sv[i], background='white', font=("Courier", 10))) sel

Looking for Pythonic Examples

2006-02-28 Thread G. Völkl
Hello I am looking for examples of Pythonic Thinking: One example I found: Here some lines of the web side of Bruce Eckel: http://www.mindview.net/WebLog/log-0053 How to read a text file: for line in file("FileName.txt"): # Process line It is a easy and sophisticated thing in python, but har

Re: HELP Printing with wxPython

2005-05-11 Thread Tim G
> Hello all, I'm trying hard to make possible to print some simple text from > python to the default printer using wxPython, after days of internet > searches I found this page: http://wiki.wxpython.org/index.cgi/Printing but > is impossible to use this script even if I do exactly as said there. I

Python and Java

2007-04-04 Thread Sreelatha G
Hi I am new to python .I need your help in solving my problem. Is there any way to call python files in a java file .How is it possible? Thanks Sreelatha -- http://mail.python.org/mailman/listinfo/python-list

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carl G.
Such blatant disregard for newsgroup etiquette will surely reflect poorly on the poster's credibility. I can only draw the conclusion that he is either a troll or very ignorant of what is acceptable. Carl G. -- http://mail.python.org/mailman/listinfo/python-list

memory leak

2007-01-26 Thread john g
i have a memory leak issue with extension function that im working on. it reads data from a binary file into a stl vector then creates a new list to pass back to the python interface. the function works the first 1021 times but then gives a segmentation fault (core dumped). heres the business part

get pid of a nohup command in Python

2007-02-12 Thread g . willgoose
I'm new to Python and am evaluating moving a project from Tcl/Tk to Python and am stuck on one issue. How can I nohup (or any detached task for that matter) a process and get its PID in Python. The obvious route of (with a trivial example) os.system("nohup ls > junk &") returns the status of the

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread G. Monzón
Please don't compare PHP with Python... They are very different worlds. Maybe not all the Python's core functions are implemented in C, but Python is really a lot more efficient than PHP in every case you want to compare. If you "look inside", there's nothing to compare... they are extremely diff

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread G. Monzón
Carl Banks wrote: > G. Monzón wrote: > > Please don't compare PHP with Python... They are very different worlds. > > I'm not. I was simply agreeing that the single executable way the OP > claimed PHP does it can *sometimes* be preferrable in Python, and > giv

Re: Incrementally converting a C app to Python

2006-05-09 Thread G. Monzón
Hi Bjorn, I think the best approach is highly-dependent to your current C application design and "way of doing things". For a type of application you would take the opposite path than for other I thought. Yes I did that one time, but I re-coded all from scratch... and since that I usually do in r

hidden file detection

2006-05-19 Thread Lenny G.
What's the best way to do cross-platform hidden file detection? I want to do something like weed-out the files that should be 'hidden' from os.listdir() (which would be files that start with '.' under Unix, files that have the hidden attribute set on windows, and whatever it is that makes Mac file

wxPython graphics query (newbie)

2008-03-17 Thread Thomas G
I am exploring wxPython and would be grateful for some help. It is important to me to be able to slide words and shapes around by dragging them from place to place. I don't mean dragging them into a different window, which is what 'Drag and Drop' has come to mean, just moving them around within

Re: Ideas to optimize this getitem/eval call?

2009-01-22 Thread mario g
On Sun, Jan 4, 2009 at 6:46 PM, Tino Wildenhain wrote: > mario wrote: >> >> On Jan 3, 7:16 am, Steven D'Aprano > cybersource.com.au> wrote: >> >>> I was about to make a comment about this being a security hole, >> >> Strange that you say this, as you are also implying that *all* the >> widely-used

Control a process interactively (pexpect) and save data

2009-05-06 Thread Piotrek G.
Hi, I'm trying to use something like pexpect.interact() but I want to save all my inputs and save all outputs from the process (/bin/sh Linux). The main goal is to record all sequence of commands and responses in order to automatically generate pexpect script. My script is like below so far,

Python 3000 vs Perl 6

2008-06-23 Thread Corey G.
If Perl 6 ever does get on its feet and get released, how does it compare to Python 3000? Is Perl 6 more like Java now with Parrot? I just want to make sure that Python is staying competitive. If this is the wrong mailing list, just let me know. Thanks! -- http://mail.python.org/mailman/

Re: Python 3000 vs Perl 6

2008-06-24 Thread Corey G.
ng no, but I am curious as to what others think. :) -Thanks! On Jun 24, 2008, at 2:52 AM, [EMAIL PROTECTED] wrote: On Jun 24, 8:20 am, "Corey G." <[EMAIL PROTECTED]> wrote: If Perl 6 ever does get on its feet and get released, how does it compare to Python 3000? Is Perl 6 mor

  1   2   3   4   >