On 24/02/2019 23:25, boB Stepp wrote:
>> Secondarily, resizeterm() does not make a change to the terminal itself.
>
> I realized this before I sent my original post. I really think the
> name chosen, resizeterm, is a very misleading name!
Only in a world of GUIs.
Remember that curses is pre GUI
On Sun, Feb 24, 2019 at 4:40 PM Cameron Simpson wrote:
> I've modified your script. Please try the script appended below. The
> short answer is that resizeterm() is _not_ normally useful to you, the
> programmer; it will only be useful if curses does not get to notice
> terminal size changes - _t
All is is_term_resized, resizeterm and the "internal" resize_term
functions are recent additions :-) From "man 3 resizeterm":
This extension of ncurses was introduced in mid-1995. It was
adopted in NetBSD curses (2001) and PDCurses (2003).
For some definition of "recent" :)
I have an
On 24Feb2019 17:48, boB Stepp wrote:
On Sun, Feb 24, 2019 at 2:52 PM Mats Wichmann wrote:
If it's snippets you want, I always look at programcreek. These are
always part of something bigger so they may not fit your request to have
them be something you can run.
https://www.programcreek.com/p
On Sun, Feb 24, 2019 at 2:52 PM Mats Wichmann wrote:
>
> On 2/24/19 1:30 PM, boB Stepp wrote:
>
> > So what am I misunderstanding? Can someone show me a code snippet
> > that I can run which will demonstrate the usefulness and usage of
> > curses.resizeterm()?
> >
> > TIA!
> >
>
> If it's snippet
On Sun, Feb 24, 2019 at 4:40 PM Cameron Simpson wrote:
>
> On 24Feb2019 14:30, boB Stepp wrote:
> >What you say makes sense and supports much of what I had concluded
> >from my coding experiments. However, I still cannot get the function
> >call, curses.resizeterm(), to do anything meaningful,
On 24Feb2019 22:51, Mark Lawrence wrote:
As I know squat about the curses module is this a time when a bug
report could be put into the docs to clarify things, or do you have to
know something about curses before you try using the Python wrapper?
Well, both.
The Python curses module is mostl
On 24/02/2019 22:39, Cameron Simpson wrote:
On 24Feb2019 14:30, boB Stepp wrote:
On Sun, Feb 24, 2019 at 1:39 AM Cameron Simpson wrote:
It looks like the resizeterm() function updates the curses _internal_
records of what it believes the physcial terminal size to be. When you
physically resi
On 24Feb2019 14:30, boB Stepp wrote:
On Sun, Feb 24, 2019 at 1:39 AM Cameron Simpson wrote:
It looks like the resizeterm() function updates the curses _internal_
records of what it believes the physcial terminal size to be. When you
physically resize a terminal the processes within it receive
On 2/24/19 1:30 PM, boB Stepp wrote:
So what am I misunderstanding? Can someone show me a code snippet
that I can run which will demonstrate the usefulness and usage of
curses.resizeterm()?
TIA!
If it's snippets you want, I always look at programcreek. These are
always part of something b
On Sun, Feb 24, 2019 at 1:39 AM Cameron Simpson wrote:
> It looks like the resizeterm() function updates the curses _internal_
> records of what it believes the physcial terminal size to be. When you
> physically resize a terminal the processes within it receive a SIGWINCH
> signal, and those wh
On 24/02/2019 05:00, boB Stepp wrote:
> curses.resizeterm(nlines, ncols)¶
>
> Resize the standard and current windows to the specified dimensions,
> and adjusts other bookkeeping data used by the curses library that
> record the window dimensions (in particular the SIGWINCH handler).
>
>
> Afte
On 23Feb2019 23:00, boB Stepp wrote:
I am trying to understand the functionality that the Python module,
curses, provides. But I am stuck on how to use the command,
curses.resizeterm(nlines, ncols). At
https://docs.python.org/3/library/curses.html#curses.resizeterm it says:
curses.resizeterm
I am trying to understand the functionality that the Python module,
curses, provides. But I am stuck on how to use the command,
curses.resizeterm(nlines, ncols). At
https://docs.python.org/3/library/curses.html#curses.resizeterm it says:
curses.resizeterm(nlines, ncols)¶
Resize the standard an
Thanks Alan (and Mats)! It appears there are many ways to skin this cat!
On Sat, Aug 26, 2017 at 2:21 AM, Alan Gauld via Tutor wrote:
>
>> My objective: Determine who the currently logged in user is and
>> determine if that user is in my list of users that I have authorized
>> to use my program
> My objective: Determine who the currently logged in user is and
> determine if that user is in my list of users that I have authorized
> to use my programs.
In addition to Steve and Mats answers:
import os
os.getlogin() #-> 'alan'
os.getuid() #-> 1001
import pwd
pwd.getpwuid(os.getuid()) #
On Fri, Aug 25, 2017 at 8:33 PM, Steven D'Aprano wrote:
> On Fri, Aug 25, 2017 at 07:13:12PM -0500, boB Stepp wrote:
>
>> My objective: Determine who the currently logged in user is
>
> py> import os
> py> os.getlogin()
> 'steve'
Sweet! Much better. I did not scan the os modules closely enough
import getpass
getpass.getuser ()
depending on how fussy you want to be...
On August 25, 2017 6:13:12 PM MDT, boB Stepp wrote:
>SunOS 5.10, Python 2.4/2.6
>
>I ask forgiveness in advance as I cannot copy and paste into an email
>what I am doing on this system. So I will have to manually type
>
On Fri, Aug 25, 2017 at 07:13:12PM -0500, boB Stepp wrote:
> My objective: Determine who the currently logged in user is
py> import os
py> os.getlogin()
'steve'
> and
> determine if that user is in my list of users that I have authorized
> to use my programs.
That's probably best handled at t
SunOS 5.10, Python 2.4/2.6
I ask forgiveness in advance as I cannot copy and paste into an email
what I am doing on this system. So I will have to manually type
things, introducing the usual possibility of typos.
My objective: Determine who the currently logged in user is and
determine if that
On 07Aug2016 09:19, Alan Gauld wrote:
On 07/08/16 04:22, rishabh mittal wrote:
I am new to python and come from C language background. I couldn't able to
understand this
>>> def f(a, L=[]):
... L.append(a)
... return L
print(f(1))
[1]
print(f(2))
[1, 2]
[...]
In the first example
On 07/08/16 04:22, rishabh mittal wrote:
> I am new to python and come from C language background. I couldn't able to
> understand this
>
> >>> def f(a, L=[]):
> ... L.append(a)
> ... return L
> ...
>
print(f(1))
> [1]
>
print(f(2))
> [1, 2]
def f(a, L=10):
> ... L=
Hi
I am new to python and come from C language background. I couldn't able to
understand this
>>> def f(a, L=[]):
... L.append(a)
... return L
...
>>> print(f(1))
[1]
>>> print(f(2))
[1, 2]
>>> print(f(3))
[1, 2, 3]
>>> def f(a, L=10):
... L=10+a
... return L
...
>
On Fri, May 06, 2016 at 09:41:18PM -0700, ramakrishna reddy wrote:
> Dear All,
>
> In unittesting in python, how can I use variables of setUpModule() in tests?
>
> example:
>
> import unittest
>
> def setUpModule():
> b = 20 #> how can I use this variable in testa print
b here is a lo
Dear All,
In unittesting in python, how can I use variables of setUpModule() in tests?
example:
import unittest
def setUpModule():
b = 20 #> how can I use this variable in testa print
class A(unittest.TestCase):
def testa(self):
a = 10
print(a + b)
if __name__ ==
On Sun, Sep 13, 2015 at 12:29 AM, Manju M
wrote:
>
> Assume that I will pass IP and port information from a function to open the
> telnet session. have opened the telnet session and after opening the telnet
> session I returned telnet object to calling function.
Hi Manju,
I apologize for potent
On 13/09/15 08:29, Manju M wrote:
Assume that I will pass IP and port information from a function to open the
telnet session. have opened the telnet session and after opening the telnet
session I returned telnet object to calling function.
That makes sense so far. Unfortunately its hard to rea
Hello all,
First I would like thank you for creating such good platform for discussing
python..!!!
Assume that I will pass IP and port information from a function to open the
telnet session. have opened the telnet session and after opening the telnet
session I returned telnet object to calling fu
In a message of Fri, 17 Jul 2015 22:49:16 -0500, boB Stepp writes:
>> ... On the other hand, kivy
>> ought to work for you. http://kivy.org/#home I've yet to try it on
>> a windows tablet, though.
>
>I think it was you who mentioned this GUI framework on the main python
>list fairly recently. In
On Fri, Jul 17, 2015 at 10:13 PM, Laura Creighton wrote:
> The place to ask this question is
> https://mail.python.org/mailman/listinfo/tkinter-discuss but I think you are
> out of luck...
This would explain why I am having trouble finding much information.
I *think* I could get things to work
The place to ask this question is
https://mail.python.org/mailman/listinfo/tkinter-discuss but I think you are
out of luck. On the other hand, kivy
ought to work for you. http://kivy.org/#home I've yet to try it on
a windows tablet, though.
Laura
__
On 17/07/15 23:04, boB Stepp wrote:
that complex gestures are not supported by tkinter. But will tkinter
see:
1) Short presses as a left mouse click?
2) Long presses as a right mouse click?
3) Virtual keyboard events the same as physical keyboard events?
4) Etc. ?
I'd go to the Tk and Tkint
On Fri, Jul 17, 2015 at 5:32 PM, Mark Lawrence wrote:
> A possible starter
> http://sumerulabs.in/blog/2015/02/21/touch-screen-for-the-new-raspberry-pi-2-available-in-india-sumerulabs/
> ???
I had briefly glanced at that, but other than a short snippet of code,
it seemed to be more an advertisem
On 17/07/2015 23:04, boB Stepp wrote:
Apparently I will be finding myself having to write some programs to
run on a Samsung Slate tablet, manufactured circa 2011. It has
Windows 7 home edition 64-bit as its OS. Hopefully Python 3 will be
easily installed, and I will be able to run Python 3 prog
Apparently I will be finding myself having to write some programs to
run on a Samsung Slate tablet, manufactured circa 2011. It has
Windows 7 home edition 64-bit as its OS. Hopefully Python 3 will be
easily installed, and I will be able to run Python 3 programs on it.
Operating under this assumpt
On Wed, Apr 29, 2015 at 11:38 PM, Dave Angel wrote:
> On 04/30/2015 12:28 AM, boB Stepp wrote:
>>
>> The main danger as I see it is that if I am not careful, then the code
>> on the dev environment could diverge from the state of code on my
>> Windows PC, i.e., I forgot to do the scp part. But whe
On 30/04/15 05:28, boB Stepp wrote:
That is what I have implemented as of today. I installed Git on my
Windows PC where I have been doing my actual coding
This is off topic but due to your peculiar restrictions might
be useful so I thought I'd bring it up.
Do you have Cygwin installed on your
In a message of Wed, 29 Apr 2015 23:28:59 -0500, boB Stepp writes:
>The main danger as I see it is that if I am not careful, then the code
>on the dev environment could diverge from the state of code on my
>Windows PC, i.e., I forgot to do the scp part. But when I am actively
>working on a section
On 04/30/2015 12:28 AM, boB Stepp wrote:
The main danger as I see it is that if I am not careful, then the code
on the dev environment could diverge from the state of code on my
Windows PC, i.e., I forgot to do the scp part. But when I am actively
working on a section of code I always insert a fe
On Wed, Apr 29, 2015 at 10:39 PM, Cameron Simpson wrote:
> On 29Apr2015 22:10, boB Stepp wrote:
>> On the smart enterprise where we (now) do our clinical planning they
>> are very strict: no installing any external software; no accessing the
>> Internet; no email; etc. Not all centers adhere to
On 29Apr2015 22:10, boB Stepp wrote:
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote:
On 29Apr2015 12:12, boB Stepp wrote:
... (3) install git if needed ...
It seems Git is needed, but I am not allowed to install it on the
Solaris workstation. So is there a way around this?
What d
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote:
> On 29Apr2015 12:12, boB Stepp wrote:
>>>
>>> ... (3) install git if needed ...
>>
>>
>> It seems Git is needed, but I am not allowed to install it on the
>> Solaris workstation. So is there a way around this?
>
>
> What do you mean by "ins
On 29Apr2015 12:12, boB Stepp wrote:
... (3) install git if needed ...
It seems Git is needed, but I am not allowed to install it on the
Solaris workstation. So is there a way around this?
What do you mean by "install"? Bear in mind that while you may be forbidden
from installing git in the
- Original Message -
> From: boB Stepp
> To: tutor
> Cc:
> Sent: Wednesday, April 29, 2015 7:12 PM
> Subject: Re: [Tutor] How to use Git from Windows PC for files on Solaris
> machine where Git cannot be installed?
>
> On Wed, Apr 29, 2015 at 12:04 PM, Alb
Glad things are going better.
Next step. Can you get git running on your solaris machines? Easiest is
if it is already installed or if the powers that be will install it
for you.
But if not, you ought to be able to build your own git from source
and run it on your Solaris machines.
This li
On 29/04/15 18:12, boB Stepp wrote:
But uhhm, this is not Python at all ;-)
I was hoping for clemency on this point due to the earlier thread(s) I
started (Which included Python's unittest module.).
I've been blurring the lines on this one because version control
is something everyone should
On Wed, Apr 29, 2015 at 12:04 PM, Albert-Jan Roskam wrote:
>
> --
> On Wed, Apr 29, 2015 4:21 PM CEST boB Stepp wrote:
>
>>I now have Git installed on my Windows 7 PC at work. The files that I
>>wish to put under Git version control exist on a Solaris 10
>>workstation.
--
On Wed, Apr 29, 2015 4:21 PM CEST boB Stepp wrote:
>I now have Git installed on my Windows 7 PC at work. The files that I
>wish to put under Git version control exist on a Solaris 10
>workstation. In the Git bash provided, I can ssh into the Solaris 10
>machine. I a
I now have Git installed on my Windows 7 PC at work. The files that I
wish to put under Git version control exist on a Solaris 10
workstation. In the Git bash provided, I can ssh into the Solaris 10
machine. I also can the CuteFTP program on my Windows PC to
move/copy/etc. files between the two mac
On Mon, Jan 19, 2015 3:32 PM CET jarod...@libero.it wrote:
>Dear All,
>I would like to understand how work this funcion:
>
>def parse_illumina_readset_file(illumina_readset_file):
>readsets = []
>samples = []
>
>log.info("Parse readset " + illumina_readset
jarod...@libero.it wrote:
> Dear All,
> I would like to understand how work this funcion:
>
> def parse_illumina_readset_file(illumina_readset_file):
[snip code by someone who has yet to learn how to use dicts;)]
> return readsets
>
>
> parser_illumina_readset_file("~/Desktop/file.csv")
Hi,
> parser_illumina_readset_file("~/Desktop/file.csv")
>
> dir()
>
> I can't found the readsets list. Someone could please help me?
> thanks so much!
Maybe:
readsets = parser_illumina_readset_file("~/Desktop/file.csv")
In your call, you discard the result, which, obviously, discards it.
-
Dear All,
I would like to understand how work this funcion:
def parse_illumina_readset_file(illumina_readset_file):
readsets = []
samples = []
log.info("Parse readset " + illumina_readset_file + " ...")
readset_csv = csv.DictReader(open(illumina_readset_file, 'rb'),
delimiter='\t
On Sun, Oct 12, 2014 at 12:17 AM, Danny Yoo wrote:
> Huh. Wow. That actually worked?
>
> :P
>
> ---
>
> Frankly speaking though, this sounds like a horrible XSRF-style attack
> in waiting, if I understand what has just happened.
> (http://en.wikipedia.org/wiki/Cross-site_request_forgery)
>
> Us
>> I need to call this URL: steam://friends/add/
>>
>> If I put it in my browser and press enter it works as expected, now I need
>> to do this on my code, I don't need to retrieve anything, I just need it to
>> be "executed", is there a way to do that in Python with requests or any
>> other lib?
On Sat, Oct 11, 2014 at 7:58 PM, Juan Christian
wrote:
> Sorry for triple post, but yes, webbrowser worked 100%. Exactly what I
> needed!
Huh. Wow. That actually worked?
:P
---
Frankly speaking though, this sounds like a horrible XSRF-style attack
in waiting, if I understand what has just h
On Sat, Oct 11, 2014 at 11:47 PM, Danny Yoo wrote:
> This may be more difficult to do; it's unclear whether or not this is
> exposed in the web API that Valve provides.
>
> Unlike the other methods described in:
>
> https://developer.valvesoftware.com/wiki/Steam_Web_API
>
> which are all quer
Sorry for triple post, but yes, webbrowser worked 100%. Exactly what I
needed!
Thanks!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sat, Oct 11, 2014 at 11:53 PM, Danny Yoo wrote:
> >> I need to call this URL: steam://friends/add/
> >>
> >> If I put it in my browser and press enter it works as expected, now I
> need
> >> to do this on my code, I don't need to retrieve anything, I just need
> it to
> >> be "executed", is th
On Sat, Oct 11, 2014 at 7:29 PM, Juan Christian
wrote:
> I need to call this URL: steam://friends/add/
>
> If I put it in my browser and press enter it works as expected, now I need
> to do this on my code, I don't need to retrieve anything, I just need it to
> be "executed", is there a way to do
I need to call this URL: steam://friends/add/
If I put it in my browser and press enter it works as expected, now I need
to do this on my code, I don't need to retrieve anything, I just need it to
be "executed", is there a way to do that in Python with requests or any
other lib?
Python 3.4.1
On 13/01/2014 17:30, S Tareq wrote:
can you please help me how to use 2to3 on 3.3. i went to the web site
follow instraction and it did not work.
Providing a sizeable wedge of code and stating "it did not work" is
pretty useless. But I'd guess that you've run the code *WITHOUT* the -w
flag.
On Mon, Jan 13, 2014 at 9:30 AM, S Tareq wrote:
> can you please help me how to use 2to3 on 3.3. i went to the web site follow
> instraction and it did not work.
When asking for debugging help, it is usually a very good idea to
provide as much detail about what you exactly did as you can.
Specifi
can you please help me how to use 2to3 on 3.3. i went to the web site follow
instraction and it did not work.
# Import statements
import random
import datetime
#Arrays to store the definitions and keywords read from the file
keywords=[];
definition=[];
correctAnswer=[];
#Counter for the wrong A
On 27/07/2012, Jerry Hill wrote:
...
inspect.getargspec(logging.log)
> ArgSpec(args=['level', 'msg'], varargs='args', keywords='kwargs',
> defaults=None)
...
> Also, the help object itself is written in python. You can look at
> the source in pydoc.py
On 27/07/2012, Steven D'Aprano wrote:
David wrote:
Please help me understand the following (I have python 2.6.2) ...
Because I want to write nice docstrings, I read PEP257 where it says:
"The one-line docstring should NOT be a "signature" reiterating the
function/method parameters (which can be obtained by introspection)."
As a ge
On Thu, Jul 26, 2012 at 9:48 AM, David wrote:
> A related question:
> help() seems to do the introspection for me. Does python allow me to do it in
> my own code? Specifically, how might I write my own function to mimic line 3
> of
> help(), appearing like so:
>
my_function(logging.log)
> "l
Please help me understand the following (I have python 2.6.2) ...
Because I want to write nice docstrings, I read PEP257 where it says:
"The one-line docstring should NOT be a "signature" reiterating the
function/method parameters (which can be obtained by introspection)."
I am understanding this
Please don't top post and please reply to the list
Top posting fixed.
- Forwarded Message -
From: Lion Chen
To: Mark Lawrence
Cc:
Sent: Friday, 6 April 2012, 16:43
Subject: Re: [Tutor] How to use g_timeout_add () function?
fixed top posting
> On 06/04/2012 15:17, Lion Ch
On 06/04/2012 15:17, Lion Chen wrote:
Hello all, i have a question:
when i check gtk_time_out in the gtk+2 reference, it said "
|gtk_timeout_add|has been deprecated since version 2.4 and should not be
used in newly-written code. Use |g_timeout_add()|instead."
but i don't know how tu use the g_t
> Hello all, i have a question:
>
> when i check gtk_time_out in the gtk+2 reference, it said " gtk_timeout_add
> has been deprecated since version 2.4 and should not be used in newly-written
> code. Use g_timeout_add() instead."
>
> but i don't know how tu use the g_timout_add() function:
> m
Hello all, i have a question:
when i check gtk_time_out in the gtk+2 reference, it said "
|gtk_timeout_add|has been deprecated since version 2.4 and should not be
used in newly-written code. Use |g_timeout_add()|instead."
but i don't know how tu use the g_timout_add() function:
my_id = g_timeout_
शंतनू wrote:
Using re module:
===
import re
strNum = raw_input("enter numbers, separated by space: ")
if re.search('[^\d ]', strNum):
print('Invalid input')
else:
data = [int(x) for x in strNum.split()]
print(data)
This is not Perl, where everything is a nail that needs to be ham
On 08-Dec-2011, at 7:13 PM, Dario Lopez-Kästen wrote:
> oh, yes, no top posting. See below.
>
> On Thu, Dec 8, 2011 at 1:33 PM, surya k wrote:
>
> This is something I am trying to do..
> Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
> directly as numbers. how can
On Thu, Dec 8, 2011 at 7:43 AM, Dario Lopez-Kästen wrote:
>
>
> In that case a for loop with a try-except would better:
>
> strNum = raw_input("enter numbers, separated by space: ").split()
> num_list = []
>
> for token in strNum:
> try:
> num_list.append(int(token))
> except Valu
oh, yes, no top posting. See below.
On Thu, Dec 8, 2011 at 1:33 PM, surya k wrote:
>
> This is something I am trying to do..
> Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
> directly as numbers. how can I do it?
> I could put that numbers as string but not as numbe
This is something I am trying to do..
Say, we are entering a string "1 2 3 4 5".so, I want to assign the numbers
directly as numbers. how can I do it?
I could put that numbers as string but not as number..
strNum = raw_input('enter:').split()
I can convert the list into numbers by doing this...
f
Mic wrote:
Say that I want to try and open 10 files. If none of these exists, I
want an error
message to appear. But only if NONE of these files exists.
I know how to handle this with one file. But I don't know how to do that
with more than one.
So the program should try and open all 10 files
On 2011-11-27 17:58, Mic wrote:
Say that I want to try and open 10 files. If none of these exists, I want an
error
message to appear. But only if NONE of these files exists.
I know how to handle this with one file. But I don't know how to do that
with more than one.
So the program should try and
Mic wrote:
class SeatButton(tk.Button):
def __init__(self, master, index):
text = str(index+1)
super(SeatButton, self).__init__(master,
text=text, bg=FREE,
command=self.clicked)
s
Jia-Yu Aw wrote:
> How to use __iter__
> Von:
> Jia-Yu Aw
> Antwortadresse:
> Jia-Yu Aw
> Datum:
> Dienstag, 9. August 2011 03:48:20
> An:
> tutor@python.org
> Gruppen:
> gmane.comp.python.tutor
> Hi all
>
> I've been learning Classes and have read the documentation on __iter__ but
st
Hi all
I've been learning Classes and have read the documentation on __iter__ but
still don't understand how it works. I have two pieces of code: the first is
def __iter__, the second is using __iter__. Instead of being an iterator, I'm
just using this is a function, which I think is incorrect.
On 04/08/2011 11:13 AM, leechau wrote:
Steven wrote:
leechau wrote:
I wrote module1 in package1, and want to use a method named
'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
[...]
When i run test.py, the output is:
AttributeError: 'module
Steven wrote:
leechau wrote:
I wrote module1 in package1, and want to use a method named 'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
[...]
When i run test.py, the output is:
AttributeError: 'module' object has no attribute 'module1'
File
leechau wrote:
> I wrote module1 in package1, and want to use a method named 'method1' in
> module1, the caller(test.py) is like this:
>
> import package1
> package1.module1.method1()
[...]
> When i run test.py, the output is:
> AttributeError: 'module' object has no attribute 'module1'
> File "e:
I wrote module1 in package1, and want to use a method named 'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
module1.py is like this:
def method1():
print 'method1 run!'
The filesystem structure is:
test.py
package1
|__ __init__.py
|__ m
I hate to jump on this one a little late, but even getattr() is kind
of ghetto (though exec/eval is worse ;).
For setting up shell scripts or CLIs, the usual route is the optparse module.
- Japhy
2011/3/15 Yaşar Arabacı :
> Thanks for excellent explanations. I almost got this working. I just hav
Thanks for excellent explanations. I almost got this working. I just
have one more problem, that is:
When user enter incorrect number of arguments for a method, I naturally
get a type error. I could probably fix that with try and catch, but that
is not very explanatory to the user. Is there a
On 3/14/2011 8:49 PM, Yaşar Arabacı wrote:
As I try to implement things with getattr, I am getting a really
strange error. This is my file:
Various interspersed comments:
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
class global_variables:
It is customary to start class names with an uppe
As I try to implement things with getattr, I am getting a really strange
error. This is my file:
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
class global_variables:
"Holds class attributes, so that other classes can share them"
products = 0
best_bundle = []
class dispa
Yaşar Arabacı wrote:
And What I want to do is a small economy application. It will work this
way:
user add a product name, rate how much it like it over 10, and enter its
price.
[repeated as many times as wanted]
user will enter h(is|er) budget.
user will use "calcute bundle" to show much
Before being able to see 3rd answer, I did something like this and it
worked for me:
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
def command_dispatcher():
"Takes comman line arguments and executes regardin method"
command = raw_input(">>>")
args = command.split(" ")
Prasad, Ramit wrote:
Take a look at:
http://stackoverflow.com/questions/701802/how-do-i-execute-a-string-containing-python-code-in-python
And then please don't do it. eval and exec should be treated as the last
resort, and then only if you really know what you are doing. They are
slow, and da
Yaşar Arabacı wrote:
Hi
I am trying to do something like this:
If you are trying to write a mini-language, the ``cmd`` and ``shlex``
modules in the standard library may be useful to you.
#!/usr/bin/env python
def command_dispatcher():
"Takes comman line arguments and executes regardi
: tutor-bounces+ramit.prasad=jpmchase@python.org
[mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Yasar
Arabaci
Sent: Monday, March 14, 2011 4:16 PM
To: tutor@python.org
Subject: [Tutor] How to use a str object, to find the class in exact name?
Hi
I am trying to do
Hi
I am trying to do something like this:
#!/usr/bin/env python
def command_dispatcher():
"Takes comman line arguments and executes regardin method"
command = raw_input(">>>")
args = command.split(" ")
args[0].args[1]
class calculate:
def bundle(self):
On 02/27/10 00:31, Ricardo Aráoz wrote:
> Checked the manuals on pydoc and wanted to try it. Must certainly be
> doing something wrong but I can't figure what. Here's my session :
The pydoc command works from your system shell (e.g. bash), not python
shell; if you want to get help inside python's
--- On Fri, 2/26/10, Ricardo Aráoz wrote:
From: Ricardo Aráoz
Subject: [Tutor] How to use pydoc
To: tutor@python.org
Date: Friday, February 26, 2010, 8:31 AM
Checked the manuals on pydoc and wanted to try it. Must certainly be
doing something wrong but I can't figure what. Here's
Checked the manuals on pydoc and wanted to try it. Must certainly be
doing something wrong but I can't figure what. Here's my session :
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> p
Alan Gauld wrote:
>
>
> "elca" wrote
>
i want to use IE.navigate function with beautifulsoup or lxml..
if anyone know about this or sample.
>>> Why do you want to use navigate()? What are you trying to do?
>>> There is likely to be another way to do it from Python.
>
>> so why i
1 - 100 of 177 matches
Mail list logo