Re: Quick question about CPython interpreter

2022-10-17 Thread Chris Angelico
On Tue, 18 Oct 2022 at 03:51, Stefan Ram wrote: > > MRAB writes: > >It can't optimise that because, say, 'print' could've been bound to a > >function that rebinds 'str'. > > It would be possible to find out whether a call of a function > named "print" is to the standard function, but the over

Re: Quick question about CPython interpreter

2022-10-17 Thread MRAB
On 2022-10-17 16:43, David Lowry-Duda wrote: One can use the `dis` module and investigate the generated python bytecode. For me, I get # file "dis1.py" thing = 123 for i in range(10): if "hi" == str(thing): print("found") break The bytecode is then 1 0 L

Re: Quick question about CPython interpreter

2022-10-17 Thread David Lowry-Duda
One can use the `dis` module and investigate the generated python bytecode. For me, I get # file "dis1.py" thing = 123 for i in range(10): if "hi" == str(thing): print("found") break The bytecode is then 1 0 LOAD_CONST 0 (123) 2 STORE

Re: Quick question about CPython interpreter

2022-10-17 Thread Michael Torrie
On 10/14/22 16:25, DFS wrote: > - > this does a str() conversion in the loop > - > for i in range(cells.count()): >if text == str(ID): > break > > > ---

Re: Quick question, if you please

2015-03-31 Thread John Gordon
In John Kelly writes: > I received Python with another install and my update software keeps > signaling I need to install a newer version, and once I do, the older > version is still there, so I keep getting told I need to update. Should > I be able to uninstall the old version each time? Yes,

Re: Quick question, if you please

2015-03-31 Thread Russell Owen
On 3/31/15 10:09 AM, John Kelly wrote: Pythonites, I received Python with another install and my update software keeps signaling I need to install a newer version, and once I do, the older version is still there, so I keep getting told I need to update. Should I be able to uninstall the old vers

Re: Quick Question About Setting Up Pytz

2014-10-20 Thread Mark Lawrence
On 19/10/2014 21:18, Ryan Shuell wrote: Ok, thanks everyone. I just need to spend more time with this stuff. It's definitely slow going. Please don't top post on this list, thank you. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. M

Re: Quick Question About Setting Up Pytz

2014-10-20 Thread Ryan Shuell
Ok, thanks everyone. I just need to spend more time with this stuff. It's definitely slow going. On Sat, Oct 18, 2014 at 11:16 PM, Rustom Mody wrote: > On Sunday, October 19, 2014 8:25:53 AM UTC+5:30, Ben Finney wrote: > > Chris Angelico writes: > > > > Try learning Python itself, rather than

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Rustom Mody
On Sunday, October 19, 2014 8:25:53 AM UTC+5:30, Ben Finney wrote: > Chris Angelico writes: > > Try learning Python itself, rather than playing around with extension > > packages like pytz. > To be fair, "You need to install 'pytz' to work correctly with date and > time values" is correct advice.

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Chris Angelico
On Sun, Oct 19, 2014 at 1:54 PM, Ben Finney wrote: > Chris Angelico writes: > >> Try learning Python itself, rather than playing around with extension >> packages like pytz. > > To be fair, “You need to install ‘pytz’ to work correctly with date and > time values” is correct advice. If the OP doe

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Ben Finney
Chris Angelico writes: > Try learning Python itself, rather than playing around with extension > packages like pytz. To be fair, “You need to install ‘pytz’ to work correctly with date and time values” is correct advice. If the OP doesn't install it early, then works with timestamps, problems ar

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Ben Finney
ryguy7272 writes: > So, when I run it, the setup.py text file opens. Nothing runs; nothing > installs. You have somehow (either manually, or by answering a question to some program) associated the ‘.py’ suffix with “Open this file in my text editor”. That's fine, but it means that if you don't

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Chris Angelico
On Sun, Oct 19, 2014 at 1:44 PM, ryguy7272 wrote: > I'll probably give it until the end of the year, and start learning Chinese. > There's other things I want to do with my time. I know 10 programming > languages. I thought it would be fun to learn Python, but after 2 months, I > still can't

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread ryguy7272
On Saturday, October 18, 2014 3:55:02 PM UTC-4, ryguy7272 wrote: > I downloaded PYTZ and put it here. > > C:\Python27\pytz > > > > Now, in the cmd window, I typed this: > > C:\Python27\pytz\setup.py > > > > A text file opens and nothing else happens. I thought it was supposed to > install

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Mark Lawrence
On 18/10/2014 20:54, ryguy7272 wrote: I downloaded PYTZ and put it here. C:\Python27\pytz Now, in the cmd window, I typed this: C:\Python27\pytz\setup.py A text file opens and nothing else happens. I thought it was supposed to install the PYTZ library. What am I doing wrong? You will end

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Joel Goldstick
On Sat, Oct 18, 2014 at 3:54 PM, ryguy7272 wrote: > I downloaded PYTZ and put it here. > C:\Python27\pytz > > Now, in the cmd window, I typed this: > C:\Python27\pytz\setup.py > > A text file opens and nothing else happens. I thought it was supposed to > install the PYTZ library. > > What am I d

Re: Quick question about threads and interpreters.

2011-07-31 Thread Chris Angelico
On Mon, Aug 1, 2011 at 6:04 AM, Ira Gray wrote: > I come along, write a .DLL and throw it into the program. My .dll has its > own thread (right?), Not unless you actually create one. A DLL is simply a puddle of code; the application calls your code, you do whatever you do, you return. At no time

Re: Quick question about None and comparisons

2008-11-25 Thread Giampaolo Rodola'
Ok thanks. I'll avoid to do that. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick question about None and comparisons

2008-11-24 Thread Chris Rebert
On Mon, Nov 24, 2008 at 5:52 PM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Sorry for the title but I didn't find anything more appropriate. > To have a less verbose code would it be ok doing: > > if a > b: > > ...instead of: > > if a is not None and a > b: > > ...? > Is there any hidden compli

Re: Quick question about None and comparisons

2008-11-24 Thread r
On Nov 24, 7:52 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Sorry for the title but I didn't find anything more appropriate. > To have a less verbose code would it be ok doing: > > if a > b: > > ...instead of: > > if a is not None and a > b: > > ...? > Is there any hidden complication behi

Re: Quick Question

2006-06-22 Thread Alexis Roda
En/na xkenneth ha escrit: > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get arou

Re: Quick Question

2006-06-22 Thread Carl J. Van Arsdall
xkenneth wrote: > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get around > this?

Re: Quick Question

2006-06-22 Thread Bruno Desthuilliers
xkenneth a écrit : > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get around > th

Re: Quick Question regarding Frames

2006-03-30 Thread Dave Mandelin
I'm glad to have helped. Good luck with your project. -- Want to play tabletop RPGs over the internet? Check out Koboldsoft RPZen:http://www.koboldsoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Question regarding Frames

2006-03-29 Thread Chris Seymour
Hi Dave, Thanks for taking the time to reply to my posts. It really heped me understand this better. Thanks again. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Question regarding Frames

2006-03-29 Thread Dave Mandelin
Hi again. frameA in the __init__ is a parameter that is required to be the FrameA object that is creating the FrameB. In my example, I was assuming that the FrameB is created in a method of FrameA, so I created it passing self as frameA: w2 = FrameB(self, None, -1,"") w2.Show() --

Re: Quick Question regarding Frames

2006-03-28 Thread Chris S
HI Dave, Thanks for the reply. I am a bit confused by this piece of code: class FrameB(wx.Frame): def __init__(self, frameA, ...): self.frameA = frameA What is frameA in the __init__ definition? Do I need to create something called frameA in order to pass it to that __init__ func

Re: Quick Question regarding Frames

2006-03-28 Thread Dave Mandelin
Chris S wrote: > Hello All, > Just starting out with Python and wxPython. I have two Frames, FrameA > and FrameB. FrameA opens FrameB when a button on FrameA is clicked. I > can get this. Now I want a button on FrameB to update a control on > FrameA. I am having an issue with this. Can anyone

Re: Quick Question regarding Frames

2006-03-28 Thread Chris S
A little further clarification. FrameA and FrameB are in different modules. Thanks. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: quick question

2005-03-08 Thread Peter Hansen
Simon Brunning wrote: On Mon, 7 Mar 2005 18:58:20 -0500, Leeds, Mark <[EMAIL PROTECTED]> wrote: I want to get rid of the beginning And ending quotes. my_string = '"8023 "' my_string.strip('"') '8023 ' Note the risk in this approach, as it blindly removes any number of leading and trailin

Re: quick question

2005-03-08 Thread Simon Brunning
On Mon, 7 Mar 2005 18:58:20 -0500, Leeds, Mark <[EMAIL PROTECTED]> wrote: > > I have a string variable say "8023 " and > > I want to get rid of the beginning > > And ending quotes. Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "cre

[Fwd: Re: quick question]

2005-03-08 Thread Neil Benn
-- Neil Benn Senior Automation Engineer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 154 e-mail : [EMAIL PROTECTED] Cenix Website : http://www.cenix-bioscience.com --- Begin Message --- Leeds, Mark wrote: I have a string variable say “8023 “ and

Re: quick question

2005-03-07 Thread Steve Holden
Leeds, Mark wrote: I have a string variable say “8023 “ and I want to get rid of the beginning And ending quotes. I’ve tried different things But haven’t had any success. I’m definitely a python hacker and Not an expert. Thanks. >>> x = '"This is a quoted string"' >>> print x "This is a

Re: quick question

2005-03-07 Thread Daniel Bickett
If you simply wanted to get rid of quotes entirely, you could use: "\"Hello!\"".replace( "\"" , "" ) However, since you only want the beginning and ending quotes removed: >>> string = "\"If thou wert my fool, nuncle...\"" >>> print string "If thou wert my fool, nuncle..." >>> if string.startswi