Re: How To Change Package Representation on Shell?

2020-04-01 Thread Abdur-Rahmaan Janhangeer
Having fun with packages Since i don't master packaging completely thought there was a __repr__.py protocol nearby! Might be useful maybe to replace it by a help message Kind Regards, Abdur-Rahmaan Janhangeer compileralchemy.com | github

Re: How To Change Package Representation on Shell?

2020-04-01 Thread Chris Angelico
On Thu, Apr 2, 2020 at 7:37 AM Rhodri James wrote: > > On 01/04/2020 21:22, Abdur-Rahmaan Janhangeer wrote: > > Greetings list, > > > > I have a custom package. > > > import package > package > > '> > > > > what do i have to modify from my package to have like > > > package > > Hi!

Re: How To Change Package Representation on Shell?

2020-04-01 Thread Rhodri James
On 01/04/2020 21:22, Abdur-Rahmaan Janhangeer wrote: Greetings list, I have a custom package. import package package '> what do i have to modify from my package to have like package Hi! Do you mean "How do I override the str() or repr() of a module"? I don't think you can. --

Re: How to change '\\' to '\'

2018-10-02 Thread Michael Torrie
On 10/02/2018 12:48 AM, Ethan Furman wrote: > Even for two-person, private email discussions I prefer the interleaved > replies -- in a week when I have to remind myself what was discussed it > is much easier to comprehend. Absolutely. I've been saved from embarrassment countless times because

Re: How to change '\\' to '\'

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 12:05 AM Dennis Lee Bieber wrote: > > On Tue, 2 Oct 2018 10:17:27 +0800, Jach Fong > declaimed the following: > > > >It was supposed that most discussant want to see the reply message > >instantly when they open the mail. They already know what is going on > >and no need

Re: How to change '\\' to '\'

2018-10-02 Thread Ethan Furman
On 10/01/2018 11:10 PM, Christian Gollwitzer wrote: Am 02.10.18 um 04:17 schrieb Jach Fong: It was supposed that most discussant want to see the reply message instantly when they open the mail. They already know what is going on and no need to pass through all those previous message. "top

Re: How to change '\\' to '\'

2018-10-02 Thread Christian Gollwitzer
Am 02.10.18 um 04:17 schrieb Jach Fong: It was supposed that most discussant want to see the reply message instantly when they open the mail. They already know what is going on and no need to pass through all those previous message. "top posting" seems more reasonable to me:-) You assume that

Re: How to change '\\' to '\'

2018-10-01 Thread William Ray Wing via Python-list
> On Oct 1, 2018, at 10:17 PM, Jach Fong wrote: > > Thanks for your info about how Windows supports the forward slash. > > I don't quit sure what is the meaning of "top posting" in your mail. > If its meaning (forgive me if I was wrong) is where the reply was put > in mail, I have reason of

Re: How to change '\\' to '\'

2018-10-01 Thread Jach Fong
Thanks for your info about how Windows supports the forward slash. I don't quit sure what is the meaning of "top posting" in your mail. If its meaning (forgive me if I was wrong) is where the reply was put in mail, I have reason of standing on the opposite side. It was supposed that most

Re: How to change '\\' to '\'

2018-10-01 Thread mm0fmf
On 01/10/2018 10:19, Jach Fong wrote: Hmmm...strange, I didn't see Rick's mail:-( Sure the forward slash is better, not to cause this confusion. But I am curious, since when, I mean, since which version Windows start to accept forward slash? First, stop top posting. Second, ISTR that all

Re: How to change '\\' to '\'

2018-10-01 Thread Peter J. Holzer
On 2018-10-01 17:19:25 +0800, Jach Fong wrote: > Sure the forward slash is better, not to cause this confusion. > But I am curious, since when, I mean, since which version > Windows start to accept forward slash? Since MS-DOS 2.0, i.e., before Windows even existed. Note that this is only true for

Re: How to change '\\' to '\'

2018-10-01 Thread Thomas Jollans
On 2018-10-01 11:19, Jach Fong wrote: > Hmmm...strange, I didn't see Rick's mail:-( That's because he's banned from the list, but still around on the newsgroup > Sure the forward slash is better, not to cause this confusion. > But I am curious, since when, I mean, since which version > Windows

Re: How to change '\\' to '\'

2018-10-01 Thread Jach Fong
Hmmm...strange, I didn't see Rick's mail:-( Sure the forward slash is better, not to cause this confusion. But I am curious, since when, I mean, since which version Windows start to accept forward slash? --Jach Alister ware via Python-list at 2018/10/1 PM 04:15 wrote: On Sun, 30 Sep 2018

Re: How to change '\\' to '\'

2018-10-01 Thread Alister ware via Python-list
On Sun, 30 Sep 2018 17:45:52 -0700, Rick Johnson wrote: > Jach Fong wrote: >> I get a string item, for example path[0], from path = >> os.get_exec_path() >> It's something like "\\Borland\\Bcc55\\Include", a Python string. >> I want to use this "string" in a subprocess command as a parameter. >>

Re: How to change '\\' to '\'

2018-09-28 Thread Jach Fong
Yes, you are right, it's just the way Python display the '\'. Thank you. Gregory Ewing at 2018/9/28 PM 02:02 wrote: Jach Fong wrote: I get a string item, for example path[0], from path = os.get_exec_path() It's something like "\\Borland\\Bcc55\\Include" It doesn't actually have double

Re: How to change '\\' to '\'

2018-09-28 Thread Gregory Ewing
Jach Fong wrote: I get a string item, for example path[0], from path = os.get_exec_path() It's something like "\\Borland\\Bcc55\\Include" It doesn't actually have double backslashes in it, that's just a result of how the string is being displayed. No conversion is needed. -- Greg --

Re: How to change variable from list to float

2017-06-05 Thread Peter Pearson
On Mon, 5 Jun 2017 11:13:54 +0100, Paul Barry wrote: > On 3 June 2017 at 15:42, Gary Barker wrote: > >> I have searched for a solution to this but have not found a suitable >> example. >> >> The attached code generates this error: Traceback (most recent call last): >>

Re: How to change variable from list to float

2017-06-05 Thread Paul Barry
The value in existattn is a single element list. The single element is a float, so just refer to it in your calculation, like so: siglevfromexist = 34.8 + existattn[0] Regards. Paul. On 3 June 2017 at 15:42, Gary Barker wrote: > I have searched for a solution to

Re: How to change the number into the same expression's string and vice versa?

2015-01-19 Thread Peter Otten
contro opinion wrote: In the python3 console: a=18 b='18' str(a) == b True int(b) == a True Now how to change a1,a2,a3 into b1,b2,b3 and vice versa? a1=0xf4 a2=0o36 a3=011 b1='0xf4' b2='0o36' b3='011' Python 3.4.0 (default, Apr 11 2014,

Re: How to change the number into the same expression's string and vice versa?

2015-01-19 Thread Jussi Piitulainen
Peter Otten writes: contro opinion wrote: Now how to change a1,a2,a3 into b1,b2,b3 and vice versa? a1=0xf4 a2=0o36 a3=011 b1='0xf4' b2='0o36' b3='011' Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type help, copyright, credits or license for more

Re: How to change the number into the same expression's string and vice versa?

2015-01-19 Thread Frank Millman
contro opinion contropin...@gmail.com wrote in message news:ca+ydq_651x0ndpw1j203wgbedtxy_mw7g0w3vh1woagr1iv...@mail.gmail.com... In the python3 console: a=18 b='18' str(a) == b True int(b) == a True Now how to change a1,a2,a3 into b1,b2,b3 and vice versa?

Re: How to change the number into the same expression's string and vice versa?

2015-01-19 Thread Peter Otten
Jussi Piitulainen wrote: Peter Otten writes: {:o}.format(0xf4) '364' To add a prefix just put it into the format string. There's also these (in Python 3.2.3): hex(0xf4) '0xf4' D'oh! -- https://mail.python.org/mailman/listinfo/python-list

Re: How to change the number into the same expression's string and vice versa?

2015-01-19 Thread Mark Lawrence
On 19/01/2015 09:01, contro opinion wrote: In the python3 console: a=18 b='18' str(a) == b True int(b) == a True Now how to change a1,a2,a3 into b1,b2,b3 and vice versa? a1=0xf4 a2=0o36 a3=011 b1='0xf4' b2='0o36' b3='011' Giving a completely different

Re: how to change the time string into number?

2014-08-20 Thread Akira Li
luofeiyu elearn2...@gmail.com writes: s=Aug how can i change it into 8 with some python time module? months = (None, # dummy, to start month indices from 1 Jan,Feb,Mar,Apr,May,Jun, Jul,Aug,Sep,Oct,Nov,Dec ) month_number = months.index(month_abbr) # month_abbr == Aug Note: -

Re: how to change the time string into number?

2014-08-15 Thread Denis McMahon
On Thu, 14 Aug 2014 14:52:17 +0800, luofeiyu wrote: in the manual https://docs.python.org/3.4/library/time.html %zTime zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal

Re: how to change the time string into number?

2014-08-14 Thread luofeiyu
in the manual https://docs.python.org/3.4/library/time.html %z Time zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal minute digits [-23:59, +23:59]. %Z Time zone name

Re: how to change the time string into number?

2014-08-14 Thread Ben Finney
Please don't top-post your response. Instead, interleave your response and remove irrelevant quoted material. Use the Interleaved style URL:https://en.wikipedia.org/wiki/Posting_style#Interleaved_style. luofeiyu elearn2...@gmail.com writes: in the manual

Re: how to change the time string into number?

2014-08-14 Thread luofeiyu
import sys sys.version '3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]' import time time.tzname ('China Standard Time', 'China Daylight Time') On 8/14/2014 3:25 PM, Cameron Simpson wrote: On 14Aug2014 14:52, luofeiyu elearn2...@gmail.com wrote: in the

Re: how to change the time string into number?

2014-08-14 Thread Cameron Simpson
On 14Aug2014 15:30, luofeiyu elearn2...@gmail.com wrote: import sys sys.version '3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]' First, please post in an interleaved style so that we can see your responses underneath the text to which they relate. Thanks.

Re: how to change the time string into number?

2014-08-14 Thread Cameron Simpson
On 14Aug2014 14:52, luofeiyu elearn2...@gmail.com wrote: in the manual  https://docs.python.org/3.4/library/time.html ┌──┬──┬─┐ │ │Time zone offset indicating a positive or negative time difference│ │ │%z│from UTC/GMT of

Re: how to change the time string into number?

2014-08-14 Thread Mark Lawrence
On 14/08/2014 02:46, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? If all else fails, read the instructions, so start here https://docs.python.org/3/library/datetime.html#module-datetime -- My fellow Pythonistas, ask not what our language can do for you,

Re: how to change the time string into number?

2014-08-14 Thread Roy Smith
In article mailman.12994.1408021090.18130.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Thu, 14 Aug 2014 17:47:00 +1000, Cameron Simpson c...@zip.com.au declaimed the following: Your Android phone will be running some flavour of Linux I believe. Someone who

Re: how to change the time string into number?

2014-08-14 Thread Ben Finney
Dennis Lee Bieber wlfr...@ix.netcom.com writes: Android /is/ the flavor G Though Google has probably done some things to it that make it not-Linux. Android is definitely Linux, since that is the kernel Android runs. Remember that Linux is not an operating system; it is one part,

Re: how to change the time string into number?

2014-08-14 Thread Denis McMahon
On Thu, 14 Aug 2014 09:46:20 +0800, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? You don't need a time module for this, just use a dictionary: months = { Jan : 1, . , Dec: 12 } num = months[s] print num Fill in the rest of the months dictionary

Re: how to change the time string into number?

2014-08-13 Thread Chris Angelico
On Thu, Aug 14, 2014 at 11:46 AM, luofeiyu elearn2...@gmail.com wrote: s=Aug how can i change it into 8 with some python time module? Is this homework? If not, let me set you some homework. Step 1: Read the docs for some Python time module. Step 2: See if it lets you do what you want. Step 3:

Re: how to change the time string into number?

2014-08-13 Thread Ben Finney
luofeiyu elearn2...@gmail.com writes: s=Aug how can i change it into 8 with some python time module? What is your purpose here? If you want to parse a text value into a structured time object, don't do it piece by piece. Use the ‘time.strptime’ function. import time input_time_text

Re: how to change the time string into number?

2014-08-13 Thread Tim Chase
On 2014-08-14 09:46, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? import time s = Aug time.strptime(s, %b).tm_mon 8 works for me. -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: how to change the time string into number?

2014-08-13 Thread Tim Chase
On 2014-08-13 21:01, Tim Chase wrote: On 2014-08-14 09:46, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? import time s = Aug time.strptime(s, %b).tm_mon 8 works for me. Or, if you want a more convoluted way: import calendar as c [i for

Re: how to change the time string into number?

2014-08-13 Thread YBM
Le 14/08/2014 04:16, Tim Chase a écrit : On 2014-08-13 21:01, Tim Chase wrote: On 2014-08-14 09:46, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? import time s = Aug time.strptime(s, %b).tm_mon 8 works for me. Or, if you want a more convoluted

Re: how to change the time string into number?

2014-08-13 Thread Ian Kelly
On Wed, Aug 13, 2014 at 8:51 PM, YBM ybm...@nooos.fr.invalid wrote: BTW, why iterators does not have such an index method ? Because iterators don't support indexing. In order to support such a thing, it would have to exhaust the iterator. iter(range(5))[3] Traceback (most recent call last):

Re: how to change the time string into number?

2014-08-13 Thread Roy Smith
In article 53ec2453$0$2299$426a7...@news.free.fr, YBM ybm...@nooos.fr.invalid wrote: Le 14/08/2014 04:16, Tim Chase a écrit : On 2014-08-13 21:01, Tim Chase wrote: On 2014-08-14 09:46, luofeiyu wrote: s=Aug how can i change it into 8 with some python time module? import time

Re: how to change the time string into number?

2014-08-13 Thread Marko Rauhamaa
Tim Chase python.l...@tim.thechases.com: Or, if you want a more convoluted way: import calendar as c [i for i, m in enumerate(c.month_abbr) if m == Aug].pop() 8 Let's not forget the much simpler solutions: def eight(x): return 8 ... eight(Aug) 8 and: 8 8

Re: how to change system-wide proxy settings by Python ?

2013-02-03 Thread Kwpolska
On Sun, Feb 3, 2013 at 4:34 PM, iMath redstone-c...@163.com wrote: I have already known a valid proxy server(63.141.216.159)and port(8087) which support both http and https protocols ,so how to change system-wide proxy settings to this proxy by Python ? I use WinXP ,can you show me an

Re: how to change system-wide proxy settings by Python ?

2013-02-03 Thread Michael Torrie
On 02/03/2013 08:34 AM, iMath wrote: I have already known a valid proxy server(63.141.216.159)and port(8087) which support both http and https protocols ,so how to change system-wide proxy settings to this proxy by Python ? I use WinXP ,can you show me an example of this ? thanks in advance !

Re: How to change colors of multiple widgets after hovering in Tkinter

2013-01-10 Thread Peter Otten
mountdoo...@gmail.com wrote: I´m trying to make a script, which will change the background and foreground color of widgets after hovering. but when I hover on any button, nothing happens, they stay white. I know I could use a function, but there would be two functions for every widget (1

Re: How to change colors of multiple widgets after hovering in Tkinter

2013-01-10 Thread Rick Johnson
On Thursday, January 10, 2013 1:13:38 PM UTC-6, Peter Otten wrote: mountdoom wrote: I´m trying to make a script, which will change the background and foreground color of widgets after hovering. Peter's advice is spot on except you may want ALL widgets to change colors on ENTER and LEAVE

RE: how to change os.popen4 to subprocess

2012-10-30 Thread Prasad, Ramit
Replying to skyworld because I could not find the original message from MRAB. skyworld wrote: On Oct 27, 11:02 am, MRAB pyt...@mrabarnett.plus.com wrote: On 2012-10-27 03:28, skyworld wrote: Hi, I'm new to python and I'm trying to porting some scripts from v0.96 to v2.0.1. A piece of

Re: how to change os.popen4 to subprocess

2012-10-27 Thread skyworld
On Oct 27, 11:02 am, MRAB pyt...@mrabarnett.plus.com wrote: On 2012-10-27 03:28, skyworld wrote: Hi, I'm new to python and I'm trying to porting some scripts from v0.96 to v2.0.1. A piece of code is like this: cmd_h = os.popen4(env['SYSCMDLINE'])[1] the system indicates the popen4 is

Re: how to change os.popen4 to subprocess

2012-10-26 Thread MRAB
On 2012-10-27 03:28, skyworld wrote: Hi, I'm new to python and I'm trying to porting some scripts from v0.96 to v2.0.1. A piece of code is like this: cmd_h = os.popen4(env['SYSCMDLINE'])[1] the system indicates the popen4 is deprecated and suggest to use subprocess. Can anybody tell me how to

Re: how to change os.popen4 to subprocess

2012-10-26 Thread Mark Lawrence
On 27/10/2012 03:28, skyworld wrote: Hi, I'm new to python and I'm trying to porting some scripts from v0.96 to v2.0.1. A piece of code is like this: What software are you talking about here, it's certainly not Python versions as the most up to date are 2.7.3 and 3.3.0? cmd_h =

Re: How to change the file creation timestamp?

2011-11-25 Thread Alec Taylor
import os import time from stat import * #returns a list of all the files on the current directory files = os.listdir('.') for f in files: #my folder has some jpegs and raw images if f.lower().endswith('jpg') or f.lower().endswith('crw'): st = os.stat(f) atime = st[ST_ATIME] #access

Re: How to change the file creation timestamp?

2011-11-25 Thread 刘振海
Hi Alec Thanks for your help. I want to change the creation timestamp. the code that you give is to change the modification and access time. I already find a solution using pywin32's win32file module import win32file filehandle = win32file.CreateFile(file_name, win32file.GENERIC_WRITE,

Re: How to change the file creation timestamp?

2011-11-25 Thread Steven D'Aprano
On Sat, 26 Nov 2011 00:51:34 +1100, Alec Taylor wrote: import os import time from stat import * #returns a list of all the files on the current directory files = os.listdir('.') for f in files: #my folder has some jpegs and raw images if f.lower().endswith('jpg') or

Re: how to change the order of a button, static text or other components

2011-10-21 Thread Ian Kelly
I assume you're arranging the components with a sizer. Remove them from the sizer, reinsert them in the order you want, and then call sizer.Layout(). Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list

RE: how to change the order of a button, static text or other components

2011-10-21 Thread Prasad, Ramit
what i want to do is,when i press a button, i change the order of selected components,how to do this? This is so vague, I am tempted to think it is spambut on the chance it is not, I need a lot more information than you are providing to even attempt to give you any guidance. 1. By button

Re: how to change the order of a button, static text or other components

2011-10-20 Thread Chris Rebert
On Thu, Oct 20, 2011 at 6:08 PM, install...@189.cn install...@189.cn wrote: what i want to do is,when i press a button, i change the order of selected components,how to do this? Which GUI toolkit are you using? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change the order of a button, static text or other components

2011-10-20 Thread install...@189.cn
On 10月21日, 上午9时26分, Chris Rebert c...@rebertia.com wrote: On Thu, Oct 20, 2011 at 6:08 PM, install...@189.cn install...@189.cn wrote: what i want to do is,when i press a button, i change the order of selected components,how to do this? Which GUI toolkit are you using? Cheers, Chris

Re: how to change a string into dictionary

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:03 PM, aimeixu aime...@amazon.com wrote: Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot .Really need help. Parse the string and re-create the dictionary. s =

Re: how to change a string into dictionary

2010-08-09 Thread Chris Rebert
On Mon, Aug 9, 2010 at 2:53 AM, Shashwat Anand anand.shash...@gmail.com wrote: On Mon, Aug 9, 2010 at 3:03 PM, aimeixu aime...@amazon.com wrote: Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot

Re: how to change a string into dictionary

2010-08-09 Thread Ulrich Eckhardt
aimeixu wrote: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} You could evaluate it as regular Python code, using exec: res = {} exec(a={'a':'1'}, res) print res['a'] However, if this is input from a file or the user, be aware that this opens

Re: how to change a string into dictionary

2010-08-09 Thread Daniel Urban
a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} See also the ast.literal_eval function: http://docs.python.org/py3k/library/ast.html#ast.literal_eval Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change when the logging module creates the log file?

2010-01-06 Thread Chris Colbert
i was able to fix the exception by calling logging.shutdown() before the call to os.remove(). However, I still think there is probably a more elegant solution. On Wed, Jan 6, 2010 at 12:57 PM, Chris Colbert sccolb...@gmail.com wrote: I have an application the writes to a log file when specific

Re: How to change string or number passed as argument?

2009-09-21 Thread Gabriel Genellina
En Sat, 19 Sep 2009 22:59:21 -0300, Peng Yu pengyu...@gmail.com escribió: I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them

Re: How to change string or number passed as argument?

2009-09-20 Thread Hendrik van Rooyen
On Sunday 20 September 2009 03:59:21 Peng Yu wrote: I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I

Re: How to change string or number passed as argument?

2009-09-20 Thread Simon Forman
On Sep 19, 9:59 pm, Peng Yu pengyu...@gmail.com wrote: Hi, I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class,

Re: How to change string or number passed as argument?

2009-09-19 Thread Tim Chase
I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I feel a little bit tedious. I am wondering what is the

Re: how to change response code in CGIHTTPServer.py

2009-05-29 Thread Jeff McNeil
On May 28, 2:23 pm, Daniel daniel.watr...@gmail.com wrote: Hello, Python 2.5.2 WinXP I'm using CGIHTTPServer.py and want to return a response code of 400 with a message in the event that the cgi script fails for some reason.  I notice that run_cgi(self): executes this line of code,

Re: How to change a generator ?

2008-12-24 Thread MRAB
Barak, Ron wrote: Hi, I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of file after first invocation. Namely, the file pointer

Re: How to change a generator ?

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:03:58 -0200, MRAB goo...@mrabarnett.plus.com escribió: I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of

Re: How to change a generator ?

2008-12-24 Thread MRAB
Gabriel Genellina wrote: En Wed, 24 Dec 2008 15:03:58 -0200, MRAB goo...@mrabarnett.plus.com escribió: I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text

RE: How to change a generator ? - resolved

2008-12-24 Thread Barak, Ron
. self.input_file.tell()== 0 26. self.input_file.tell()== 247 $ !wc wc -c sac.log.50lines 6623 sac.log.50lines $ -Original Message- From: MRAB [mailto:goo...@mrabarnett.plus.com] Sent: Wednesday, December 24, 2008 20:00 To: python-list@python.org Subject: Re: How to change a generator ? Gabriel Genellina

Re: how to change current working directory while using pdb within emacs

2007-11-26 Thread du yan ning
On Nov 21, 1:28 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: duyanningwrote: I have written a pyhton script that will process data file in current working directory. My script is in an different directory to data file. When I debug this script using pdb within emacs, emacs will change

Re: how to change current working directory while using pdb within emacs

2007-11-26 Thread R. Bernstein
duyanning [EMAIL PROTECTED] writes: I have written a pyhton script that will process data file in current working directory. My script is in an different directory to data file. When I debug this script using pdb within emacs, emacs will change the current working directory to the directory

Re: how to change current working directory while using pdb within emacs

2007-11-21 Thread Diez B. Roggisch
duyanning wrote: I have written a pyhton script that will process data file in current working directory. My script is in an different directory to data file. When I debug this script using pdb within emacs, emacs will change the current working directory to the directory which include the

Re: how could change backcolor of console?

2007-09-15 Thread buffi
On Sep 15, 3:55 pm, [EMAIL PROTECTED] wrote: Hi,everyone: I am a c programmer,and want using Python instead of C I can change backcolor using C,like this: textbackground(color); How can I do in Python? Best regards 点 击 此 处!免 费 试 玩 07 年 最 受 期 待 的 游 戏 大 作 ! textbackground() is

Re: How to change a PyObject passed to the C extension

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 09:43:19 -0700, MD wrote: I have a Python C extension which is passed a PyObject containing an integer value. Is it possible to change this same PyObject so that now the integer is of a different value? No it is not. Even if you poke around in the object ``struct``

Re: How to change menu text with Tkinter?

2006-10-01 Thread Scott David Daniels
Phil Schmidt wrote: Eric Brunel wrote: But Marc's answer still applies: it's a lot of work for something that will usually be configured once. So requiring to restart the tool when the UI language changes should be acceptable. Thanks for the example, that helps. I agree with you and Marc

Re: How to change menu text with Tkinter?

2006-09-27 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Phil Schmidt wrote: I am making a little Tkinter GUI app that needs to be in several languages (english, french, etc.), adjustable at runtime via a menu pick to select the language. The only way I can see to change text in the menus entries is to destroy them and

Re: How to change menu text with Tkinter?

2006-09-27 Thread Rob Wolfe
Phil Schmidt wrote: I am making a little Tkinter GUI app that needs to be in several languages (english, french, etc.), adjustable at runtime via a menu pick to select the language. The only way I can see to change text in the menus entries is to destroy them and recreate them usiing

Re: How to change menu text with Tkinter?

2006-09-27 Thread Eric Brunel
On Wed, 27 Sep 2006 15:29:32 +0200, Phil Schmidt [EMAIL PROTECTED] wrote: I am making a little Tkinter GUI app that needs to be in several languages (english, french, etc.), adjustable at runtime via a menu pick to select the language. The only way I can see to change text in the menus

Re: How to change menu text with Tkinter?

2006-09-27 Thread Phil Schmidt
Eric Brunel wrote: But Marc's answer still applies: it's a lot of work for something that will usually be configured once. So requiring to restart the tool when the UI language changes should be acceptable. Thanks for the example, that helps. I agree with you and Marc regarding the

Re: How to change font direction?

2006-09-18 Thread Frederic Rentsch
theju wrote: Well here are some self explanatory functions that I've written for displaying the text vertically and from right to left. As for rotation gimme some more time and i'll come back to you. Also I don't guarantee that this is the best method(cos I myself am a newbie), but I can

Re: How to change font direction?

2006-09-15 Thread theju
Well here are some self explanatory functions that I've written for displaying the text vertically and from right to left. As for rotation gimme some more time and i'll come back to you. Also I don't guarantee that this is the best method(cos I myself am a newbie), but I can guarantee you that it

Re: How to change the path for python binary?

2006-08-10 Thread Amit Khemka
On 8/10/06, Nico Grubert [EMAIL PROTECTED] wrote: Hi there, I have installed Python 2.3.5 on Suse Linux 10. If I enter python in the shell, the Python 2.3.5 interpreter is called. After I installed Python 2.4.3. the Python 2.4.3 interpreter is called which is the default behaviour I guess.

Re: How to change the path for python binary?

2006-08-10 Thread Alex Martelli
Nico Grubert [EMAIL PROTECTED] wrote: Hi there, I have installed Python 2.3.5 on Suse Linux 10. If I enter python in the shell, the Python 2.3.5 interpreter is called. After I installed Python 2.4.3. the Python 2.4.3 interpreter is called which is the default behaviour I guess. which

Re: how to change sys.path?

2006-05-25 Thread per9000
also se topic named 'problem(s) with import from parent dir: from ../brave.py import sir_robin ' I use this every day now: sys.path.append(../../py_scripts) best wishes, Per -- http://mail.python.org/mailman/listinfo/python-list

RE: how to change sys.path?

2006-05-25 Thread Michael Yanowitz
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of per9000 Sent: Thursday, May 25, 2006 4:07 AM To: python-list@python.org Subject: Re: how to change sys.path? also se topic named 'problem(s) with import from parent dir: from ../brave.py import sir_robin ' I use this every day now: sys.path.append

Re: how to change sys.path?

2006-05-25 Thread Ziga Seilnacht
Michael Yanowitz wrote: Is there something like a .pythoninitrc which can run whenever we start Python that can load a file with many sys.path.append(), etc? If not is there some way to modify the Python shell constructor and destructor? Thanks in advance: Michael yanowitz Yes, there is

Re: how to change sys.path?

2006-05-25 Thread John Salerno
Dennis Lee Bieber wrote: On Wed, 24 May 2006 17:24:08 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: Dennis Lee Bieber wrote: I may have gotten slightly confused That's my job. :) Okay: You have gotten me slightly confused G

Re: how to change sys.path?

2006-05-24 Thread Steve Holden
Ju Hui wrote: yes, we can change PYTHONPATH to add some path to sys.path value, but how to remove item from sys.path? That would be del sys.path[3] for example. Of course you may need to search sys.path to determine the exact element you need to delete, but sys.path is just like any other

Re: how to change sys.path?

2006-05-24 Thread John Salerno
Dennis Lee Bieber wrote: On Tue, 23 May 2006 20:21:10 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: I meant actually adding the PYTHONPATH variable to the environment variables list. You're looking at editing the Windows registry for that... I

Re: how to change sys.path?

2006-05-24 Thread Andrew Robert
Dennis Lee Bieber wrote: On Wed, 24 May 2006 14:45:55 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: I just right-clicked on My Computer -- Properties -- Advanced -- Environment Variables, and added a new one called PYTHONPATH. I don't know if that edits

Re: how to change sys.path?

2006-05-24 Thread John Salerno
Dennis Lee Bieber wrote: I may have gotten slightly confused That's my job. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-24 Thread Ju Hui
yes, we can add path to PYTHONPATH,but how to remove some items? my sys.path: import sys for x in sys.path: ... print x ... D:\usr\local\lib\site-packages\setuptools-0.6a11-py2.4.egg D:\usr\local\lib\site-packages\clientcookie-1.3.0-py2.4.egg c:\temp C:\WINDOWS\system32\python24.zip

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.append(write path of the module u r importing) Bye. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.path.append(path containing module to be imported) eg. sys.path.append(/home/webdoc) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread bruno at modulix
Ju Hui wrote: is python search module by paths in sys.path? sys.path is the list of path where the Python interpreter will search modules, yes. how to change it manuallly? manually ?-) You mean dynamically, by code ? If yes, it's just a list. You can modify it like you'd do for any other

Re: how to change sys.path?

2006-05-23 Thread Ju Hui
yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread John Salerno
Ju Hui wrote: yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? In Windows, at least, you can create

Re: how to change sys.path?

2006-05-23 Thread Jarek Zgoda
John Salerno napisał(a): yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? In Windows, at least, you

  1   2   >