I’m a beginner. I downloaded Python and when I look at IDLE it tells me to
update TCL. I downloaded updated Active TCL and installed it but can’t figure
how to use update to get IDLE corrected.
Any help?
___
Tutor maillist - Tutor@python.org
To unsu
On 06/02/2017 09:07 PM, Mats Wichmann wrote:
I don't think "what the authors might want" is the only factor here.
Personally, I think these programming challenge sites probably do more
harm than good, discouraging people that they're not good enough to be a
programmer because they can't solve t
Qk. vv"::.:
On Oct 24, 2016 6:08 PM, "Elliott Andrews"
wrote:
Hi there, I am making a program in python based on a Subway operation. All
descriptions and comments codes are provided in the attached program. I've
been using IDLE to run the program and it seems to work the way I want it
too.
Ho
Please include the complete stack
trace error message
It will help in determining what the error is.
Jay
On 07/19/2014 05:27 PM, LN A-go-go
wrote:
I have given it all I got: a week trying to open
Deb,
Can you show us your full code listing or if it is lengthy the relevant
section showing the print statement. My guess is your print formating is
not specified correctly and it is rounding to the nearest whole number.
Jay
--
Jay Lozier
jsloz...@gmail.com
_
ly
against a person. Then write the "do stuff" to replicate that. Hint:
you do not need to generate random guesses within the while loop.
--
Jay Lozier
jsloz...@gmail.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
tes over the range from 0 to n-1 (5 times). I
included the index variable in the print to show the increase of the index.
The results for both:
0 some string
1 some string
2 some string
3 some string
4 some string
--
Jay Lozier
jsloz...@gmail.com
_
Alan
I am planning to store the passwords encrypted. This part is allow a
user to generate and view the generated password.
Ben got me pointed to a snippet I can use. I was trying to do something
the hard way.
Jay
On 03/06/2014 07:34 PM, Alan Gauld wrote:
On 06/03/14 23:32, Jay Lozier
"", line 1, in
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 0:
invalid start byte
>>>
I am probably missing something very obvious.
Thanks in advance!
--
Jay Lozier
jsloz...@gmail.com
___
Tuto
,
Marc*
*
The variables low_range and high_range are not modified. The arguments
to random.randint do not change the initial values of the variables,
only the actual values passed.
--
Jay Lozier
jsloz...@gmail.com
___
Tutor maillist - Tutor@python.or
ally able to help
> me, so I was wondering I give it a try here.
> Thanks,
> Rafael
Rafael,
I have both Python 2.7.3 and 3.3.0 installed on openSUSE 12.3. To use
3.3 I enter python3.3 at the prompt. If I enter python it defaults to
2.7.3
In the shebang #!/usr/bin/env pyt
e runs correctly as written. There are no
error messages.
I was able to run the code without any errors. I copied and pasted the
code into a text editor (Notepad on Windows or idle3) and removed the
extraneous prompts, echoed output, and spaces.
When saving the file the extension should be *.py.as in pizza.py
--
Jay Lozier
jsloz...@gmail.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
d occur. Often it is suitable error because one does
not spot that an intermediate calculation is incorrectly implemented.
--
Jay Lozier
jsloz...@gmail.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
set "totalFile" to your main output file and then
call the script as "scriptname.py /path/to/datfile/directory".
--
Jay Deiman
\033:wq!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
?%s' % \
urllib.urlencode(options)
u = urllib.urlopen(url)
# Here you can read the response if needs be
response = u.read()
u.close()
=
That's about it.
--
Jay Deiman
\033:wq!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
os.getpid()
time.sleep(30)
os._exit(0)
You should be able to verify that you have that process still running
after the main process exits.
--
Jay Deiman
\033:wq!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Thanks this is much more simple and is what i need.
On Sun, Feb 15, 2009 at 9:29 PM, Lie Ryan wrote:
> On Sun, 15 Feb 2009 14:22:09 +0100, Andre Engels wrote:
> > What is 'new' in your solution? Apart from that, the following looks
> > simpler:
> >
> url = "http://this/is/my/url/to/parse";
nk it wont work as i dont know how long my url
would be in my real application.
Thanks,
Newbie,
Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Thanks bob.
I want to search any characters in test after
https://www.localhost.org/<https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql>and
the search will end after it finds another /
and when i print it will display *testmodule*.
Newbie,
Jay
On Sun, Feb 1, 2009 at 2
Hi,
I'm a newbie trying to learn python. Kindly help me on string formatting.
test = https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql
what will i use to print this output?
1, https://www.localhost.org/
2. testmodule
3. /dev/trunk/admin/sql/mytest.sql
Thanks,
CENT' ,
'LINE1:mph#FF:My Speed' ,
r'GPRINT:msmax:Max\: %6.1lf mph' ,
r'GPRINT:msavg:Avg\: %6.1lf mph' ,
r'GPRINT:msmin:Min\: %6.1lf mph\l' ,
r'GPRINT:mspct:95th Perc\: %6.1lf mph\l'
)
- -
Me personally, both "Learning Python" and "Core Python Programming". I am
by no means an expert, but both of these books are excellent and were quite
helpful.
jay
On Thu, Jun 19, 2008 at 1:56 PM, Zameer Manji <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNE
rom:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *jay
> *Sent:* Friday, May 16, 2008 9:44 AM
> *To:* tutor@python.org
> *Subject:* Re: [Tutor] Getting started with Python
>
> Have you tried this ?
>
> import sys
> sys.path.append('/directory1/d
Have you tried this ?
import sys
sys.path.append('/directory1/directory2')
import file.py
j
On Fri, May 16, 2008 at 10:20 AM, Moishy Gluck <[EMAIL PROTECTED]>
wrote:
>
>
> On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck <[EMAIL PROTECTED]>
> wrote:
>
>> You need to place a "__init__.py" file in
dir = '/xen/domains2/machinename/disk.img'
a = dir.split('/')[3]
is what I would use...
On Fri, May 2, 2008 at 12:38 PM, Spencer Parker <[EMAIL PROTECTED]>
wrote:
> Well...it gives me the entire path...I am not running this script from the
> actual directory...I am running it from a secure user
Wayne,
Is this a Linux box? If so, you might consider setting up NTP to sync to an
outside time source. We do that here and it works quite well, even
accounting for drifting. If this is a Windows machine, I believe those are
already synced with the PDC, if joined to a Domain, but I might be wro
I run MySQLdb with Python 2.5.1, but I had to build it manually. It was not
part of any prebuilt package on my RedHat box. You should be able to do the
same.
J
On Jan 23, 2008 10:01 AM, <[EMAIL PROTECTED]> wrote:
> I decided to install Python2.5 on the server machine to save me the time
> for
Have you looked into Paramiko?
http://www.lag.net/paramiko/
Its a port of the ssh2 protocol for python. It might be easier to do this
using that that subprocess calls. Paramiko is quite nice, I use it a lot at
work. Just a suggestion
J
On Jan 23, 2008 3:42 AM, washakie <[EMAIL PROTECTED]
Python has a cvs module that will make this slightly more elegant
http://docs.python.org/lib/module-csv.html
j
On Jan 15, 2008 2:26 PM, lechtlr <[EMAIL PROTECTED]> wrote:
> I want to read an input file (file.csv) that has two columns. I want to
> read 2nd column and assign variables that are st
Well that is what I normally use, but I always have my hostname setup
properly. In your case, that socket call won't work. You could try this
link I found on google
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439094
jay
On Jan 2, 2008 9:00 AM, shawn bright <[EMAIL P
wrote:
> Thanks, Jay,
> in IDLE, this gave me 127.0.0.1
> is there a way to get my assigned ip instead of the localhost one?
> thanks
>
>
> On Jan 2, 2008 8:31 AM, jay < [EMAIL PROTECTED]> wrote:
>
> > You could perhaps use this method
> >
&
You could perhaps use this method
import socket
myIP = socket.gethostbyaddr(socket.gethostname())[2]
Jay
On Jan 2, 2008 8:25 AM, shawn bright <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> i am looking for an easy way to get my own ip address as a string from
> python.
> I
using the qualified name 'hkd1'.
It works for me after that...
Although I agree with others, simplification does wonders for debugging.
Jay
On Nov 16, 2007 3:09 PM, dave selby <[EMAIL PROTECTED]> wrote:
> I am trying to use the python logging module. At first glance it looks
>
I agree as well. Its not like there is a flood of these books coming
out, or emails slamming the list announcing them.
Jay
On Nov 6, 2007 1:38 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Rikard Bosnjakovic wrote:
> > On 06/11/2007, Michael H. Goldwasser <[EMAIL
again!
Jay
On 11/1/07, Eric Brunson <[EMAIL PROTECTED]> wrote:
>
> jay wrote:
> > Hello,
> >
> > If I have multiple Popen calls I need to make, how can I turn these
> > into a function?
>
> Since you're only interested in the output of the last command o
I would be sending an arbitrary number of PIPES with each function call.
I'm a little stumped as to how to handle the variables. If I have an
arbitrary number of PIPES, how do I declare my variables (p1, p2, p3,
etc...) ahead of time in the function??
Thanks for any suggestions!
Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Nice! I will have to test this
On 8/9/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> jay wrote:
> > I have a working solution for this, based largely on what Kent posted.
> > Thought I would post it for others in case your either curious, or need
> > to do
CE'] = 'notice'
>From there you can create your new logger and do a myLog.notice('test notice
message'). It works quite nicely, though its a lot of repeated code if you
have to define several new levels.
Thanks for your suggestion Kent. Will wait and see if
Kent,
Thanks for the suggestion. If will look more into your suggestions, and
also shoot a post over to comp.lang.python.
Jay
On 8/9/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> jay wrote:
> > Hello,
> >
> > I've been using the python logging module a lot
en possible? I don't like changing the standard
libraries, what happens if I have to upgrade python? My changes get
overwritten.
Can anyone offer some help or suggestions? Thanks
Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Thanks Kent and Andreas
That is exactly what I needed! Very nice indeed...
jay
On 7/26/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> jay wrote:
> > Hello all,
> >
> > If I import a module, which has a bunch of simple functions in it, is
> > there an eas
Hello all,
If I import a module, which has a bunch of simple functions in it, is there
an easy way to find the direct caller from inside one of those functions?
I'm looking to know which script has imported and thus called the library
function. Thanks!
Thanks for the reply Kent.
I found the problem. It was rather simple actually. I didn't have remote
logging enabled for syslog. Even though I was logging to localhost, for
some reason, it wouldn't work until I gave syslogd a -r at startup. Thanks
jay
On 7/25/07, Kent Johns
handler_syslog]
class: handlers.SysLogHandler
args: [('localhost', handlers.SYSLOG_UDP_PORT),
handlers.SysLogHandler.LOG_LOCAL6 ]
formatter: detailed
[logger_root]
level: INFO
handlers: syslog
end logging.conf ---
Thanks for any help!
jay
_
>
>
> "Jay Mutter III" <[EMAIL PROTECTED]> wrote
>
>
>> Whether I attempt to just strip the string or attempt to
>>
>> if line.endswith('No.\r'):
>> line = line.rstrip()
>>
>> It doesn't work.
>
> Ca
-
>
> Message: 4
> Date: Sun, 1 Apr 2007 16:46:05 +0100
> From: "Alan Gauld" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Tutor Digest, Vol 38, Issue 1
> To: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;
t/plain; format=flowed; charset="iso-8859-1";
> reply-type=original
>
>
> "Jay Mutter III" <[EMAIL PROTECTED]> wrote
>
>> for line in s:
>> jay = patno.findall(line)
>> jay2 = "".join(jay[0])
>> print jay2
>>
Kent;
Again thanks for the help.
i am not sure if this is what you menat but i put
for line in s:
jay = patno.findall(line)
jay2 = "".join(jay[0])
print jay2
and it prints fine up until line 111 which is a line that had
previously returned [ ] since a number didn'
Ok after a minute of thought I did solve my second question by simply
changing my RE to
(r'(\d{1}[\s,.]+\d{3}[\s,.]+\d{3})')
but still haven't gotten he first one.
On Mar 31, 2007, at 1:39 PM, Jay Mutter III wrote:
> I have the following that I am using to extract &qu
e to which you would
like to save the list of patent numbers? ')
p2 = open(prompt2,'aU')
patno = re.compile(r'(\d{1})[\s,.]+(\d{3})[\s,.]+(\d{3})')
for line in s:
jay = patno.findall(line)
print jay
which yields the following
[('1', '3
ot;
>
> Message: 2
> Date: Sat, 24 Mar 2007 19:25:10 -0400
> From: Jay Mutter III
> Subject: [Tutor] parsing text
> [...]
> 1.) when i do readlines and create a list and then print the list it
> adds a blank line between every line of text
> [...]
> ideas?
>
place(s,'p.','\n') in an attempt to put a CR in but
it just put the characters\n in the string.
ideas?
Thanks again
jay
Jay Mutter III wrote:
> Thanks for the response
> Actually the number of lines this returns is the same number of lines
> given when i put it
Script i have to date is below and
Thanks to your help i can see some daylight but I still have a few
questions
1.) Are there better ways to write this?
2.) As it writes out the one group to the new file for companies it
is as if it leaves blank lines behind for if I don't have the elif len
gt; f.close()
>>>
Note the differing placement of the f.close() statement, it's not
part of the while.
On 3/22/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
Jay Mutter III wrote:
> Why is it that when I run the following interactively
>
> f = open('Patents-1920.txt
Andre;
Thanks again for the assistance.
I have corrected the splitlines error and it works ( well that part
of anyway) correctly now.
On Mar 23, 2007, at 5:30 AM, Andre Engels wrote:
2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>:
I wanted the following to check each line and if it e
First thanks for all of the help
I am actually starting to see the light.
On Mar 22, 2007, at 7:51 AM, Kent Johnson wrote:
> Jay Mutter III wrote:
>> Kent;
>> Thanks for the reply on tutor-python.
>> My data file which is just a .txt file created under WinXP by an
>>
On Mar 23, 2007, at 5:30 AM, Andre Engels wrote:
2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>:
I wanted the following to check each line and if it ends in a right
parentheses then write the entire line to one file and if not then
write the line to anther.
It wrote all of the ) to one fi
')
for line in text:
if line[-1] in ')':
companies.write(line)
else:
patentdata.write(line)
in_file.close()
companies.close()
patentdata.close()
Thanks
jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
in a script there is no error?
Thanks
Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"Jay Mutter III" wrote
> See example next:
> A.-C. Manufacturing Company. (See Sebastian, A. A.,
> and Capes, assignors.)
>...
>Aaron, Solomon E., Boston, Mass. Pliers. No. 1,329,155 ;
>Jan. 27 ; v. 270 ; p. 554.
>
> For instance, I would like to go to end of
e
I am wondering if Python would be a good tool and if so where can I
find information on how to accomplish this or would I be better off
using something like the unix tool awk or something else??
Thanks
Jay
___
Tutor maillist - Tu
re's
someplace online you can get Django help such a specific mailing list.
-Jay
On Tuesday 18 October 2005 04:23 pm, nitin chandra wrote:
> Thanks Jay
>
> i guess the can be added only in one of the conf
> file. Which one should i add in?
>
> Thaks you. could you ple
make sense of all
this, because it's not really intuitive and it works differently than
traditional cgi programming. Take a look at:
http://modpython.org/live/current/doc-html/
to get you started, it's a lot more detailed and will probably answer your
questions better.
-Jay
On Th
t the handler to the directory and NOT include
subdirectories?
-Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
uts CGI programming examples online for
Python that might make this clearer so I can bug the list less and just read
some example code?
-Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
a
form that processes its input but maintains my template code wrapped around
it, so feel free to point out a "Pythonic" method. I just don't want to
duplicate the template code, and I can't find a nice neat solution like what
I've got in PHP.
-Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
similar mistakes in the past ;)
-Jay
On Sunday 14 August 2005 6:33 am, joe_schmoe wrote:
> The basic idea I was toying around with is to create a delete/uninstall
> program that would take the output of slocate and iterate through that
> deleting all o
le loop before the if statement, you'll get the result you
want.
-Jay
On Monday 08 August 2005 5:41 pm, Will Harris wrote:
> I am working my way through "python programming for the absolute beginner"
> and one of the challenges is to create a program that will flip a coin 100
&g
mparing the two for web development I'd be grateful for those as well.
-Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I think it was just a typo for "the python distro" that came out as "the
epython distro"...
On Thursday 21 July 2005 9:15 pm, Danny Yoo wrote:
> On Thu, 21 Jul 2005, Joseph Quigley wrote:
> > optparse.. Can I download that as a module or do I have to download
> > epython?
>
> Hi Joseph,
>
> optpa
se
list.insert() at the zero index, or use list.reverse() with list.append() to
flip the list around, add an item, then reverse it back to the original order
with one new item at the beginning.
-Jay
On Wednesday 03 August 2005 2:21 pm, Smith, Jeff wrote:
> Ummm...that doesn't d
and if so, is there any way to avoid this? I just
want it to match "--list" to "--list", not "--l" and "--li" and "--lis" etc.
-Jay
## Code chunk below ##
try:
options,args = getopt.getopt(sys.argv[1:], "Rf
and if so, is there any way to avoid this? I just want
it to match "--list" to "--list", not "--l" and "--li" and "--lis" etc.
-Jay
## Code chunk below ##
try:
options,args = getopt.getopt(sys.argv[1:], "Rf
PHP for a lot of things, but PHP works better with dynamic content
within html, so I use each one where it's easiest. However, if you're not
familiar with PHP, then I definitely wouldn't go out and learn PHP for this;
just stick with Python because you'll get it done faster w
stall
dependencies. If you use the raw "rpm" command, even that will tell you
"missing dependecy foo".
That being said, apt-get on debian is still my favorite (for sheer number of
available packages), but urpmi on mandrake or Yast on Suse are quite
excellent.
-Jay
On Wedn
If you don't mind using an external program, you could use the 'display'
command from ImageMagick.
-Jay
On Thursday 14 April 2005 07:59 pm, Ertl, John wrote:
> All,
>
> I have asked this question before, but one more time most have commented
> about manipulation b
Ok, it's a logic error in the while loop. Starting at the beginning: you
can't compare the value of "password" until the user inputs the value, which
is why it's requiring you to put password = "foobar" at the top. Otherwise,
password has no value, and as far as the interpreter is concerned, i
Only one version installed, and I could copy it over from elsewhere, but I
wouldn't be inclined to do so since it works right now.
-Jay
On Tuesday 05 April 2005 10:22 pm, Lee Harr wrote:
> >I have a python script that runs on my webserver every fifteen minutes.
> > It ha
d and ran the script, and it ran fine with no errors.
I got another such email from cron at 2:30am today ... anyone have any idea
what would cause such a seemingly random problem after months of working
fine?
(sample traceback is below)
-Jay
'import site' failed; use -v for traceback
Tr
How can I prepend something to a list? I thought that I could do
list.prepend() since you can do list.append() but apparently not. Any way to
add something to a list at the beginning, or do I just have to make a new
list?
-Jay
___
Tutor maillist
You want readlines() not readline() and it should work something like this:
remailfile = open("remail2.txt", r)
remails = remailfile.readlines()
for line in remails:
#do something
-Jay
On Friday 25 February 2005 05:14 pm, Valone, Toren W. wrote:
> I need to know how to read
Should be:
import sys
def main():
'''prints out the first command line argument'''
print sys.argv[1]
main()
On Friday 25 February 2005 04:35 pm, Richard gelling wrote:
> Hi,
>
> I am reading ' Learning Python second edition' by Mark Lutz and David
> Ascher, and I trying the code examples
ing into a function, then create a list of files, and
perform the parsing on each file. glob() lets you grab a whole list of files
matching the wildcard just like if you typed "ls *.dml" or whatever into a
command prompt. There wasn't too much info about specifically how you needed
nice way of leaping right into code so that if you have any prior knowledge,
you can use it to learn faster.
-Jay
On Wednesday 26 January 2005 09:09 pm, Jason White wrote:
>
> Greetings all, I'm new to python and thought I'd pop in here for
> advice. I've done object
One simple solution is to do:
fle = open(file)
contents = file.readlines()
file.close()
print contents[x] #or store this in a variable, whatever
-Jay
On Friday 21 January 2005 11:22, J. M. Strother wrote:
> I have a text file containing 336 records.
> I can read and print out the whol
etter way to use this with
filter(), how can i make filter use "if islink()!=true" as its condition?
The script is working now, (I know, I know, if it ain't broke, don't fix
it...) but I want to be a better programmer so more elegant solutions are
accepted gratefully.
-Jay
.
Thanks!
-Jay
On Thursday 20 January 2005 12:45, Kent Johnson wrote:
> It seems to me that if you want the five most recent changes, you don't
> have to keep a list of modified dates. Just get the modified date for all
> the files of interest and sort by date, then pick the top five.
ipt that a file has been modified, rather than run a crontab a couple
times an hour. Is there maybe a better way to store and check dates, etc.
Thanks!
-Jay
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
88 matches
Mail list logo