Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements

17 Posted Topics

Member Avatar for trihaitran

This is a really simple question but it's been stumping me for a while. I want to open a file that is in the same directory as the .py script, but I want to specify that directory without using a universal path. filepath1 = '/Users/username/Documents/Python/TC/TC cedict final.txt' file = open(filepath1, …

Member Avatar for dev.vini
0
750
Member Avatar for trihaitran

Hi I am running OS X 10.5 Leopard. It ships with Python 2.5.1 and I just installed Python 2.5.4 from python.org. The site-packages directory for 2.5.1 is located at /Library/Python/2.5/site-packages The 2.5.1 interpreter is located at /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 The 2.5.4 interpreter is located at /Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 The thing is that now that …

Member Avatar for pythopian
0
194
Member Avatar for trihaitran

I am reading chapter two of the Pylons [url="http://pylonsbook.com/en/1.0/installing-pylons.html#quick-start-to-installation-for-the-impatient"]book[/url]. In the text I am told to run: [code]$ python virtualenv.py --no-site-packages env[/code] This is what I got back: [code]$ python virtualenv.py --no-site-packages env New python executable in env/bin/python Installing setuptools........... Complete output from command env/bin/python -c "#!python \"\"\"Bootstrap setuptoo... " …

0
67
Member Avatar for trihaitran

I just reinstalled OS X 10.5 Leopard on my laptop and restored my data/applications from a Time Machine backup. When I use urllib.urlopen() I get the following error: [code] >>> import urllib >>> u=urllib.urlopen(aUrl) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 82, in …

Member Avatar for trihaitran
0
135
Member Avatar for trihaitran

Hi I have two tables that I want to use to build a third. They have a many-to-one relationship for one of the columns. Table A has the "one" side of the many-to-one relationship. Table B has many rows that have foreign keys referencing Table A. I want to write …

Member Avatar for trihaitran
0
113
Member Avatar for trihaitran

I am trying to write a web scraper and am having trouble accessing pages that require authentication. I am attempting to utilise the mechanize library, but am having difficulties. The site I am trying to login is [url]http://www.princetonreview.com/Login3.aspx?uidbadge=[/url] user: [email][email protected][/email] pass: letmeinalready Previously I did something similar to another site: …

0
75
Member Avatar for trihaitran

Hi I am trying to pull some data from a Web site: [url]http://schoolfinder.com[/url] The issue is that I want to use the advanced search feature which requires logging into the Web site. I have a username and password, however I want to connect programmatically from Python. I have done data …

Member Avatar for trihaitran
0
226
Member Avatar for trihaitran

Hi, I've got about 10 functions that all share a bit of code. They all look something like this: [code=python] def func(arg): statement1 statement2 statement3 unique code statement4 statement5 [/code] Each function does similar statements at the beginning and end, but has unique stuff in the middle. Is there a …

Member Avatar for G-Do
0
120
Member Avatar for trihaitran

Hi, My problem is that I have a large function with hundreds of lines. I want to break it apart into smaller functions. The issue is that if I make a module level function, the scope changes and I have to pass the necessary variables to it. This can be …

Member Avatar for woooee
0
106
Member Avatar for trihaitran

Hi, I new to CSS and I can't seem to find the solution to my problem anywhere online. The page in question is [url=https://webfiles.berkeley.edu:443/hekevintran/public_html/test%20copy/programming.html]here[/url] Right now the page looks like this: [url=https://webfiles.berkeley.edu:443/hekevintran/public_html/have.jpg]here[/url] This is what I want it to look like: [url=https://webfiles.berkeley.edu:443/hekevintran/public_html/want.jpg]here[/url] I don't want any text to wrap around …

Member Avatar for trihaitran
0
123
Member Avatar for trihaitran

Hi, I'm writing a dictionary program with Turbogears that involves using Chinese text. There is an HTML form that has a dropdown menu, a text field and a button. The input from the form (in this case a Chinese character) is passed to one of my methods. The thing is …

0
61
Member Avatar for trihaitran

Hi I'm trying to start learning how to use Turbogears but I can't figure out how to install sqlite on my computer. I'm running Mac OS 10.4 and there are no precompiled binaries on the sqlite [URL="http://www.sqlite.org/download.html"]download[/URL] page for the Mac. They do list a cross-platform binaries that is stated …

0
74
Member Avatar for trihaitran

I am trying to run a Cherrypy tutorial from this site: [url]http://www.serpia.org/cherrypy[/url] It is giving me this error when I try to run the start.py: [code] bob-smiths-powerbook-g4-15:~/Desktop/CherryPyTutorial/cgi-bin bobsmith$ python start.py Traceback (most recent call last): File "start.py", line 21, in ? cherrypy.server.start() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/cherrypy/_cpserver.py", line 92, in start raise ValueError("No …

0
63
Member Avatar for trihaitran

Hi I know this sounds really stupid, but I cannot figure out how to run the wxPython demo program. I'm using OS X and I downloaded the latest demo/docs package. When I double click on the "wxPytho demo.app", there is a splash screen with the wxPython logo, but then there …

Member Avatar for leeqiang
0
343
Member Avatar for trihaitran

Hi I'm writing a programme that looks up data from 3 different Chinese dictionaries and then formats and displays them in html using the default browser of the system. So far it works well, but it could be better. The issue I have here is that I want each character …

0
72
Member Avatar for trihaitran

My *.py script has some non-ASCII characters in comment lines and when I run it I am getting the following warning: sys:1: DeprecationWarning: Non-ASCII character '\xe5' in file /Users/haitran/Documents/Sophomore UCB/Python/cedict.py on line 118, but no encoding declared; see [url]http://www.python.org/peps/pep-0263.html[/url] for details The thing is I went to the indicated page …

Member Avatar for trihaitran
0
167
Member Avatar for trihaitran

Hi I'm a completely new to computer programming and am looking to make an application that can search through 3 dictionaries using one input. The dictionaries are Chinese-English, Chinese-Vietnamese and another Chinese-English. The first one is taken from CEDICT, an open source dictionary in Unicode. I'm going to try to …

Member Avatar for vegaseat
0
163

The End.