Change by Cong Monkey <congzhan...@gmail.com>:
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: -> behavior
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
New submission from Cong Monkey <congzhan...@gmail.com>:
Embedded 3.6.0 distribution does not insert script parent in sys.path[0], but
the normal python do it.
this make some failed, like when I try to do pip install future, it will failed
as import src.future failed, which works for
Hi,
i wonderd if there is a way to convert a py-file to a exe-file with version 3.x
of python.
I know that it was possible till version 2.7.x. But is there a way to do it in
version 3.x?
Yours sincerely,
Monkey
--
http://mail.python.org/mailman/listinfo/python-list
Good evening. I am trying to write an application in Python that will allow
a person to insert a CD into their computer and this python script will
convert the music to mp3.
NOTE: I have already google'd this, and nothing really pops out at me. I
found tons of applications that does this, but
I have a question about WXPython and using inline images. The code that I
have included into this email comes from the following URL:
http://www.daniweb.com/code/snippet654.html
As you can see from the code below, that this application will take an
inline JPG image, and will create a
I wrote some code below (Code1 block) which will read a pop3 email account
and will open each email in the inbox.
What I want my code to do is only pull the attachment; as you see below I
basically output everything. Is there an easy way to just pull
attachments? (NOTE, the only attachements
[EMAIL PROTECTED] wrote:
Sick Monkey wrote:
When I run the following command:
[EMAIL PROTECTED] david.huggins]# identify -format %w
'/someDIR/images/david.huggins/100_0264.JPG'
From Python interpreter:
cmd = identify -format %w test.jpg
p = subprocess.Popen(cmd.split(), stdout
I have the following:
OS = RedHat
ImagMagick installed.
Python v2.5
-
When I run the following command:
[EMAIL PROTECTED] david.huggins]# identify -format %w
'/someDIR/images/david.huggins/100_0264.JPG'
I get the following result
2304
However, when I try
Have you looked at the Tips and Tricks on Py2exe's website?
http://www.py2exe.org/index.cgi/GeneralTipsAndTricks
I believe this next link will help you add custom data to your app.
http://www.py2exe.org/index.cgi/CustomDataInExe
.dave
On 5/21/07, Pyro [EMAIL PROTECTED] wrote:
Hello,
I have
Here is a segment of some code that I have.
CODE:
--
print filename
params2 =
{'filename':filename,'id3title':title,'id3artist':artist,'id3album':album,'id3year':year,'id3track':track,'id3genre':genre,'uname':username,'password':password,'filesToUpload':open(file,
'rb')}
print
' in the 'print filename' line as it isn't
actually part of the data. You will see it in the 'print params2'
output, though, as I believe it relies on the string object's __repr__
function, which will include the unicode specifier.
-Jeff
On 5/19/07, Sick Monkey [EMAIL PROTECTED] wrote:
Here is a segment
I have the following code which will basically take an image file and create
a bitmap image. I am having one problem though in that there is a white
border around the image. Does anyone know how to take that off?
imageFile2 = image.png
image2 = wx.Image(imageFile2,
),.-%s % (i))
i += 1
req.write(filename)
%
The directory contains the following files: whoa.mp3 and whoa.mp3.-0.
This code will output whoa.mp3.-1.
On 5/9/07, Sick Monkey [EMAIL PROTECTED] wrote:
Hey guys. I wanted to write a little desktop application that would
upload files to an external
http://docs.python.org/tut/node7.html
Yes there is a pop function.
An example that uses most of the list methods:
a = [66.25, 333, 333, 1, 1234.5]
print a.count(333), a.count(66.25), a.count('x')
2 1 0
a.insert(2, -1)
a.append(333)
a
[66.25, 333, -1, 333, 1, 1234.5, 333]
a.index(333)
1
Hey guys. I wanted to write a little desktop application that would upload
files to an external server, to a specific directory.
The desktop application is running on Mac OS X and I built a .psp script
that is running on a Red Hat server.
NOTE: This application is written for Python 2.5 (both
Here is some code that could be useful It does not check the
directories for 0 files, but that shouldn't be too difficult to add.
#
from os import listdir, unlink
from os.path import isdir, isfile, islink, join, getmtime
deldir = C:\Some\Dir
Try this.
NOTE: The script below will compare lines of both files (even hidden
characters such as \n)...
def fopen(fname):
try:
return open(fname, 'U')
except IOError, detail:
return fail(couldn't open + fname
))
f1 = fopen('file1.txt')
a = f1.readlines(); f1.close()
d1 = {}
for c in a:
d1[c.lower()] = None
#print d1
f2 = fopen('file2.txt')
data = f2.readlines(); f2.close()
for line in data:
if d1.has_key( line.lower() ):
print line
On 4/5/07, Sick Monkey [EMAIL
If it is just the indentation that is bothering you, you could do this:
match = test
if match == 1:
print 1
elif match == 2:
print 2
elif match == test:
print test
On 4/2/07, Ernesto García García [EMAIL PROTECTED] wrote:
Hi experts,
How would you do this without the more and more
I use iTerm and it took me a while to get use to it as well. All you have
to do is go to Bookmarks- Manage Profiles Then expand Terminal Profiles
-Default and then for type select linux.
You may have to restart iTerm, but you will be able to do everything you can
in linux.
Let me know if that
Just by looking at the permission denied error, when you loaded the
MySQLdb module, were you using a specific user (is it owned by a specific
user)?
On 15 Mar 2007 17:33:29 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
Hi,
I'm trying to use MySQL Python module on Cygwin. Since there is
Maybe if you show us your code we can better assist you.
But maybe you can use a global variable or a try-catch method to keep
threads from staying alive and help better control your code.
On 3/12/07, Taylor, Stuart [EMAIL PROTECTED] wrote:
I have been working on running an external process
You will probably want to read this documentation:
http://pyinstaller.hpcf.upr.edu/docs/Manual_v1.1.html
Look carefully at the following sections on the documentation:
Building the runtime environment and Spec File and Spec File - EXE
Helpful Links
http://sourceforge.net/projects/cx-oracle
http://www.python.net/crew/atuining/cx_Oracle/html/cursorobj.html
==
Example:
Replace the data types as appropriate.
v_Vars = v_Cursor.setinputsizes(p_Result = cx_Oracle.NUMBER)
v_Cursor.execute(
begin
Have you tried to upgrade the current python RPM?
rpm -Uvh
You can also build from source. Once you get Python 2.4 up and running I am
pretty sure you can do a symbolic link on the python 2.3 application (either
in /usr/bin or /usr/sbin) and point it to the 2.4 python file.
On 8 Mar 2007
be distressed if you need to
update or install new RPMs.
On 3/8/07, ying lcs [EMAIL PROTECTED] wrote:
On 3/8/07, Sick Monkey [EMAIL PROTECTED] wrote:
Have you tried to upgrade the current python RPM?
rpm -Uvh
You can also build from source. Once you get Python 2.4 up and running
I am
(1) You may want to read the following links:
http://docs.python.org/dist/describing-extensions.html#SECTION00234
which came from:
http://docs.python.org/dist/dist.html
Here is another good resource for py2exe:
http://www.py2exe.org/index.cgi/GeneralTipsAndTricks
(2) Also, you
I am trying to build a python program that will reset a user's account
(password) on a windows machine (NOTE: my intention here is not to implement
anything malicious {and I know about Trinity which is very useful}, but I
just wanted a challenge and do it myself.). I have been working with win32
application needed and inserted
them in the email folder within the library.zip. I fired up the
application and it worked like a champ.
On 2/27/07, Sick Monkey [EMAIL PROTECTED] wrote:
Maybe this is not the board to post this, but hopefully with all of the
python experts out there maybe one
Awesome. That is good to know.
On 2/28/07, Thomas Heller [EMAIL PROTECTED] wrote:
Sick Monkey schrieb:
Ok I found an extremely easy way to resolving this issue (I cannot
believe I
did not think of it sooner).
After Py2exe created the .exe file I noticed a library.zip file. I
took a
look
Here you are:
from win32com.client import GetObject
wmiObj = GetObject(winmgmts:MGW01641\\root\\cimv2)
diskinfo = wmiObj.ExecQuery(Select * from Win32_LogicalDisk)
for disk in diskinfo:
...print disk.Name, disk.FreeSpace
...
A: None
C: 16978259968
D: None
On 28 Feb 2007 12:26:31
Sorry, I forgot to make a change. You will need to change COMPUTER_NAME
~~~
from win32com.client import GetObject
wmiObj = GetObject(winmgmts:COMPUTER_NAME\\root\\cimv2)
diskinfo = wmiObj.ExecQuery(Select * from Win32_LogicalDisk)
for disk in diskinfo:
I am not certain if I understand your problem, but I think you are just
trying to read in a string and create a visable matrix. If that is true,
then may some of the code below will work. This is in no way elegant.
++
count = 1
width = 2
I have just gotten into pyHook, so I could be incredibly wrong, but I have
researched a lot into your problem. (cuz I have the same question)
I think the python program has to be on the remote machine becuase from my
understanding pyHook just reads in the windows' keyboard driver. And when
you
Do you mean:
import time, os
dir = C:\\Documents and Settings\\somepath\\
fileName = time.strftime(%d%m%Y)
finalname = %s%s.txt % (dir,fileName)
print finalname
C:\Documents and Settings\somepath\27022007.txt
On 27 Feb 2007 06:24:41 -0800, svata [EMAIL PROTECTED] wrote:
Hello,
as I'm new
I personally would get Programming Python, Third Edition
http://www.oreilly.com/catalog/python3/
On 2/27/07, Wensui Liu [EMAIL PROTECTED] wrote:
Good morning, all,
I just start learning python and have a question regarding books for a
newbie like me.
If you are only allowed to buy 1 python
I have a quick question about handling values with special characters.
Lets say I have a file which contains:
==
blah#blah
==
Here is what I have for my code:
f6 = open(fileAttached)
msInfo = f6.readlines(); f6.close()
= varName.strip()
On 2/27/07, Sick Monkey [EMAIL PROTECTED] wrote:
I have a quick question about handling values with special characters.
Lets say I have a file which contains:
==
blah#blah
==
Here is what I have for my code:
f6
Maybe this is not the board to post this, but hopefully with all of the
python experts out there maybe one of you have encountered this.
I wrote an application that sends an email with an attachment. When I run
it, it runs great with no issues what-so--ever.
When I thought I was finally
You should use os.popen() instead of os.system.
os.popen() will return a file-like object that is connected to the stdout of
the system command; you can then use that object's read()/readlines()
method(s) to assign that output to a Python variable.
http://docs.python.org/lib/module-popen2.html
I had a do something similar. I had to get a program to traverse through a
directory and delete all files with a specific file extension. (The program
below will delete files, so I do not recommend you running it without paying
close attention to it.)
This program will start at a given
] wrote:
En Sun, 18 Feb 2007 23:37:02 -0300, Sick Monkey [EMAIL PROTECTED]
escribió:
Well if this cannot be done, can a thread call a function in the main
method?
I have been trying and have not been successive. Perhaps I am using
thread
incorrectly.
The safe way to pass information between
Do you mean epoch time? if so, the below example would work.
import time,datetime
t = datetime.datetime.now()
print t
2007-02-20 13:09:34.851000
print Epoch Seconds:, time.mktime(t.timetuple())
Epoch Seconds: 1171994974.0
# go the other way
epochtime = 1171994974
now =
Great, thanks for the tip Gabriel!
On 2/18/07, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Sun, 18 Feb 2007 23:37:02 -0300, Sick Monkey [EMAIL PROTECTED]
escribió:
Well if this cannot be done, can a thread call a function in the main
method?
I have been trying and have not been
Is there anyway to get 2 python threads to talk to one another?
I have a GUI which is spawning a thread to make a large calculation (that
way the GUI does not appear to be non responsive). I am trying to attach a
progress bar to the threaded action. As the thread is calculating data, I
would
Well if this cannot be done, can a thread call a function in the main
method?
I have been trying and have not been successive. Perhaps I am using thread
incorrectly.
On 2/18/07, Sick Monkey [EMAIL PROTECTED] wrote:
Is there anyway to get 2 python threads to talk to one another?
I have a GUI
Hello All.
I have a question concerning searching data within dictionaries.
Lets say I have a dictionary called db.
db = {'[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none', '[EMAIL
PROTECTED]':'none',
'[EMAIL PROTECTED]':'none',}
And I want to pull out all of the gmail.com addresses..
Even though I am starting to get the hang of Python, I continue to find
myself finding problems that I cannot solve.
I have never used dictionaries before and I feel that they really help
improve efficiency when trying to analyze huge amounts of data (rather than
having nested loops).
Basically
:
En Tue, 06 Feb 2007 20:31:17 -0300, Sick Monkey [EMAIL PROTECTED]
escribió:
Even though I am starting to get the hang of Python, I continue to find
myself finding problems that I cannot solve.
I have never used dictionaries before and I feel that they really help
improve efficiency when
22:18:07 -0300, Sick Monkey [EMAIL PROTECTED]
escribió:
I have never seen this with open(fname,'r') as finput:
It is actually throwing an error . Do I have to import a special
library to
use this?
File dictNew.py, line 23
with open(fname,'r') as finput:
^
SyntaxError
If you need to extend your PATH variable, I have used this in the past.
This should not require a reboot.
~~
def AddSysPath(new_path):
new_path = os.path.abspath(new_path)
do = -1
if os.path.exists(new_path):
do = 1
# check
It was a little hard to follow your logic of your sample code (writing,
reading and writing again), but
(1)The difference between r and r+.
- 'r+' opens the file for both reading and writing.
- 'r' should be used when the file will only be read.
I am not sure on how you want to store the
First off, I am just learning Python, so if there is a more efficient way to
do this, then I am all ears (NOTE: The code below is something that I
was messing with to learn threads... So some functionality is not
applicable for your needs..I just wanted to show you a demonstration)
One
I am trying to write a python script that will compare 2 files which
contains names (millions of them).
More specifically, I have 2 files (Files1.txt and Files2.txt).
Files1.txtcontains 180 thousand names and
Files2.txt contains 34 million names.
I have a script which will analyze these two
Google, search.
km [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED] ???...
Hi all,
Well this doesnt explain new style classes. let me be more clear. is there
any online tutorial/ recommended book which deals explicitly with object
oriented programming in python?
regards,
KM
Try this online book, it may help, the url is: http://www.byteofpython.info
Hi all,
Is there any good step by step online tutorial on OOPS concepts in python
?
i have checked some on the python.org.__doc__ page but couldnt make much
sense. especially i need help on newstyle classes.
I install the original python(www.python.org), it works with wxpython and
DrPython very very well.
But your case seem to be due to DrPython is not programed for Cygwin. You
should read through the system requirement of DrPython. As remember, it
stated the www.python.org only ( ;
Hi,
Did
Bittorrent, one of the most actively used p2p protocols is _written_ in
python.
Diez B. Roggisch
Hey man, no, the jxta p2p protocols is not mean the bittorrent stuff. It is
a fully decentralized network protocol, not confine to file transfer.
--
wxPython rules ( ;
Go to http://wxpython.org for details...
Florian Lindner [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED] ???...
Hello,
I've read the chapter in the Python documentation, but I'm interested in a
a
more in-depth comparision. Especially regarding how pythonic it is and how
well
Hi all, which should be install? Really confused @@...
Is that mean unicode version used for programming in language other than
English?
--
http://mail.python.org/mailman/listinfo/python-list
Many Thanks ( :
Hi all, which should be install? Really confused @@...
Unicode.
Is that mean unicode version used for programming in language other than
English?
No. The Unicode version allows the underlying wxWidgets GUI toolkit to
use Unicode text. You want this.
On certain
They both work, thanks for your instruction ( :
I suspect you are mixing program code for the namespace version (import
wx) with the old method of importing (from wxPython.wx import *).
Here are two version of a very simple app... try both and see if you get
any errors. And if so, _please_
Bright ( ; You show me a crystal clear explaination.
As a newbie in python and even oop, I find the python documentation is not
easy to figure out. That's great with you guys so nice here.
This is very good! wxApp is never defined if you use import wx. You
must use wx.wxApp instead.
If you
Although I am a newbie in programming, I read from a java book (in my native
language) saying that the purpose of Object Oriented Programming are:
1. Use a real world concept in constructing program (here everything are
objects with there properties and methods/actions);
2. Simplify coding;
3.
Thx very much, I got the point now ( ;
The latter. It's not completely self contained, there is an
..exe and some dll files that need to be distributed together.
It's explained very clearly by the py2exe web site:
http://starship.python.net/crew/theller/py2exe/
Never used google before?
I just learn to make a blank windows frame with python and wxpython. I found
the statment import wx cannot work as the original from wxPython.wx
import *. I see in the readme file of wxpython that if I install it as the
default one, I can use import wx instead of the long one. What is wrong?
The
Which version of wxPython are you running? What do you mean by does not
work...does the import fail or is your code giving errors?
It is the current new version 2.6. The error message said that the class
wxApp is not defined...
But when using the default from wxPython.wx import *, it works.
python -o foo.exe foo.py
Is that a real command that can be use?
--
http://mail.python.org/mailman/listinfo/python-list
It is the current version of wxPython(2.6). But follow you instruction it
still can't work...
But if using the default from wxPython.wx import *, it work, don't know
what is the problem. May be this is an old example that cannot work with
import wx. Because I get another example and it is ok.
Read through python site for programming tool, really plenty of choices :-)
(For c++, I just can't breath with very very limited choices)
Tried Spe, it come with wxGlade built-in very nice(is Spe still actively
develop?). But seem that Boa Constructor and PyDev(the plug-in for Eclipse)
also worth
And then example.pyc will appear beside example.py. This new file does
not require example.py (you can even delete it), and works on any
computer with Python installed
Filip, you can read through my mind (-: You just told me what I want to know
exactly, even I can't ask the question correctly.
But those files can be decompyled.
Hi, so which way to go?
--
http://mail.python.org/mailman/listinfo/python-list
What about eric?
Good, it seem a very capable ide. But it require qt and for linux only?
(can't find the system requirement)
I have been using PyDev for some time, but i think it is not always very
handsome (e.g. writing a 5-line script in vim needs less time than
eclipse startup ;-) otoh,
py2exe has nothing to do with C or make files. You create a
setup.py file containing a couple lines of python. You run
that python program, and you end up with an .exe file and some
associated .dll files. I typically use inno-setup to create an
installer.exe that creates a desktop icon and
* Don't underestimate IDLE, it's surprisingly capable considering it's
just a dinky little thing
Yes, I believe IDLE is the a unbeatible last resort for python (-:
* SPE has great features, but the pure-Python-ness makes it slow!
Is it related to wxpython you mean? or program with GUI in tk
Hi all, I am new to programming, already have a glace on introduction of
c++, java and finally decided on python. But I found that the .py file is
just like the source file, how can I make a program without revealing its
source? (may be my question is a little bit stupid)
--
76 matches
Mail list logo