Re: Algorithm. Tony Gaddis book 2 Starting python3

2013-01-27 Thread shi
Hello George, I found the book you're referring to via google (searching for: tony gaddis starting out with python). The question is this: 3. Write assignment statements that perform the following operations with the variables a,b and c. a. Adds 2 to a and assigns the result to b b. Multipli

Re: Algorithm. Tony Gaddis book 2 Starting python3

2013-01-27 Thread shi
d. Subtracts 8 from and assigns the result to a this should read: "Subtracts 8 from b and assigns the result to a" Funny how none of the assignments involve a variable c, despite the question :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Live Output from a Subprocess

2012-04-06 Thread shi
Maybe this can help you? http://technogems.blogspot.com/2012/01/capture-colored-console-output-in.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the selected tab in a enthought traits application

2013-09-15 Thread shi
Any ideas? I think you will have more chance for an answer in a more specialized list, e.g. the enthought-dev mailing list, which is also accessible via gmane: http:// dir.gmane.org / gmane.comp.python.enthought.devel Stefaan. -- https://mail.python.org/mailman/listinfo/python-list

Looking for download link for ArcPY

2012-09-08 Thread David Shi
Hi, All, Can anyone send me the link for downloading ArcPY? I came across it before, but can not find it anymore. Regards. David-- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 108, Issue 98

2012-09-12 Thread David Shi
Hi, Where do I find ArcPy.py? It seems that the link disappeared. Regards. David-- http://mail.python.org/mailman/listinfo/python-list

Looking for a simple, generic Python module to provide a secure web service

2012-02-29 Thread David Shi
We are looking for a very simple, generic Python module to provide a secure web service.   Ideally, it can be put onto the computer and make it available via IIS.   Off we go.   Your help will be gratefully received.   Regards.   David-- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 102, Issue 64

2012-03-13 Thread David Shi
I am looking very simple and straightforward open source Python REST and SOAP demo modules. I really need things which are very simple and convincing.   I want to demonstrate these to other people. I want to promote you guys' interest.   I find asp and others frustrating and occupy too much in

Looking for proven Python code for Line Simplication such as Douglas-Peucker

2012-05-08 Thread David Shi
Dear All, I am looking for  proven Python code for Line Simplication such as Douglas-Peucker. Regards. David -- http://mail.python.org/mailman/listinfo/python-list

How to call and execute C code in Python?

2012-05-13 Thread David Shi
Can anyone tell me how to call and exectute C code in Python? Regards. David From: "python-list-requ...@python.org" To: python-list@python.org Sent: Friday, 11 May 2012, 5:35 Subject: Python-list Digest, Vol 104, Issue 57 - Forwarded Message - Sen

How to call and execute C code in Python?

2012-05-15 Thread David Shi
sands of intervals covering ranges of days to weeks would be doable.  If instead you're talking about millions of ranges covering years to decades I'd start elsewhere. Emile On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: > Can anyone tell me how to call and exectute C code in Pyth

Looking for Python script for Vector Map simplification, preserving shape and topology

2012-05-17 Thread David Shi
Dear All, I am looking for Python script for Vector Map simplification, preserving shape and topology. Please get in touch with davidg...@yahoo.co.uk    Regards. David -- http://mail.python.org/mailman/listinfo/python-list

While stack:

2012-06-01 Thread David Shi
Can any one clarify what "while stack:" mean? Regards, David -- http://mail.python.org/mailman/listinfo/python-list

Where is the latest step by step guide to use Jython to compile Python into Java?

2012-06-04 Thread David Shi
Hello, Where is the latest step by step guide to use Jython to compile Python into Java? I found that it was very confusing by reading not updated text. Please help. Regards. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread David Shi
software or instructions. Please provide assistance, by providing the tested software and instructions. Regards. David From: "Narayanaswamy, Mohan" To: David Shi Cc: python-list@python.org Sent: Monday, 4 June 2012, 15:56 Subject: RE: Where is

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread David Shi
: "Narayanaswamy, Mohan" To: David Shi Cc: python-list@python.org Sent: Monday, 4 June 2012, 16:38 Subject: RE: Where is the latest step by step guide to use Jython to compilePython into Java? David,   Thanks for the link, here that compilation steps won’t produce  java code, but it co

Has theHas Python community got Alan Saalfeld et al's algorithm and source code implementation

2012-06-05 Thread David Shi
Dear Python community friends, I wonder whether there is such a Python implementation available. Alan Saalfeld et al's algorithm and source codes. http://books.google.ie/books/about/A_Modified_Douglas_Peucker_Simplificatio.html?id=gbQjywAACAAJ&redir_esc=y In Zhiyuan Zhao and Alan Saafeld's pap

Where is the lastest step by step guide to compile Python into an executable?

2012-06-07 Thread David Shi
Hi, folks. Where is the lastest step by step guide to compile Python into an executable? Regards. David -- http://mail.python.org/mailman/listinfo/python-list

Re: tree representation of Python data

2023-02-08 Thread Shaozhong SHI
What is the robust way to use Python to read in an XML and turn it into a JSON file? JSON dictionary is actually a tree. It is much easier to manage the tree-structured data. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Automated data testing, checking, validation, reporting for data assurance

2021-09-29 Thread Shaozhong SHI
There appear to be a few options for this. Has anyone tested and got experience with automated data testing, validation and reporting? Can anyone enlighten me? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Definitive guide for Regex

2021-09-30 Thread Shaozhong SHI
Dear All, I am trying to look for a definitive guide for Regex in Python. Can anyone help? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Definitive guide for Regex

2021-10-01 Thread Shaozhong SHI
? Regards, David On Thu, 30 Sept 2021 at 22:02, Barry Scott wrote: > > > > On 30 Sep 2021, at 19:35, dn via Python-list > wrote: > > > > On 01/10/2021 06.16, Barry Scott wrote: > >> > >> > >>> On 30 Sep 2021, at 12:29, Shaozhong SHI >

Connecting to MS accdb and read data into Pandas

2021-10-12 Thread Shaozhong SHI
I tried the following code: import pyodbc conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D:\my.accdb;') cursor = conn.cursor() cursor.execute('select * from table_name') for row in cursor.fetchall(): print (row) But I could not connect to .accdb. What is the

SQLAlchemy fault

2021-10-20 Thread Shaozhong SHI
I read a txt file into Pandas Dataframe, and found a lot of nulls in a column. Then, I used SQLAlchemy and psycopg2. I created engine. I loaded data onto PostgreSQL. Strange thing happened. The column has no null at all. Does it mean that the data has been modified somewhere along the line?

Alternatives to Jupyter Notebook

2021-10-20 Thread Shaozhong SHI
Hello, Is anyone familiar with alternatives to Jupyter Notebook. My Jupyter notebook becomes unresponsive in browsers. Are there alternatives to read, edit and run Jupyter Notebook? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

df.count() to a Pandas dataframe with column names

2021-10-21 Thread Shaozhong SHI
How to output the result of df.count() to a Pandas dataframe with column names? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

How to store the result of df.count() as a new dataframe in Pandas?

2021-10-26 Thread Shaozhong SHI
Hello, The result of df.count() appears to be a series object. How to store the result of df.count() as a new dataframe in Pandas? That is data anyhow. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Python script seems to stop running when handling very large dataset

2021-10-29 Thread Shaozhong SHI
Python script works well, but seems to stop running at a certain point when handling very large dataset. Can anyone shed light on this? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script seems to stop running when handling very large dataset

2021-10-30 Thread Shaozhong SHI
On Saturday, 30 October 2021, Dieter Maurer wrote: > Shaozhong SHI wrote at 2021-10-29 23:42 +0100: > >Python script works well, but seems to stop running at a certain point > when > >handling very large dataset. > > > >Can anyone shed light on this? > > Som

How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
I defined a function and apply it to a column in Pandas. But it does not return correct values. I am trying to test which url in a column full of url to see which one can be connected to or not def connect(url): try: urllib.request.urlopen(url) return True except:

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sunday, 31 October 2021, Albert-Jan Roskam wrote: > > > > df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) > > > I think you need axis=0. Or use the Series, df['URL'] = > df.URL.apply(connect) > Any details? I will try and let you know. Regards, David -- https://mail.python.org/ma

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sunday, 31 October 2021, MRAB wrote: > On 2021-10-31 17:25, Shaozhong SHI wrote: > >> I defined a function and apply it to a column in Pandas. But it does not >> return correct values. >> >> I am trying to test which url in a column full of url to see which one

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sun, 31 Oct 2021 at 19:28, MRAB wrote: > On 2021-10-31 18:48, Shaozhong SHI wrote: > > > > On Sunday, 31 October 2021, MRAB wrote: > > > > On 2021-10-31 17:25, Shaozhong SHI wrote: > > > > I defined a function and apply it to a column

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sun, 31 Oct 2021 at 18:42, Shaozhong SHI wrote: > > > On Sunday, 31 October 2021, Albert-Jan Roskam > wrote: > >> >> >> > df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) >> >> >> I think you need ax

System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
How to configure to improve Python performance in a system like the following: Windows 10 System Processor Intel(R) Core(TM) i7-9700 CPU @3.60GHz, 3.60 GHz Installed memory (RAM) 32.0 GB (31.8 GB usable) System type: 64-bit Operating System, x64-based processor I found that the Python script wa

Re: System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
On Tue, 2 Nov 2021 at 00:09, MRAB wrote: > On 2021-11-01 23:02, Shaozhong SHI wrote: > > How to configure to improve Python performance in a system like the > > following: > > > > Windows 10 > > > > System > > > > Processor Intel(R) Core(TM)

Re: System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
On Tue, 2 Nov 2021 at 00:20, Shaozhong SHI wrote: > > > On Tue, 2 Nov 2021 at 00:09, MRAB wrote: > >> On 2021-11-01 23:02, Shaozhong SHI wrote: >> > How to configure to improve Python performance in a system like the >> > following: >> > >>

Installation of GeoPandas - failed at fiona

2021-12-01 Thread Shaozhong SHI
I am trying to install geopandas. I navigated to c:\programData|Anaconda3\Scripts> and typed in 'pip install geopandas'. It ran but failed at fiona. I tried import geopandas as gp, but Error Message says: No module names 'geopandas'. Can anyone help? Regards, David -- https://mail.python.org

ogr2ogr can not open gfs file when loading GML

2021-12-14 Thread Shaozhong SHI
My command line kept telling me that it ogr2ogr can not open gfs file. It does find it. I was trying to load GML onto PostGIS. Alternatively, how to specify XSD file to go along with reading GML files? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Can Python call and use FME modules and functions such as StreamOrderCalculator?

2021-12-23 Thread Shaozhong SHI
Can we do something like import an fme.something and make use of FME modules and functions? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

How to set environmental variables for Python

2022-01-17 Thread Shaozhong SHI
I got quite a few version of Python on my machine. How do I set environmental variables for Python 3.6.1 to work? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: How to set environmental variables for Python

2022-01-17 Thread Shaozhong SHI
Set Operation System but not disturbing existing setting. Only to add at the command line. Regards, David On Mon, 17 Jan 2022 at 10:57, dn via Python-list wrote: > On 17/01/2022 22.31, Shaozhong SHI wrote: > > I got quite a few version of Python on my machine. > > &

URLError:

2022-02-12 Thread Shaozhong SHI
The following is used in a loop to get response code for each url. print (urllib.request.urlopen(url).getcode()) However, error message says: URLError: Python 3.6.5 is being used to test whether url is live or not. Can anyone shed light on this? Regards, David -- https://mail.python.org/mai

Long running process - how to speed up?

2022-02-19 Thread Shaozhong SHI
I have a cvs file of 932956 row and have to have time.sleep in a Python script. It takes a long time to process. How can I speed up the processing? Can I do multi-processing? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Long running process - how to speed up?

2022-02-19 Thread Shaozhong SHI
Can it be divided into several processes? Regards, David On Saturday, 19 February 2022, Chris Angelico wrote: > On Sat, 19 Feb 2022 at 22:59, Karsten Hilbert > wrote: > > > > > > I have a cvs file of 932956 row and have to have time.sleep in a > Python > > > > script. It takes a long time to p

Re: Long running process - how to speed up?

2022-02-20 Thread Shaozhong SHI
On Sat, 19 Feb 2022 at 19:44, Mats Wichmann wrote: > On 2/19/22 05:09, Shaozhong SHI wrote: > > Can it be divided into several processes? > > Regards, > > David > > The answer is: "maybe". Multiprocessing doesn't happen for free, you > have to fi

Re: Re: Long running process - how to speed up?

2022-02-20 Thread Shaozhong SHI
On Sat, 19 Feb 2022 at 18:51, Alan Gauld wrote: > On 19/02/2022 11:28, Shaozhong SHI wrote: > > > I have a cvs file of 932956 row > > That's not a lot in modern computing terms. > > > and have to have time.sleep in a Python > > script. > > Why? Is it

Issues of pip install gdal and fiona

2022-03-06 Thread Shaozhong SHI
I downloaded .whl files for fiona and gdal to go with Python3.6.5. However, I am having trouble with red error messages. Though Gdal is now working, there is a warning message - Missing global ~ gdal: DRIVER_NAME declaration gdal_array,py Can anyone advise on how to resolve the issues? Regard

Missing global # gdal DRIVER_NAME declaration in gdal_array.py

2022-03-08 Thread Shaozhong SHI
The following warning kept coming up when running ogr2ogr. Warning 1: Missing global # gdal: DRIVER_NAME declaration in C:\Users\AppData\Local\Programs\Python\Python36\Lib\site-packages\osgeo\gdal_array.py What steps to be take to resolve this issue? Regards, David -- https://mail.python.org/m

ValueError: arrays must all be same length

2020-10-02 Thread Shaozhong SHI
Hello, I got a json response from an API and tried to use pandas to put data into a dataframe. However, I kept getting this ValueError: arrays must all be same length. Can anyone help? The following is the json text. Regards, Shao { "locationId": "1-1004508435", "providerId": "1-101641521

How to handle a dictionary value that is a list

2020-10-02 Thread Shaozhong SHI
Hi, All, I was trying to handle the value of "personRoles" in a part of json dictionary. Can anyone tell me various ways to handle this? Regards, Shao "regulatedActivities": [ { "name": "Accommodation for persons who require nursing or personal care", "code": "RA2", "con

Re: ValueError: arrays must all be same length

2020-10-05 Thread Shaozhong SHI
tten table? Apparently, the nested data is another table. Regards, Shao On Sun, 4 Oct 2020 at 13:55, Tim Williams wrote: > On Sun, Oct 4, 2020 at 8:39 AM Tim Williams wrote: > > > > > > > On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI > > wrote: > >

Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-18 Thread Shaozhong SHI
Are there Python ways to execute queries on PostgreSQL without getting data over? Are there ways just to fire off PostgreSQL queries and not get data into Python? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread Shaozhong SHI
Even worse is that, in some cases, an addition called serviceRatings as a key occur with new data unexpectedly. How to produce a robust Python/Panda script to coping with all these? Regards, David u'historicRatings': [{u'overall': {u'keyQuestionRatings': [{u'name': u'Safe', u'rating': u'Require

How to write differently to remove this type hint in Python 2.7?

2020-10-21 Thread Shaozhong SHI
Is there another way to do this? def greet(name: str) -> str: return "Hello, " + name greet File "", line 1 def greet(name: str) -> str: ^ SyntaxError: invalid syntax -- https://mail.python.org/mailman/listinfo/python-list

Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Shaozhong SHI
I found this last option is very interesting. Saving the dataframe to memory using StringIO https://naysan.ca/2020/06/21/pandas-to-postgresql-using-psycopg2-copy_from/ But, testing shows unicode argument expected, got 'str' Any working example for getting DataFrame into a PostgreSQL table direc

Re: Questions about XML processing?

2020-11-07 Thread Shaozhong SHI
Hi, Hernan, Did you try to parse GML? Surely, there can be very concise and smart ways to do these things. Regards, David On Fri, 6 Nov 2020 at 20:57, Hernán De Angelis wrote: > Thank you Terry, Dan and Dieter for encouraging me to post here. I have > already solved the problem albeit with a

ssl connection has been closed unexpectedly

2020-11-28 Thread Shaozhong SHI
Hi, I keep getting the following error when I use engine = create_engine(logging in details to postgres) df.to_sql('table_name', and etc.) OperationalError: (psycopg2.OperationalError) SSL connection has been closed unexpectedly (Background on this error at: http://sqlalche.me/e/13/e3q8) Operat

How to record full error message for debugging with nbconvert?

2020-11-28 Thread Shaozhong SHI
Hi, When I use nbconvert to run Jupyter notebook, it is so difficult to see the full error message for debugging? How to save full error messages? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

How to run Jupyter notebook in command line and get full error message?

2020-11-28 Thread Shaozhong SHI
How to run Jupyter notebook in command line and get full error messages? My VPN keeps dropping and can not run Jupyter Notebook as it is. I started to use nbconvert in command line. But, when it stops due to error, I can not see where the error occurs. In order to make life easier for debugging

Observing long running processes of Jupyter Notebook

2020-12-03 Thread Shaozhong SHI
We have been running Jupyter Notebook processes, which take long time to run. We use nbconvert to run these in commandline. Nbconvert only writes output into a file at the end. We just wonder whether there is a way to observe the progress and printing messages when nbconvert is running. Regards

divide

2005-10-06 Thread Shi Mu
I have three points in a rectangle and i wonder how to use PYTHON to divide the rectangle into three parts with each point located in the different part. For instance, Point A goes to Part I, Point B goes to Part II and Point C goes to Part III. And the distance between any point within Part I and

is there any Python code for spatial tessellation?

2005-10-08 Thread Shi Mu
is there any Python code for spatial tessellation? thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: is there any Python code for spatial tessellation?

2005-10-09 Thread Shi Mu
is there any course website about teaching python? for instance, some computer science courses website? On 10/8/05, Shi Mu <[EMAIL PROTECTED]> wrote: > is there any Python code for spatial tessellation? > thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

line

2005-10-09 Thread Shi Mu
There are four points with coordinates: 2,3;4,9;1,6;3,10. How to use Python to draw one perpendicular bisector between (2,3) and (4,9); the other perpendicular bisector between (1,6)和(3,10); then, makes the output like: l1 a b c l2 a b c (Note: l indicates the perpendicular bisector with equation a

Re: line

2005-10-10 Thread Shi Mu
it is not a homework, just interested. On 10 Oct 2005 00:04:23 -0700, gsteff <[EMAIL PROTECTED]> wrote: > Why do you want to know? This list isn't a tool to get others to do > your homework. > > Greg > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman

output

2005-10-14 Thread Shi Mu
After I run the following python code, I expect to have the printing such as: The year is 2005 However, I got something like: The year is 2005 Fri Oct 14 17:43:31 2005 Fri Oct 14 17:43:31 2005 The year is 2005 What is the reason? The code follows: import time import now class today(now.now):

path

2005-10-19 Thread Shi Mu
I have installed Python 2.3 and I type "help()" and then "Keywords". I get a list of words. And it says that I can enter any of the words to get more help. I enter "and" and I get the following error message: "Sorry, topic and keyword documentation is not available because the Python HTML document

path

2005-10-19 Thread Shi Mu
I have installed Python 2.3 and I type "help()" and then "Keywords". I get a list of words. And it says that I can enter any of the words to get more help. I enter "and" and I get the following error message: "Sorry, topic and keyword documentation is not available because the Python HTML document

Re: path

2005-10-22 Thread Shi Mu
what is the differenc ebetween index and find in the module of string? for both "find" and "index", I got the position of the letter. -- http://mail.python.org/mailman/listinfo/python-list

index and find

2005-10-22 Thread Shi Mu
what is the difference between index and find in the module of string? for both "find" and "index", I got the position of the letter. On 10/19/05, Shi Mu <[EMAIL PROTECTED]> wrote: > I have installed Python 2.3 and I type "help()" and then "Keywords&q

ABOUT FIND

2005-10-24 Thread Shi Mu
I got confused by the following information from the help for "FIND": find(s, *args) find(s, sub [,start [,end]]) -> in what does *args mean (especially the '*')? also, in the sub, why put a comma before start? what does 'in' mean? -- http://mail.python.org/mailman/listinfo/python-list

Print in PythonWin

2005-10-24 Thread Shi Mu
In the PythonWin's interactive window, why sometimes I need type the command two times to make it work? for example, I execute "print testList" two times to make it work. Why? >>> print testList >>> print testList ['w', 'e', ' ', 'w', 'a', 'n', 't', ' ', 't', 'o', ' ', 'l', 'e', 'a', 'r', 'n', ' ',

difference after remove

2005-10-24 Thread Shi Mu
Is there any difference if I remove the '/' from the following statement? intMatrix2 = [[1,1,2,4,1,7,1,7,6,9],\ [1,2,5,3,9,1,1,1,9,1],\ [0,0,5,1,1,1,9,7,7,7]] print intMatrix2 I removed one '\' and it still works. So what is the use of '\'? -- http://mail.python.org/mailm

pickle

2005-10-24 Thread Shi Mu
I got a sample code and tested it but really can not understand the use of pickle and dump: >>> import pickle >>> f = open("try.txt", "w") >>> pickle.dump(3.14, f) >>> pickle.dump([1,2,3,4], f) >>> f.close() -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle

2005-10-25 Thread Shi Mu
what does the following code mean? y = pickle.load(file("cnumber.pickle", "r")) also, I can not understand "f" in pickle.dump(x, f) On 10/25/05, marduk <[EMAIL PROTECTED]> wrote: > On Mon, 2005-10-24 at 23:55 -0700, Shi Mu wrote: > > I got a

cell and row

2005-10-25 Thread Shi Mu
I can not understand the use of "cell" and "row" in the code: # convert the matrix to a 1D list matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]] items = [cell for row in matrix for cell in row] print items -- http://mail.python.org/mailman/listinfo/python-list

Re: cell and row

2005-10-25 Thread Shi Mu
27;defenestrate'] >>> for x in a[:]: ... if len(x) > 4: a.insert(0, x) ... >>> a ['defenestrate', 'window', 'defenestrate', 'defenestrate', 'cat', 'window', 'defenestrate'] On 10/25/05, Fred

Tk

2005-10-28 Thread Shi Mu
When I run the following code, script kept running and I have to force it to stop. Could you check the code to give suggestions how to improve it? Thanks a lot! from Tkinter import * from Tkinter import _cnfmerge class Dialog(Widget): def __init__(self, master=None, cnf={}, **kw): cnf =

Re: Tk

2005-10-30 Thread Shi Mu
How can I make the main menu come first, and after clicking test/just try, "how are you" interface shows. Thanks a lot! from Tkinter import * from Tkinter import _cnfmerge class Dialog(Widget): def __init__(self, master=None, cnf={}, **kw): cnf = _cnfmerge((cnf, kw)) self.widgetName

click event

2005-11-06 Thread Shi Mu
I have the following workable code and every time i click on the canvas, the coordinates are reported. i wonder how i can draw the lines when i click the canvas using these coordinates? from Tkinter import * root = Tk() c = Canvas(root, bg='#0e2e0e', height=500, width=1000) def click(event):

image

2005-11-08 Thread Shi Mu
why the following code report the error: Traceback (most recent call last): File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\Python23\Examples\AppB\text.py", line 24, in ? text.image_create(EN

Re: image

2005-11-08 Thread Shi Mu
yes. I use both cmd and pythonwin to run it. why both of them can not work? On 11/8/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > > why the following code report the error: > > Traceback (most recent call last): > > File > > "C:\P

any python module to calculate sin, cos, arctan?

2005-11-08 Thread Shi Mu
any python module to calculate sin, cos, arctan? -- http://mail.python.org/mailman/listinfo/python-list

parabola

2005-11-08 Thread Shi Mu
Is there any sample code to draw parabola using Tkinter? -- http://mail.python.org/mailman/listinfo/python-list

triangulation

2005-11-09 Thread Shi Mu
is there any sample code to triangulation? many thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: triangulation

2005-11-09 Thread Shi Mu
Delaunay triangulations On 11/9/05, Robert Kern <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > is there any sample code to triangulation? many thanks! > > Triangulation of what? Scattered points in a plane? 2D manifolds > embedded in a 3D space? > > Delaun

Re: [Tutor] triangulation

2005-11-10 Thread Shi Mu
gt; > > > > > > >>Or, do you mean radio triangulation by directional signal propagation > >> > >> > > > > > > > >>Or, do you mean drawing a triangle in Tkinter? > >> > >> > > > >Or even triangulation of currency from EU

about widget construction kit

2005-11-11 Thread Shi Mu
ut? On 11/11/05, Salvatore Di Dio <[EMAIL PROTECTED]> wrote: > If you mean trigonometrics calculus > give a try at > http://online.effbot.org/2004_09_01_archive.htm#tkinter-complex > and download too WCK http://effbot.org/zone/tkinter-index.htm > there is a demo on Lissajou &

Re: about widget construction kit

2005-11-11 Thread Shi Mu
On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > > I tried to install WCK(Widget Construction Kit (WCK)): > > > > C:\Python23>python tkinter3000-1.0-20031212\setup.py install > > Traceback (most recent call last): > > File &qu

Re: directory listing

2005-11-11 Thread Shi Mu
On 11 Nov 2005 22:00:04 GMT, Michael Konrad <[EMAIL PROTECTED]> wrote: > Richard Townsend <[EMAIL PROTECTED]> wrote: > > > On 11 Nov 2005 21:20:33 GMT, SU News Server wrote: > > > > Try passing the full pathname of each item to os.path.isdir() > > > > You can create the pathname using os.path.join(

Re: directory listing

2005-11-11 Thread Shi Mu
On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > > I tried this and no error reported but nothing appear on the console, why? > > > > import os > > > > def buildList( directory='c:\TEMP' ): > > dirs = [ ] > &

Re: about widget construction kit

2005-11-11 Thread Shi Mu
On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > > > > I tried to install WCK(Widget Construction Kit (WCK)): > > > > > > > > C:\Python23>python tkinter3000-1.0-20031212\setup.py install > > > > Traceback (m

Re: directory listing

2005-11-11 Thread Shi Mu
On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "Shi Mu" wrote: > > > but i am curious why the line of "print x" does not show > > anything. > > because your c:\temp directory is empty ? > > print buildList() gets lots of stuffs f

x, y coordinates in Tkinter canvas

2005-11-11 Thread Shi Mu
got confused by x, y coordinates in Tkinter canvas. from left to right, does X increase? from top to bottom, does y increase? -- http://mail.python.org/mailman/listinfo/python-list

Re: about widget construction kit

2005-11-11 Thread Shi Mu
On 11 Nov 2005 16:06:37 -0800, Martin Miller <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > 1. pass in the full path to the executable: > > > > > >cd tkinter3000-1.0-20031

Re: about widget construction kit

2005-11-12 Thread Shi Mu
very hard for me to understand the difference between try...except and try...finally -- http://mail.python.org/mailman/listinfo/python-list

about try statement

2005-11-12 Thread Shi Mu
very hard for me to understand the difference between try...except and try...finally -- http://mail.python.org/mailman/listinfo/python-list

about array,arange

2005-11-12 Thread Shi Mu
i got confused by the use of array and arange. arange get array and range get list, why we need the two different types? -- http://mail.python.org/mailman/listinfo/python-list

Re: about array,arange

2005-11-12 Thread Shi Mu
On 11/12/05, Robert Kern <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > i got confused by the use of array and arange. > > arange get array and range get list, why we need the two different types? > > When you're asking questions about a third-party module, it'

  1   2   >