Questions tagged [linecache]

This tag refers to the Python linecache unit, which allows random access to the lines of a text file.

This tag refers to the Python linecache unit, which allows random access to the lines of a text file. See https://docs.python.org/2/library/linecache.html

54 questions
0
votes
1 answer

bundle install against an older version of ruby for one gem

I can install the linecache (0.46) gem against ruby v 1.8.x, but not 2.0.0. When I run bundle install, I want to specify that I want to install all gems against 2.0.0 except linecache, which I want to install against 2.0.0. How can I do that?
Rose Perrone
  • 61,572
  • 58
  • 208
  • 243
0
votes
1 answer

Linecache adding an extra line to the line that i get

When i try to get a line using linecache in python. loginpass = raw_input("> ") if loginpass == linecache.getline('Password.txt', 1): The line that it gets always returns with an extra line. So if line one is "Test" It returns "Test " It worked…
0
votes
1 answer

linecache19 with ruby 1.9.3-p194 and rvm

I've been trying to install linecache19 following these instructions curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem gem install linecache19-0.5.13.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p194/ I seem to be…
Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
0
votes
2 answers

Getting error while installing lincache19 in rails project

i am using ruby 1.8.7 and rails 3.0.12 for my project. when i run "bundle install", i get the following error. Gem::InstallError: linecache19 requires Ruby version >= 1.9.2. An error occurred while installing linecache19 (0.5.12), and Bundler cannot…
Ramiz Raja
  • 5,942
  • 3
  • 27
  • 39
0
votes
2 answers

Installing rails 3

I'll be very grateful id someone can explain me what does that mean: ror@ubuntu:$ sudo gem install linecache19 -v '0.5.12' ERROR: Error installing linecache19: linecache19 requires Ruby version >= 1.9.2. ror@ubuntu:$ ruby -v ruby 1.9.3p194…
Benjamin Harel
  • 2,906
  • 3
  • 24
  • 32
-1
votes
1 answer

TypeError while working with a Python list

In the following code fragment: def func_5_2(datei, num): import linecache i = 0 number = num + 1 l = [] while True: l[i] = linecache.getline(datei, number) if (l[i] == ''): break Is it possible to…
user1081715
  • 109
  • 1
  • 1
  • 4
-1
votes
1 answer

How to read a specific line from a gzip file with python

I have a big gzip file (11GB) and I want to print as fast as possible the line that I want with Python. I have tried to do it with linecache.getline(), but as the own function open the file, you are not able to open it with gzip.
-2
votes
1 answer

Python code to run for next 100 days from today

I want to run below line of code for 200 days from today. Suppose today is 1st days so my code is- line = linecache.getline("lines1.txt",1) print(line) Suppose today is 2nd days so my code is- line =…
-3
votes
1 answer

Tried to write "cracker" - OFC it doesnt work but i think it could xD

I am quite new to python and i tried to write "cracker" (not really, just a programme that writes all possible combinations). I used linecache and then just while loops (far too many). The idea was to make a dictionary with a-Z and 0-9 characters…
Bob
  • 347
  • 2
  • 3
  • 12
1 2 3
4